changeset 779:2a3fd4d89ec2

Mouse::SetCursorBitmap clean, mouse jump fix
author zipi
date Sun, 24 Mar 2013 00:33:32 +0000
parents 64cef5a0782a
children 93c6b78abf35
files Mouse.cpp
diffstat 1 files changed, 25 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Mouse.cpp	Sun Mar 24 00:33:27 2013 +0200
+++ b/Mouse.cpp	Sun Mar 24 00:33:32 2013 +0000
@@ -110,12 +110,20 @@
     {
       v10 = 0.0;
       v5 = 0.0;
-LABEL_12:
+//LABEL_12:
       v6 = v5;
       pAsyncMouse->SetHotspot(v6, v10);
-      goto LABEL_18;
+	  if ( !pAsyncMouse || (pAsyncMouse->LoadCursor(pName), !pAsyncMouse) )
+	  {
+		GetCursorPos(&Point);
+		SetCursorPos(Point.x, Point.y);
+	  }
+	  return;
     }
-    goto LABEL_20;
+    GetCursorPos(&Point);
+	ClientToScreen(hWnd,&Point);
+    SetCursorPos(Point.x, Point.y);
+    return;
   }
   if ( !strcmp(pName, "MICON2") )
   {
@@ -126,9 +134,16 @@
     {
       v10 = 14.0;
       v5 = 14.0;
-      goto LABEL_12;
+      v6 = v5;
+      pAsyncMouse->SetHotspot(v6, v10);
+	  if ( !pAsyncMouse || (pAsyncMouse->LoadCursor(pName), !pAsyncMouse) )
+	  {
+		GetCursorPos(&Point);
+		SetCursorPos(Point.x, Point.y);
+	  }
+	  return;
     }
-LABEL_20:
+//LABEL_20:
     GetCursorPos(&Point);
     SetCursorPos(Point.x, Point.y);
     return;
@@ -138,9 +153,12 @@
     v8 = (LONG)LoadCursorA(0, (LPCSTR)IDC_WAIT);
     SetClassLongA(hWnd, -12, v8);
   }
-LABEL_18:
+//LABEL_18:
   if ( !pAsyncMouse || (pAsyncMouse->LoadCursor(pName), !pAsyncMouse) )
-    goto LABEL_20;
+  {
+    GetCursorPos(&Point);
+    SetCursorPos(Point.x, Point.y);
+  }
 }
 // 506128: using guessed type int areWeLoadingTexture;