changeset 22:5c9930cc1959

18.01.13 (InventoryTab_Draw)
author Ritor1
date Fri, 18 Jan 2013 09:44:30 +0600
parents d5954a85577a
children 75d706037de4
files mm7_1.cpp
diffstat 1 files changed, 80 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/mm7_1.cpp	Thu Jan 17 17:56:08 2013 +0600
+++ b/mm7_1.cpp	Fri Jan 18 09:44:30 2013 +0600
@@ -789,10 +789,10 @@
 //----- (0041A2D1) --------------------------------------------------------
 void __fastcall CharacterUI_InventoryTab_Draw(unsigned int uPlayerID, char a2)
 {
-  Player *v2; // esi@1
+  Player *pPlayer; // esi@1
   char v3; // bl@1
   unsigned int v4; // eax@2
-  ItemGen *v5; // ebx@5
+  ItemGen *pItem; // ebx@5
   unsigned int v6; // eax@6
   Texture *v7; // esi@6
   __int16 v8; // ax@6
@@ -805,48 +805,43 @@
   int v15; // eax@13
   unsigned int v16; // ebx@15
   unsigned int v17; // edi@15
-  Texture *v18; // ebx@24
+  Texture *pTexture; // ebx@24
   double v19; // st7@26
   const char *v20; // [sp-8h] [bp-40h]@20
-  Player *v21; // [sp+14h] [bp-24h]@1
+  Player *pPlayer2; // [sp+14h] [bp-24h]@1
   int uTextureId; // [sp+18h] [bp-20h]@6
   int *v23; // [sp+1Ch] [bp-1Ch]@1
   int v24; // [sp+20h] [bp-18h]@5
-  ItemGen *v25; // [sp+24h] [bp-14h]@5
+  ItemGen *pItem2; // [sp+24h] [bp-14h]@5
   int v26; // [sp+28h] [bp-10h]@3
   signed int v27; // [sp+2Ch] [bp-Ch]@3
   int a2a; // [sp+30h] [bp-8h]@5
   int a3; // [sp+34h] [bp-4h]@5
 
   v23 = pRenderer->pActiveZBuffer;
-  v2 = pPlayers[uPlayerID];
+  pPlayer = pPlayers[uPlayerID];
   v3 = a2;
-  v21 = pPlayers[uPlayerID];
-  pRenderer->DrawTextureIndexed(
-    8u,
-    8u,
-    (Texture *)(uTextureID_507958 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507958] : 0));
+  pPlayer2 = pPlayers[uPlayerID];
+  pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_507958 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507958] : 0));
   if ( v3 )
   {
     v4 = pIcons_LOD->LoadTexture("fr_strip", TEXTURE_16BIT_PALETTE);
     pRenderer->DrawTextureIndexed(8u, 0x131u, (Texture *)(v4 != -1 ? (int)&pIcons_LOD->pTextures[v4] : 0));
   }
   v27 = 0;
-  v26 = (int)v2->pInventoryIndices;
+  v26 = (int)pPlayer->pInventoryIndices;
   do
   {
     if ( *(int *)v26 > 0 )
     {
       v24 = *(int *)v26 - 1;
       a3 = 32 * v27 / 14 + 17;
-      v5 = &v2->pInventoryItems[v24];
+      pItem = &pPlayer->pInventoryItems[v24];
       a2a = 32 * v27 % 14 + 14;
-      v25 = v5;
-      if ( v5->uItemID )
-      {
-        v6 = pIcons_LOD->LoadTexture(
-               pItemsTable->pItems[v5->uItemID].pIconName,
-               TEXTURE_16BIT_PALETTE);
+      pItem2 = pItem;
+      if ( pItem->uItemID )
+      {
+        v6 = pIcons_LOD->LoadTexture(pItemsTable->pItems[pItem->uItemID].pIconName, TEXTURE_16BIT_PALETTE);
         uTextureId = v6;
         v7 = (Texture *)(v6 != -1 ? (int)&pIcons_LOD->pTextures[v6] : 0);
         v8 = (v6 != -1 ? pIcons_LOD->pTextures[v6].uTextureWidth : 24);
@@ -866,7 +861,7 @@
         v15 = v13 + 32;
         if ( v9 < 14 )
           v14 = 14;
-        v16 = v5->uAttributes;
+        v16 = pItem->uAttributes;
         v17 = a2a + ((v15 - v10) >> 1) + pSRZBufferLineOffsets[a3 + ((((v14 - 14) & 0xFFFFFFE0) - v9 + 32) >> 1)];
         if ( !(v16 & 0xF0) )
         {
@@ -882,45 +877,92 @@
           {
             pRenderer->DrawTransparentGreenShade(a2a, a3, v7);
           }
-          goto LABEL_33;
+          ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1);
+          pPlayer = pPlayer2;
+          //goto LABEL_34;
+          ++v27;
+          v26 += 4;
+          break;
         }
         if ( (unsigned __int8)(v16 & 0xF0) != 16 )
         {
           if ( (unsigned __int8)(v16 & 0xF0) == 32 )
           {
             v20 = "sp28a";
-            goto LABEL_24;
+            pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)];
+            dword_50C9A8 -= pEventTimer->uTimeElapsed;
+            if ( dword_50C9A8 <= 0 )
+            {
+              dword_50C9A8 = 0;
+              LOBYTE(pItem2->uAttributes) &= 0xFu;
+              ptr_50C9A4 = 0;
+            }
+            v19 = (double)GetTickCount() * 0.1;
+            pRenderer->_4A63E6(a2a, a3, v7, pTexture, (signed __int64)v19, 0, 255);
+            ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1);
+            pPlayer = pPlayer2;
+            //goto LABEL_34;
+            ++v27;
+            v26 += 4;
+            break;
           }
           if ( (unsigned __int8)(v16 & 0xF0) == 64 )
           {
             v20 = "sp30a";
-            goto LABEL_24;
-          }
-          if ( (unsigned __int8)(v16 & 0xF0) == 128 )
-          {
-            v20 = "sp91a";
-LABEL_24:
-            v18 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)];
+            pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)];
             dword_50C9A8 -= pEventTimer->uTimeElapsed;
             if ( dword_50C9A8 <= 0 )
             {
               dword_50C9A8 = 0;
-              LOBYTE(v25->uAttributes) &= 0xFu;
+              LOBYTE(pItem2->uAttributes) &= 0xFu;
+              ptr_50C9A4 = 0;
+            }
+            v19 = (double)GetTickCount() * 0.1;
+            pRenderer->_4A63E6(a2a, a3, v7, pTexture, (signed __int64)v19, 0, 255);
+            ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1);
+            pPlayer = pPlayer2;
+            //goto LABEL_34;
+            ++v27;
+            v26 += 4;
+            break;
+          }
+          if ( (unsigned __int8)(v16 & 0xF0) == 128 )
+          {
+            v20 = "sp91a";
+            pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)];
+            dword_50C9A8 -= pEventTimer->uTimeElapsed;
+            if ( dword_50C9A8 <= 0 )
+            {
+              dword_50C9A8 = 0;
+              LOBYTE(pItem2->uAttributes) &= 0xFu;
               ptr_50C9A4 = 0;
             }
             v19 = (double)GetTickCount() * 0.1;
-            pRenderer->_4A63E6(a2a, a3, v7, v18, (signed __int64)v19, 0, 255);
-LABEL_33:
+            pRenderer->_4A63E6(a2a, a3, v7, pTexture, (signed __int64)v19, 0, 255);
             ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1);
-            v2 = v21;
-            goto LABEL_34;
+            pPlayer = pPlayer2;
+            //goto LABEL_34;
+            ++v27;
+            v26 += 4;
+            break;
           }
         }
         v20 = "sptext01";
-        goto LABEL_24;
-      }
-    }
-LABEL_34:
+        pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)];
+        dword_50C9A8 -= pEventTimer->uTimeElapsed;
+        if ( dword_50C9A8 <= 0 )
+        {
+          dword_50C9A8 = 0;
+          LOBYTE(pItem2->uAttributes) &= 0xFu;
+          ptr_50C9A4 = 0;
+        }
+        v19 = (double)GetTickCount() * 0.1;
+        pRenderer->_4A63E6(a2a, a3, v7, pTexture, (signed __int64)v19, 0, 255);
+        ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1);
+        pPlayer = pPlayer2;
+      }
+    }
+//LABEL_34:
     ++v27;
     v26 += 4;
   }