diff Mouse.cpp @ 47:8a8dd0164b12

BLV render cd check fix
author Nomad
date Tue, 23 Oct 2012 13:51:21 +0200
parents bcc051713d20
children
line wrap: on
line diff
--- a/Mouse.cpp	Mon Oct 22 20:54:14 2012 +0200
+++ b/Mouse.cpp	Tue Oct 23 13:51:21 2012 +0200
@@ -390,53 +390,15 @@
 }
 
 //----- (00469E3B) --------------------------------------------------------
-unsigned __int16 *Mouse::_469E3B()
+void Mouse::DrawCursorToTarget()
 {
-  unsigned __int16 *result; // eax@1
-  int v2; // esi@3
-  unsigned int v3; // edx@3
-  int v4; // edi@4
-  unsigned __int16 *v5; // ebx@5
-  unsigned __int16 *v6; // esi@6
-  unsigned int v7; // [sp+4h] [bp-Ch]@2
-  unsigned __int16 *v8; // [sp+8h] [bp-8h]@2
-  unsigned __int16 *v9; // [sp+Ch] [bp-4h]@2
+  if (!pCursorBitmap3_sysmembits_16bit)
+    return;
 
-  result = this->pCursorBitmap3_sysmembits_16bit;
-  if ( result )
-  {
-    v9 = this->pCursorBitmap3_sysmembits_16bit;
-    v7 = pRenderer->uTargetSurfacePitch;
-    v8 = pRenderer->pTargetSurface;
-    result = (unsigned __int16 *)this->field_44;
-    if ( (signed int)result < this->field_4C )
-    {
-      v2 = this->field_48;
-      v3 = pRenderer->uTargetSurfacePitch * (int)result;
-      do
-      {
-        v4 = this->field_40;
-        if ( v4 < v2 )
-        {
-          v5 = &v8[v3 + v4];
-          do
-          {
-            v6 = v9;
-            ++v9;
-            ++v4;
-            *v5 = *v6;
-            v2 = this->field_48;
-            ++v5;
-          }
-          while ( v4 < v2 );
-        }
-        v3 += v7;
-        result = (unsigned __int16 *)((char *)result + 1);
-      }
-      while ( (signed int)result < this->field_4C );
-    }
-  }
-  return result;
+  auto pSrc = pCursorBitmap3_sysmembits_16bit;
+  for (uint y = field_44; y < field_4C; ++y)
+    for (uint x = field_40; x < field_48; ++x)
+      pRenderer->pTargetSurface[y * pRenderer->uTargetSurfacePitch + x] = *pSrc++;
 }
 
 //----- (00469EA4) --------------------------------------------------------