diff mm7_1.cpp @ 45:bcc051713d20

BLV render & seffects
author Nomad
date Mon, 22 Oct 2012 20:45:14 +0200
parents 93bf1d5f6a6d
children 79a30ee1ecdb
line wrap: on
line diff
--- a/mm7_1.cpp	Sun Oct 21 23:26:23 2012 +0600
+++ b/mm7_1.cpp	Mon Oct 22 20:45:14 2012 +0200
@@ -626,7 +626,7 @@
     &stru_AA1058[3].pSounds[6972 * v1 + 40720],
     pClassNames[stru_AA1058[3].pSounds[6972 * v1 + 40737]]);
   strcat(pTmpBuf, Source);
-  strcat(pTmpBuf, byte_4E2FD4);
+  strcat(pTmpBuf, "\xC" "00000");
   pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf, 0, 0, 0);
   result = dword_506528;
   a1.uFrameX = 12;
@@ -3093,12 +3093,12 @@
   v106.uViewportY = v12;
   v106.uViewportW = v12 + 128;
   v106.uViewportZ = v106.uViewportX + 128;
-  v106.field_8 = (signed int)(v106.uViewportX + 128 + v106.uViewportX) / 2;
+  v106.uScreenSpaceX = (signed int)(v106.uViewportX + 128 + v106.uViewportX) / 2;
   v106.field_10 = 65536;
   v106.field_14 = 65536;
-  v106.field_C = v115 + v12 + *(short *)(v11 + 18);
+  v106.uScreenSpaceY = v115 + v12 + *(short *)(v11 + 18);
   v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1);
-  v106.field_28 = 0;
+  v106.sZValue = 0;
   v106.uFlags = 0;
   pRenderer->Clip_v2(0, 0, 0x27Fu, 0x1DFu);
   pRenderer->FillRect(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, a5);
@@ -3113,7 +3113,7 @@
   if ( pRenderer->pRenderD3D )
   {
     v13 = &pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]];
-    v106.field_C = v115 + v106.uViewportY + v13->uBufferHeight;
+    v106.uScreenSpaceY = v115 + v106.uViewportY + v13->uBufferHeight;
     v222 = (IDirectDrawSurface *)v13->pTextureSurface;
     memset(&Dst, 0, 0x64u);
     Dst.dwSize = 100;
@@ -3127,13 +3127,13 @@
     v15 = v13->uAreaX;
     v119 = (signed int)v120 / 2;
     i = 0;
-    a4 = (char *)(v106.field_8 + v15 - (signed int)v120 / 2);
+    a4 = (char *)(v106.uScreenSpaceX + v15 - (signed int)v120 / 2);
     v115 = v13->uAreaY;
     v16 = v13->uAreaWidth + (signed int)v120 / 2 + v15 - (int)v120;
-    v124 = v106.field_C + v115 - v14;
+    v124 = v106.uScreenSpaceY + v115 - v14;
     v17 = v13->uAreaHeight + v115 - v14;
-    v116 = v106.field_8 + v16;
-    v119 = v106.field_C + v17;
+    v116 = v106.uScreenSpaceX + v16;
+    v119 = v106.uScreenSpaceY + v17;
     if ( (signed int)a4 < (signed int)v106.uViewportX )
     {
       v18 = v106.uViewportX - (int)a4;
@@ -3633,7 +3633,9 @@
   v60 = v59->pMonsterInfo.uSpell2ID;
   if ( v60 )
   {
-    sprintfex(pTmpBuf, &byte_4E3318, 0, pSpellStats->pInfos[v60].pShortName);
+    __debugbreak();
+    const char *fmt = "\xC\x25\x30\x35\x75\x9\x30\x36\x30\x25\x73\n";
+    sprintfex(pTmpBuf, fmt, 0, pSpellStats->pInfos[v60].pShortName);
     a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0);
     v58 = LOBYTE(v56->uFontHeight);
     a4 = &a4[v58 - 3];
@@ -4980,7 +4982,6 @@
 //----- (00420EFF) --------------------------------------------------------
 void __cdecl GameUI_WritePointedObjectStatusString()
 {
-  unsigned int zero; // edi@1
   int v1; // ebx@6
   GUIWindow *v2; // edi@7
   GUIButton *i; // ecx@11
@@ -5027,7 +5028,6 @@
   unsigned int pY; // [sp+D8h] [bp-8h]@1
   unsigned int v45; // [sp+DCh] [bp-4h]@21
 
-  zero = 0;
   pMouse->uPointingObjectID = 0;
   pMouse->GetClickPos(&pX, &pY);
   if ( (pX & 0x80000000u) != 0 || (signed int)pX > 639 || (pY & 0x80000000u) != 0 || (signed int)pY > 479 )
@@ -5146,7 +5146,7 @@
     if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions == 13 )
     {
       if ( dword_F8B19C != 2
-        || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == zero)
+        || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == 0)
         || v16 == -65536 )
         goto _return;
       v15 = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)ptr_507BC0->ptr_1C) + 4);
@@ -5156,9 +5156,9 @@
 LABEL_50:
       uLastPointedObjectID = 1;
 _return:
-      if ( pMouse->uPointingObjectID == zero )
-      {
-        if ( uLastPointedObjectID != zero )
+      if ( pMouse->uPointingObjectID == 0 )
+      {
+        if ( uLastPointedObjectID != 0 )
         {
           pStatusBarString[0] = 0;
           bForceDrawStatusBar = 1;
@@ -5170,7 +5170,7 @@
     if ( (signed int)pY < 350 )
     {
       v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];
-      if ( v14 == zero || v14 == -65536 || (unsigned int)v14 >= 0x1388 )
+      if ( v14 == 0 || v14 == -65536 || (unsigned int)v14 >= 0x1388 )
         goto _return;
       v15 = (ItemGen *)&pPlayers[uActiveCharacter]->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v14 + 5];
       goto LABEL_49;
@@ -5181,7 +5181,7 @@
       && (signed int)pY >= (signed int)pWindowList[0].uFrameY
       && (signed int)pY <= (signed int)pWindowList[0].uFrameW )
     {
-      for ( i = pWindowList[0].pControlsHead; i != (GUIButton *)zero; i = i->pNext )
+      for ( i = pWindowList[0].pControlsHead; i != (GUIButton *)0; i = i->pNext )
       {
         if ( i->uButtonType == 1 )
         {
@@ -5191,14 +5191,14 @@
             && (signed int)pY <= (signed int)i->uW )
           {
             v37 = (UIMessageType)i->field_1C;
-            if ( v37 == zero )
+            if ( v37 == 0 )
               goto LABEL_28;
             v38 = i->uControlParam;
             if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
             {
               pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = v37;
               pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v38;
-              *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = zero;
+              *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
               ++pMessageQueue_50CBD0->uNumMessages;
             }
             goto LABEL_131;
@@ -5210,28 +5210,31 @@
           {
             v45 = pX - i->uX;
             v45 = pY - i->uY;
-            if ( (double)(signed int)i->uWidth != 0.0 )
-            {
-              if ( (double)(signed int)i->uHeight != 0.0 )
-              {
-                //UNDEF(v32);
-                if ( v33 | v34 )
+
+            if (pX >= i->uX && pX <= i->uZ &&
+                pY >= i->uY && pY <= i->uW)
+            //if ( (double)(signed int)i->uWidth != 0.0 )
+            //{
+            //  if ( (double)(signed int)i->uHeight != 0.0 )
+            //  {
+                 //UNDEF(v32);
+                //if ( v33 | v34 )
                 {
                   v35 = (UIMessageType)i->field_1C;
-                  if ( v35 != zero )
+                  if ( v35 != 0 )
                   {
                     v36 = i->uControlParam;
                     if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
                     {
                       pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = v35;
                       pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v36;
-                      *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = zero;
+                      *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
                       goto LABEL_27;
                     }
                   }
                   goto LABEL_28;
-                }
-              }
+                //}
+              //}
             }
           }
           else
@@ -5343,16 +5346,11 @@
     --v1;
     if ( v1 <= 0 )
     {
-      zero = 0;
       goto LABEL_38;
     }
   }
 }
-// 4E28F8: using guessed type int uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions;
-// 506578: using guessed type int uLastPointedObjectID;
-// 5075E0: using guessed type int pVisibleWindowsIdxs[20];
-// 5C35BC: using guessed type int bForceDrawStatusBar;
-// F8B19C: using guessed type int dword_F8B19C;
+
 
 //----- (00421626) --------------------------------------------------------
 GUIWindow *GameUI_InitializeCharacterWindow(unsigned int _this)