Author: rloach
Date: 2007-01-13 13:41:29 -0500 (Sat, 13 Jan 2007)
New Revision: 70960

Modified:
   trunk/Mono.Xna/src/Microsoft.Xna.Framework.Game/Game.cs
   trunk/Mono.Xna/src/Microsoft.Xna.Framework/Input/GamePadButtons.cs
   trunk/Mono.Xna/src/Microsoft.Xna.Framework/Input/Mouse.cs
   trunk/Mono.Xna/src/Microsoft.Xna.Framework/Input/MouseState.cs
Log:
Fixes from Alan, Game.Exit() implemented.

Modified: trunk/Mono.Xna/src/Microsoft.Xna.Framework/Input/GamePadButtons.cs
===================================================================
--- trunk/Mono.Xna/src/Microsoft.Xna.Framework/Input/GamePadButtons.cs  
2007-01-13 17:29:01 UTC (rev 70959)
+++ trunk/Mono.Xna/src/Microsoft.Xna.Framework/Input/GamePadButtons.cs  
2007-01-13 18:41:29 UTC (rev 70960)
@@ -129,7 +129,7 @@
                 output += (output.Length == 0) ? "Back" : " Back";
             if (output.Length == 0)
                 output = "None";
-            return string.Format("{{Buttons:{2}}}", output);
+            return string.Format("{{Buttons:{0}}}", output);
         }
         #endregion
     }

Modified: trunk/Mono.Xna/src/Microsoft.Xna.Framework/Input/Mouse.cs
===================================================================
--- trunk/Mono.Xna/src/Microsoft.Xna.Framework/Input/Mouse.cs   2007-01-13 
17:29:01 UTC (rev 70959)
+++ trunk/Mono.Xna/src/Microsoft.Xna.Framework/Input/Mouse.cs   2007-01-13 
18:41:29 UTC (rev 70960)
@@ -5,6 +5,8 @@
 http://www.taoframework.com
 All rights reserved.
 
+Authors: Rob Loach (http://www.robloach.net)
+
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
@@ -87,7 +89,6 @@
             }
         }
 
-
         public static MouseState GetState()
         {
             return mouseState;
@@ -95,6 +96,7 @@
 
         public static void SetPosition(int x, int y)
         {
+            SdlDotNet.Input.Mouse.
             throw new NotImplementedException();
         }
 

Modified: trunk/Mono.Xna/src/Microsoft.Xna.Framework/Input/MouseState.cs
===================================================================
--- trunk/Mono.Xna/src/Microsoft.Xna.Framework/Input/MouseState.cs      
2007-01-13 17:29:01 UTC (rev 70959)
+++ trunk/Mono.Xna/src/Microsoft.Xna.Framework/Input/MouseState.cs      
2007-01-13 18:41:29 UTC (rev 70960)
@@ -39,23 +39,14 @@
 
         public static bool operator ==(MouseState left, MouseState right)
         {
-            if (left.LeftButton != right.RightButton)
-                return false;
-            if (left.MiddleButton != right.MiddleButton)
-                return false;
-            if (left.RightButton != right.RightButton)
-                return false;
-            if (left.ScrollWheelValue != right.ScrollWheelValue)
-                return false;
-            if (left.X != right.X)
-                return false;
-            if (left.XButton1 != right.XButton1)
-                return false;
-            if (left.XButton2 != right.XButton2)
-                return false;
-            if (left.Y != right.Y)
-                return false;
-            return true;
+            return (left.LeftButton == right.RightButton)
+                && (left.MiddleButton == right.MiddleButton)
+                && (left.RightButton == right.RightButton)
+                && (left.ScrollWheelValue == right.ScrollWheelValue)
+                && (left.X == right.X)
+                && (left.XButton1 == right.XButton1)
+                && (left.XButton2 == right.XButton2)
+                && (left.Y == right.Y);
         }
 
         public ButtonState LeftButton
@@ -124,17 +115,12 @@
 
         public override bool Equals(object obj)
         {
-            if (obj == null)
-                return false;
-            if (obj.GetType() != typeof(MouseState))
-                return false;
-            MouseState state1 = (MouseState)obj;
-            return (this == state1);
+            return (obj is MouseState) ? false : ((MouseState)obj).state == 
this.state;
         }
 
         public override int GetHashCode()
         {
-            throw new NotImplementedException();
+            return wheel + x ^ y + (int)left + (int)right + (int)middle + 
(int)xb1 + (int)xb2;
         }
 
         public override string ToString()

Modified: trunk/Mono.Xna/src/Microsoft.Xna.Framework.Game/Game.cs
===================================================================
--- trunk/Mono.Xna/src/Microsoft.Xna.Framework.Game/Game.cs     2007-01-13 
17:29:01 UTC (rev 70959)
+++ trunk/Mono.Xna/src/Microsoft.Xna.Framework.Game/Game.cs     2007-01-13 
18:41:29 UTC (rev 70960)
@@ -193,7 +193,7 @@
 
                public void Exit()
                {
-            throw new NotImplementedException();
+            host.Exit();
                }
 
                public void Run()

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to