Преглед на файлове

Merge branch 'master' of github.com:CartBlanche/MonoGame-Samples

Dominique Louis преди 13 години
родител
ревизия
07722676a4

+ 1 - 1
Samples/MacOS/HoneycombRush/HoneycombRush.cs

@@ -56,7 +56,7 @@ namespace HoneycombRush
             graphics.IsFullScreen = true;
 
             screenManager = new ScreenManager(this, Vector2.One);
-#elif WINDOWS || MAC
+#elif WINDOWS || MAC || LINUX
             graphics.PreferredBackBufferHeight = 480;
             graphics.PreferredBackBufferWidth = 800;            
 

+ 6 - 3
Samples/MacOS/HoneycombRush/Screens/GameplayScreen.cs

@@ -20,7 +20,10 @@ using HoneycombRush.GameDebugTools;
 using Microsoft.Xna.Framework.Input.Touch;
 using System.Xml.Linq;
 
+#if MAC
 using MonoMac.Foundation;
+#endif
+
 using System.IO;
 #endregion
 
@@ -134,9 +137,9 @@ namespace HoneycombRush
 
             //Loads configuration
 			
-			var config =   Path.Combine(NSBundle.MainBundle.ResourcePath,"Content/Configuration/Configuration.xml");
-            //ConfigurationManager.LoadConfiguration(XDocument.Load("Content/Configuration/Configuration.xml"));
-            ConfigurationManager.LoadConfiguration(XDocument.Load(config));
+			//var config =   Path.Combine(NSBundle.MainBundle.ResourcePath,"Content/Configuration/Configuration.xml");
+            ConfigurationManager.LoadConfiguration(XDocument.Load("Content/Configuration/Configuration.xml"));
+            //ConfigurationManager.LoadConfiguration(XDocument.Load(config));
 
 			ConfigurationManager.DifficultyMode = gameDifficultyMode;
 

+ 22 - 0
Samples/MonoGame.Samples.Linux.sln

@@ -45,6 +45,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StarWarrior", "Linux\StarWa
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InputReporter", "Linux\InputReporter\InputReporter.csproj", "{EC1FA46A-41D3-4F6E-8712-70133CCB3C6A}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HoneycombRush", "Linux\HoneycombRush\HoneycombRush.csproj", "{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -379,6 +381,26 @@ Global
 		{AE483C29-042E-4226-BA52-D247CE7676DA}.Release|Mixed Platforms.Build.0 = Release|Any CPU
 		{AE483C29-042E-4226-BA52-D247CE7676DA}.Release|x86.ActiveCfg = Release|Any CPU
 		{AE483C29-042E-4226-BA52-D247CE7676DA}.Release|x86.Build.0 = Release|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Debug|iPhone.Build.0 = Debug|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Debug|x86.Build.0 = Debug|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Release|Any CPU.Build.0 = Release|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Release|iPhone.ActiveCfg = Release|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Release|iPhone.Build.0 = Release|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Release|x86.ActiveCfg = Release|Any CPU
+		{C43ECFB0-CD92-4C17-ACF3-786BC0AE1D15}.Release|x86.Build.0 = Release|Any CPU
 		{D0E05092-60B2-47FF-B924-D5CDED0C0DD1}.Debug|Any CPU.ActiveCfg = Debug|x86
 		{D0E05092-60B2-47FF-B924-D5CDED0C0DD1}.Debug|Any CPU.Build.0 = Debug|x86
 		{D0E05092-60B2-47FF-B924-D5CDED0C0DD1}.Debug|iPhone.ActiveCfg = Debug|x86

+ 2 - 1
Tests/Linux/MouseGetStateAndIsMouseVisibleTester/MouseGetStateAndIsMouseVisibleTester.csproj

@@ -16,7 +16,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug</OutputPath>
-    <DefineConstants>DEBUG;LINUX</DefineConstants>
+    <DefineConstants>DEBUG; LINUX</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <PlatformTarget>x86</PlatformTarget>
@@ -45,6 +45,7 @@
   <ItemGroup>
     <Reference Include="System" />
     <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
   </ItemGroup>
   <ItemGroup>
     <Compile Include="..\..\MacOS\MouseGetStateAndIsMouseVisibleTester\MouseGetStateAndIsMouseVisibleTester\Enums.cs">

+ 7 - 8
Tests/MacOS/MouseGetStateAndIsMouseVisibleTester/MouseGetStateAndIsMouseVisibleTester/Game1.cs

@@ -8,6 +8,8 @@ using Microsoft.Xna.Framework.GamerServices;
 using Microsoft.Xna.Framework.Graphics;
 using Microsoft.Xna.Framework.Input;
 using Microsoft.Xna.Framework.Media;
+
+
 using System.Windows.Forms;
 
 namespace MouseGetStateAndIsMouseVisibleTester
@@ -34,8 +36,9 @@ namespace MouseGetStateAndIsMouseVisibleTester
 			Window.AllowUserResizing = true;
 
 			// Uncomment the line below to test full screen on startup.
-			//graphics.IsFullScreen = true;
-
+			graphics.IsFullScreen = true;
+			bFullScreen = true;
+			
 			 // Subscribe to the game window's ClientSizeChanged event.
 			Window.ClientSizeChanged += Window_ClientSizeChanged;
         }
@@ -103,11 +106,6 @@ namespace MouseGetStateAndIsMouseVisibleTester
             return graphics.PreferredBackBufferHeight;
         }//GetBackBufferWidth
         
-        public String GetStyleMask()
-        {
-        	return this.Window.Window.StyleMask.ToString();
-        }//GetStyleMask
-
 
         protected override void Update(GameTime gameTime)
         {
@@ -138,7 +136,7 @@ namespace MouseGetStateAndIsMouseVisibleTester
         {
         	if(bFullScreen) return;
         	
-        		
+#if MAC	
             int index;
             int upperBound;
             float fScreenWidth, fScreenHeight, fNewX, fNewY, fWindowWidth, fWindowHeight, fTitleBarHeight;
@@ -170,6 +168,7 @@ namespace MouseGetStateAndIsMouseVisibleTester
 			System.Drawing.SizeF sfSize = new System.Drawing.SizeF(pfSize);
 			System.Drawing.RectangleF rectTemp = new System.Drawing.RectangleF(pfLocation, sfSize);
 			this.Window.Window.SetFrame(rectTemp, true);
+#endif		
         }//CenterWindow
     }
 }

+ 34 - 16
Tests/MacOS/MouseGetStateAndIsMouseVisibleTester/MouseGetStateAndIsMouseVisibleTester/Program.cs

@@ -2,9 +2,26 @@ using System;
 
 namespace MouseGetStateAndIsMouseVisibleTester
 {
-	static class Program
-	{
 
+#if WINDOWS || XBOX || LINUX
+    static class Program
+    {
+        /// <summary>
+        /// The main entry point for the application.
+        /// </summary>
+        static void Main(string[] args)
+        {
+            using (Game1 game = new Game1())
+            {
+                game.Run();
+            }
+        }
+    }
+#endif
+#if MAC
+
+	static class Program
+	{	
 		/// <summary>
 		/// The main entry point for the application.
 		/// </summary>
@@ -13,26 +30,27 @@ namespace MouseGetStateAndIsMouseVisibleTester
 			MonoMac.AppKit.NSApplication.Init ();
 			
 			using (var p = new MonoMac.Foundation.NSAutoreleasePool ()) {
-				MonoMac.AppKit.NSApplication.SharedApplication.Delegate = new AppDelegate ();
-				MonoMac.AppKit.NSApplication.Main (args);
+				MonoMac.AppKit.NSApplication.SharedApplication.Delegate = new AppDelegate();
+				MonoMac.AppKit.NSApplication.Main(args);
 			}
 		}
-
-		class AppDelegate : MonoMac.AppKit.NSApplicationDelegate
+	}
+	
+	class AppDelegate : MonoMac.AppKit.NSApplicationDelegate
+	{
+		
+		public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
 		{
-
-			public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
-			{
-				using (Game1 game = new Game1()) {
-					game.Run ();
-				}
+			using (Game1 game = new Game1()) {
+				game.Run ();
 			}
+		}
 		
-			public override bool ApplicationShouldTerminateAfterLastWindowClosed (MonoMac.AppKit.NSApplication sender)
-			{
-				return true;
-			}
+		public override bool ApplicationShouldTerminateAfterLastWindowClosed (MonoMac.AppKit.NSApplication sender)
+		{
+			return true;
 		}
 	}
+#endif
 }
 

+ 4 - 4
Tests/MonoGame.Tests.Linux.sln

@@ -1,11 +1,11 @@
 
 Microsoft Visual Studio Solution File, Format Version 11.00
 # Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MouseGetStateAndIsMouseVisibleTester", "..\Linux\MouseGetStateAndIsMouseVisibleTester\MouseGetStateAndIsMouseVisibleTester.csproj", "{6BC96721-9A69-4698-BF22-7BDB319FF381}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoGame.Framework.Linux", "..\..\MonoGame\MonoGame.Framework\MonoGame.Framework.Linux.csproj", "{35253CE1-C864-4CD3-8249-4D1319748E8F}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoGame.Framework.Linux", "..\..\..\MonoGame\MonoGame.Framework\MonoGame.Framework.Linux.csproj", "{35253CE1-C864-4CD3-8249-4D1319748E8F}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lidgren.Network.Linux", "..\..\MonoGame\ThirdParty\Lidgren.Network\Lidgren.Network.Linux.csproj", "{AE483C29-042E-4226-BA52-D247CE7676DA}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lidgren.Network.Linux", "..\..\..\MonoGame\ThirdParty\Lidgren.Network\Lidgren.Network.Linux.csproj", "{AE483C29-042E-4226-BA52-D247CE7676DA}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MouseGetStateAndIsMouseVisibleTester", "Linux\MouseGetStateAndIsMouseVisibleTester\MouseGetStateAndIsMouseVisibleTester.csproj", "{6BC96721-9A69-4698-BF22-7BDB319FF381}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -27,6 +27,6 @@ Global
 		{AE483C29-042E-4226-BA52-D247CE7676DA}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(MonoDevelopProperties) = preSolution
-		StartupItem = ..\Linux\MouseGetStateAndIsMouseVisibleTester\MouseGetStateAndIsMouseVisibleTester.csproj
+		StartupItem = ..\..\MonoGame\MonoGame.Framework\MonoGame.Framework.Linux.csproj
 	EndGlobalSection
 EndGlobal