diff Mouse.cpp @ 2093:52415f8bf7c2

RasterLine2D (continue)
author Ritor1
date Thu, 12 Dec 2013 18:07:08 +0600
parents 259df09dfb50
children 7810cb3a5fb7
line wrap: on
line diff
--- a/Mouse.cpp	Thu Dec 12 13:55:42 2013 +0600
+++ b/Mouse.cpp	Thu Dec 12 18:07:08 2013 +0600
@@ -228,81 +228,61 @@
 //----- (00469CCD) --------------------------------------------------------
 void Mouse::DrawCursor()
 {
-  Mouse *v1; // esi@1
-  char v11; // zf@6
-  signed int v3; // eax@6
-  signed int v4; // ecx@6
-  Vec4_int_ *v5; // edx@21
-  int v6; // edi@21
-  int v7; // ebx@21
-  int v8; // eax@29
   unsigned int v9; // eax@31
 
-  v1 = this;
   if ( this->bInitialized )
   {
     if ( !this->field_8 && this->bActive && !this->field_C )
       pMouse->_469AE4();
-    v11 = v1->field_C == 0;
-    v3 = v1->uMouseClickX;
-    v4 = v1->uMouseClickY;
-    v1->field_F4 = 1;
-    if ( !v11 )
-      goto LABEL_12;
+    this->field_F4 = 1;
+    if ( this->field_C )
+    {
+      this->field_F4 = 0;
+      return;
+    }
     if ( pRenderer->bWindowMode )
     {
-      if ( v3 < 0 || v4 < 0 || v3 > 639 || v4 > 479 )
+      if ( this->uMouseClickX < 0 || this->uMouseClickY < 0 || this->uMouseClickX > 639 || this->uMouseClickY > 479 )
       {
-LABEL_12:
-        v1->field_F4 = 0;
+        this->field_F4 = 0;
         return;
       }
     }
     else
     {
-      if ( v3 < 0 )
-        v3 = 0;
-      if ( v4 < 0 )
-        v4 = 0;
-      if ( v3 > 639 )
-        v3 = 639;
-      if ( v4 > 479 )
-        v4 = 479;
+      if ( this->uMouseClickX < 0 )
+        this->uMouseClickX = 0;
+      if ( this->uMouseClickY < 0 )
+        this->uMouseClickY = 0;
+      if ( this->uMouseClickX > 639 )
+        this->uMouseClickX = 639;
+      if ( this->uMouseClickY > 479 )
+        this->uMouseClickY = 479;
     }
-    v5 = &v1->pCursorBitmapRect;
-    v6 = v3 + v1->uCursorBitmapPitch;
-    v7 = v4 + v1->field_5C[0];
-    v1->pCursorBitmapRect.y = v4;
-    v1->pCursorBitmapRect.x = v3;
-    v1->pCursorBitmapRect.z = v6;
-    v1->pCursorBitmapRect.w = v7;
-    if ( v3 < 0 )
-      v5->x = 0;
-    if ( v4 < 0 )
-      v1->pCursorBitmapRect.y = 0;
-    if ( v6 > 640 )
-      v1->pCursorBitmapRect.z = 640;
-    if ( v7 > 480 )
-      v1->pCursorBitmapRect.w = 480;
-    v8 = v1->pCursorBitmapRect.z;
-    v1->bActive = 0;
-    v1->uCursorBitmapWidth = v8 - v5->x;
-    v11 = v1->bRedraw == 0;
-    v1->uCursorBitmapHeight = v1->pCursorBitmapRect.w - v1->pCursorBitmapRect.y;
-    if ( !v11 )
+    this->pCursorBitmapRect.x = this->uMouseClickX;
+    this->pCursorBitmapRect.w = this->uMouseClickY + this->field_5C[0];
+    this->pCursorBitmapRect.y = this->uMouseClickY;
+    this->pCursorBitmapRect.z = this->uMouseClickX + this->uCursorBitmapPitch;
+    if ( this->uMouseClickX < 0 )
+      this->pCursorBitmapRect.x = 0;
+    if ( this->uMouseClickY < 0 )
+      this->pCursorBitmapRect.y = 0;
+    if ( this->pCursorBitmapRect.z > 640 )
+      this->pCursorBitmapRect.z = 640;
+    if ( this->pCursorBitmapRect.w > 480 )
+      this->pCursorBitmapRect.w = 480;
+    this->bActive = 0;
+    this->uCursorBitmapWidth = this->pCursorBitmapRect.z - this->pCursorBitmapRect.x;
+    this->uCursorBitmapHeight = this->pCursorBitmapRect.w - this->pCursorBitmapRect.y;
+    if ( this->bRedraw )
     {
       if ( pMouse->ptr_90 )
         v9 = 2 * pMouse->uCursorBitmapPitch;
       else
         v9 = 0;
-      pRenderer->_4A6DF5(
-        v1->pCursorBitmap_sysmem,
-        v9,
-        &v1->pCursorBitmapPos,
-        pRenderer->pTargetSurface,
-        pRenderer->uTargetSurfacePitch,
-        &v1->pCursorBitmapRect);
-      v1->bRedraw = false;
+      pRenderer->_4A6DF5( this->pCursorBitmap_sysmem, v9, &this->pCursorBitmapPos, pRenderer->pTargetSurface, pRenderer->uTargetSurfacePitch,
+        &this->pCursorBitmapRect);//срабатывает когда берём курсором вещь в инвенторе
+      this->bRedraw = false;
     }
   }
 }