changeset 2220:7dccb5752b66

for mouse continue
author Ritor1
date Mon, 17 Feb 2014 19:41:49 +0600
parents e6771956e74a
children c69013c186c7
files Mouse.cpp
diffstat 1 files changed, 17 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/Mouse.cpp	Mon Feb 17 17:28:06 2014 +0600
+++ b/Mouse.cpp	Mon Feb 17 19:41:49 2014 +0600
@@ -87,35 +87,36 @@
     }
     return;
   }
-  /*if ( !_strnicmp(pName, "MICON", 4) )
+  if ( !_strnicmp(pName, "MICON", 4) )
   {
     this->uCursorTextureID = pIcons_LOD->LoadTexture(pName, TEXTURE_16BIT_PALETTE);
     this->uCursorTextureID_2 = pIcons_LOD->LoadTexture(pName, TEXTURE_16BIT_PALETTE);
-    memset(&Dst, 0, sizeof(Dst));
-	//Texture texture = pIcons_LOD->pTextures[this->uCursorTextureID];
-    Dst.dwSize = 124;
 	if ( this->uCursorTextureID != pIcons_LOD->FindTextureByName("pending") )
 	{
-    if ( pRenderer->LockSurface_DDraw4((IDirectDrawSurface4 *)pIcons_LOD->pTextures[this->uCursorTextureID].pPalette16, &Dst, DDLOCK_WAIT) )
+    memset(&Dst, 0, sizeof(Dst));
+	Texture texture = pIcons_LOD->pTextures[this->uCursorTextureID];
+    Dst.dwSize = 124;
+
+    if ( pRenderer->LockSurface_DDraw4(pRenderer->pBackBuffer4, &Dst, DDLOCK_WAIT) )
     {
       unsigned __int8 * v6 = pIcons_LOD->pTextures[this->uCursorTextureID].pLevelOfDetail0_prolly_alpha_mask;
-      /*v9 = Dst.lpSurface;
-      v12 = 2 * (Dst.lPitch / 2 - texture->uTextureWidth);
+      void *surface = Dst.lpSurface;
+      __int32 v12 = 2 * (Dst.lPitch / 2 - texture.uTextureWidth);
 
-      for ( v13 = 0; v13 < texture->uTextureHeight; v13++ )
+      for ( uint y = 0; y < texture.uTextureHeight; y++ )
       {
-        for ( v10 = 0; v10 < texture->uTextureWidth; v10++ )
+        for ( uint x = 0; x < texture.uTextureWidth; x++ )
         {
-          if ( v5[*v6] )
-            *(_WORD *)v9 = texture->pPalette16[*v6];
-          v9 = (char *)v9 + 2;
+          if ( texture.pPalette16[*v6] )
+            *(_WORD *)surface = texture.pPalette16[*v6];
+          surface = (char *)surface + 2;
           ++v6;
         }
-        v9 = (char *)v9 + v12;
+        surface = (char *)surface + v12;
       }
-      ErrD3D((pIcons_LOD->pTextures[this->uCursorTextureID].pTextureSurface)->Unlock(0));
+      ErrD3D(pRenderer->pBackBuffer4->Unlock(0));
 	}
-    }*/
+    }
   }
   this->bActive = false;
   this->field_C = 1;
@@ -880,7 +881,7 @@
   result = Render::LockSurface_DDraw4(&pRenderer, a2, &Dst, 1);
   if ( result )
   {
-    //v5 = a1->pPalette16;
+    //v5 = texture->pPalette16;
     v6 = texture->pLevelOfDetail0_prolly_alpha_mask;
     v7 = texture->uTextureWidth;
     v8 = texture->uTextureHeight;