Mercurial > mm7
diff Mouse.cpp @ 920:34ed2d5e7cfb
MagicShopDialog clean and other
author | Ritor1 |
---|---|
date | Sun, 28 Apr 2013 19:11:36 +0600 |
parents | 346f7069676a |
children | c8a0f6d89c70 |
line wrap: on
line diff
--- a/Mouse.cpp Sat Apr 27 09:37:22 2013 +0600 +++ b/Mouse.cpp Sun Apr 28 19:11:36 2013 +0600 @@ -429,9 +429,9 @@ //----- (00469EA4) -------------------------------------------------------- void Mouse::_469EA4() { - Mouse *v1; // esi@1 - unsigned int v2; // eax@2 - Texture *v3; // edi@2 + //Mouse *v1; // esi@1 + unsigned int pTextureID; // eax@2 + Texture *pTexture; // edi@2 unsigned int v4; // ecx@3 unsigned int v5; // eax@3 unsigned int v6; // ebx@5 @@ -449,16 +449,14 @@ int v18; // [sp+1Ch] [bp-Ch]@27 int v19; // [sp+20h] [bp-8h]@15 unsigned __int16 *v20; // [sp+20h] [bp-8h]@28 - int v21; // [sp+24h] [bp-4h]@12 + int pTextureWidth; // [sp+24h] [bp-4h]@12 unsigned __int16 *v22; // [sp+24h] [bp-4h]@25 - v1 = this; + //v1 = this; if ( pParty->pPickedItem.uItemID ) { - v2 = pIcons_LOD->LoadTexture( - pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName, - TEXTURE_16BIT_PALETTE); - v3 = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0); + pTextureID = pIcons_LOD->LoadTexture(pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName, TEXTURE_16BIT_PALETTE); + pTexture = (Texture *)(pTextureID != -1 ? (int)&pIcons_LOD->pTextures[pTextureID] : 0); if (pAsyncMouse) { v4 = *((int *)pAsyncMouse + 6); @@ -481,47 +479,46 @@ v6 = 0; v15 = 0; } - if ( (signed int)(v3->uTextureWidth + a2) <= 640 ) - v21 = v3->uTextureWidth; + if ( (signed int)(pTexture->uTextureWidth + a2) <= 640 ) + pTextureWidth = pTexture->uTextureWidth; else - v21 = 640 - a2; - if ( (signed int)(v3->uTextureHeight + v6) <= 480 ) + pTextureWidth = 640 - a2; + if ( (signed int)(pTexture->uTextureHeight + v6) <= 480 ) { - v19 = v3->uTextureHeight; - v7 = v3->uTextureHeight; + v19 = pTexture->uTextureHeight; + v7 = pTexture->uTextureHeight; } else { v7 = 480 - v6; v19 = 480 - v6; } - if ( !v1->pCursorBitmap3_sysmembits_16bit - || a2 != v1->field_40 - || v6 != v1->field_44 - || a2 + v21 != v1->field_48 - || v6 + v7 != v1->field_4C ) + if ( !this->pCursorBitmap3_sysmembits_16bit + || a2 != this->field_40 + || v6 != this->field_44 + || a2 + pTextureWidth != this->field_48 + || v6 + v7 != this->field_4C ) { - if ( v1->pCursorBitmap3_sysmembits_16bit ) - free(v1->pCursorBitmap3_sysmembits_16bit); - v1->pCursorBitmap3_sysmembits_16bit = (unsigned __int16 *)operator new(2 * v3->uTextureHeight - * v3->uTextureWidth); - v1->field_40 = a2; - v1->field_48 = a2 + v21; - v1->field_44 = v6; - v1->field_4C = v6 + v19; + if ( this->pCursorBitmap3_sysmembits_16bit ) + free(this->pCursorBitmap3_sysmembits_16bit); + this->pCursorBitmap3_sysmembits_16bit = (unsigned __int16 *)operator new(2 * pTexture->uTextureHeight * pTexture->uTextureWidth); + this->field_40 = a2; + this->field_48 = a2 + pTextureWidth; + this->field_44 = v6; + this->field_4C = v6 + v19; } - v8 = v1->field_44; - v22 = v1->pCursorBitmap3_sysmembits_16bit; + v8 = this->field_44; + v22 = this->pCursorBitmap3_sysmembits_16bit; v17 = pRenderer->pTargetSurface; v16 = pRenderer->uTargetSurfacePitch; - if ( v8 < v1->field_4C ) + if ( v8 < this->field_4C ) { - v9 = v1->field_48; + v9 = this->field_48; v10 = pRenderer->uTargetSurfacePitch * v8; do { - v11 = v1->field_40; - v18 = v1->field_40; + v11 = this->field_40; + v18 = this->field_40; if ( v11 < v9 ) { v20 = &v17[v10 + v11]; @@ -533,22 +530,22 @@ ++v20; ++v22; *v13 = *v12; - v9 = v1->field_48; + v9 = this->field_48; } while ( v18 < v9 ); } v10 += v16; ++v8; } - while ( v8 < v1->field_4C ); + while ( v8 < this->field_4C ); v6 = v15; } if (pParty->pPickedItem.Broken()) - pRenderer->DrawTransparentRedShade(a2, v6, v3); + pRenderer->DrawTransparentRedShade(a2, v6, pTexture); else if (!pParty->pPickedItem.Identified()) - pRenderer->DrawTransparentGreenShade(a2, v6, v3); + pRenderer->DrawTransparentGreenShade(a2, v6, pTexture); else - pRenderer->DrawTextureTransparent(a2, v6, v3); + pRenderer->DrawTextureTransparent(a2, v6, pTexture); } } else @@ -556,7 +553,7 @@ if ( this->pCursorBitmap3_sysmembits_16bit ) { free(this->pCursorBitmap3_sysmembits_16bit); - v1->pCursorBitmap3_sysmembits_16bit = 0; + this->pCursorBitmap3_sysmembits_16bit = 0; } } }