diff mm7_5.cpp @ 59:5159d2e6f559

BLV render
author Nomad
date Fri, 26 Oct 2012 02:38:26 +0200
parents 41cbaabde2cb
children 30ec77bbd018
line wrap: on
line diff
--- a/mm7_5.cpp	Thu Oct 25 02:05:16 2012 +0200
+++ b/mm7_5.cpp	Fri Oct 26 02:38:26 2012 +0200
@@ -304,9 +304,12 @@
   if ( pMessageQueue_50CBD0->uNumMessages )
   {
     v0 = 1;
-    v1 = nullstring;
+    v1 = "";
     while ( 2 )
     {
+      if ( !pMessageQueue_50CBD0->uNumMessages )
+        break;
+
       pMessageQueue_50CBD0->PopMessage(&uMessage, &uMessageParam, (int *)&v199);
       switch ( uMessage )
       {
@@ -786,25 +789,25 @@
           uTextureID_507C00 = pIcons_LOD->LoadTexture("optkb_1", TEXTURE_16BIT_PALETTE);
           uTextureID_507C04 = pIcons_LOD->LoadTexture("optkb_2", TEXTURE_16BIT_PALETTE);
           pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_KeyMappingOptions, 0, 0);
-          pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, 0x71u, 0, 0, nullstring, 0);
-          pGUIWindow_CurrentMenu->CreateButton(19u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, 0x1A0u, 0, 0, nullstring, 0);
-          pGUIWindow_CurrentMenu->CreateButton(127u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, 0x1A1u, 0, 0, nullstring, 0);
-          pGUIWindow_CurrentMenu->CreateButton(127u, 0x144u, 0x6Cu, 0x14u, 1, 0, 0x1A2u, 0, 0, nullstring, 0);
-          pGUIWindow_CurrentMenu->CreateButton(19u, 0x144u, 0x6Cu, 0x14u, 1, 0, 0x7Fu, 0, 0, nullstring, 0);
-          pGUIWindow_CurrentMenu->CreateButton(129u, 0x94u, 0x46u, 0x13u, 1, 0, 0x1A3u, 0, 0, nullstring, 0);
-          pGUIWindow_CurrentMenu->CreateButton(129u, 0xA7u, 0x46u, 0x13u, 1, 0, 0x1A3u, 1u, 0, nullstring, 0);
-          pGUIWindow_CurrentMenu->CreateButton(129u, 0xBAu, 0x46u, 0x13u, 1, 0, 0x1A3u, 2u, 0, nullstring, 0);
-          pGUIWindow_CurrentMenu->CreateButton(129u, 0xCDu, 0x46u, 0x13u, 1, 0, 0x1A3u, 3u, 0, nullstring, 0);
-          pGUIWindow_CurrentMenu->CreateButton(129u, 224u, 70u, 19u, 1, 0, 0x1A3u, 4u, 0, nullstring, 0);
-          pGUIWindow_CurrentMenu->CreateButton(129u, 243u, 70u, 0x13u, 1, 0, 0x1A3u, 5u, 0, nullstring, 0);
-          pGUIWindow_CurrentMenu->CreateButton(129u, 262u, 70u, 0x13u, 1, 0, 0x1A3u, 6u, 0, nullstring, 0);
-          pGUIWindow_CurrentMenu->CreateButton(350u, 148u, 70u, 0x13u, 1, 0, 0x1A3u, 7u, 0, nullstring, 0);
-          pGUIWindow_CurrentMenu->CreateButton(350u, 167u, 70u, 0x13u, 1, 0, 0x1A3u, 8u, 0, nullstring, 0);
-          pGUIWindow_CurrentMenu->CreateButton(350u, 186u, 70u, 0x13u, 1, 0, 0x1A3u, 9u, 0, nullstring, 0);
-          pGUIWindow_CurrentMenu->CreateButton(350u, 205u, 70u, 0x13u, 1, 0, 0x1A3u, 0xAu, 0, nullstring, 0);
-          pGUIWindow_CurrentMenu->CreateButton(350u, 224u, 70u, 0x13u, 1, 0, 0x1A3u, 0xBu, 0, nullstring, 0);
-          pGUIWindow_CurrentMenu->CreateButton(350u, 243u, 70u, 0x13u, 1, 0, 0x1A3u, 0xCu, 0, nullstring, 0);
-          pGUIWindow_CurrentMenu->CreateButton(350u, 262u, 70u, 0x13u, 1, 0, 0x1A3u, 0xDu, 0, nullstring, 0);
+          pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, 0x71u, 0, 0, "", 0);
+          pGUIWindow_CurrentMenu->CreateButton(19u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, 0x1A0u, 0, 0, "", 0);
+          pGUIWindow_CurrentMenu->CreateButton(127u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, 0x1A1u, 0, 0, "", 0);
+          pGUIWindow_CurrentMenu->CreateButton(127u, 0x144u, 0x6Cu, 0x14u, 1, 0, 0x1A2u, 0, 0, "", 0);
+          pGUIWindow_CurrentMenu->CreateButton(19u, 0x144u, 0x6Cu, 0x14u, 1, 0, 0x7Fu, 0, 0, "", 0);
+          pGUIWindow_CurrentMenu->CreateButton(129u, 0x94u, 0x46u, 0x13u, 1, 0, 0x1A3u, 0, 0, "", 0);
+          pGUIWindow_CurrentMenu->CreateButton(129u, 0xA7u, 0x46u, 0x13u, 1, 0, 0x1A3u, 1u, 0, "", 0);
+          pGUIWindow_CurrentMenu->CreateButton(129u, 0xBAu, 0x46u, 0x13u, 1, 0, 0x1A3u, 2u, 0, "", 0);
+          pGUIWindow_CurrentMenu->CreateButton(129u, 0xCDu, 0x46u, 0x13u, 1, 0, 0x1A3u, 3u, 0, "", 0);
+          pGUIWindow_CurrentMenu->CreateButton(129u, 224u, 70u, 19u, 1, 0, 0x1A3u, 4u, 0, "", 0);
+          pGUIWindow_CurrentMenu->CreateButton(129u, 243u, 70u, 0x13u, 1, 0, 0x1A3u, 5u, 0, "", 0);
+          pGUIWindow_CurrentMenu->CreateButton(129u, 262u, 70u, 0x13u, 1, 0, 0x1A3u, 6u, 0, "", 0);
+          pGUIWindow_CurrentMenu->CreateButton(350u, 148u, 70u, 0x13u, 1, 0, 0x1A3u, 7u, 0, "", 0);
+          pGUIWindow_CurrentMenu->CreateButton(350u, 167u, 70u, 0x13u, 1, 0, 0x1A3u, 8u, 0, "", 0);
+          pGUIWindow_CurrentMenu->CreateButton(350u, 186u, 70u, 0x13u, 1, 0, 0x1A3u, 9u, 0, "", 0);
+          pGUIWindow_CurrentMenu->CreateButton(350u, 205u, 70u, 0x13u, 1, 0, 0x1A3u, 0xAu, 0, "", 0);
+          pGUIWindow_CurrentMenu->CreateButton(350u, 224u, 70u, 0x13u, 1, 0, 0x1A3u, 0xBu, 0, "", 0);
+          pGUIWindow_CurrentMenu->CreateButton(350u, 243u, 70u, 0x13u, 1, 0, 0x1A3u, 0xCu, 0, "", 0);
+          pGUIWindow_CurrentMenu->CreateButton(350u, 262u, 70u, 0x13u, 1, 0, 0x1A3u, 0xDu, 0, "", 0);
           dword_506E68 = -1;
           dword_506F08 = 1;
           memset(word_506E6C, 0, 0x1Cu);
@@ -1687,8 +1690,6 @@
           }
           sub_41426F();
 _continue:
-          if ( !pMessageQueue_50CBD0->uNumMessages )
-            break;
           continue;
         case UIMSG_BC:
           if ( uMessageParam )
@@ -1932,7 +1933,7 @@
             if ( uCurrentlyLoadedLevelType != v0 )
             {
               v50 = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F];
-              if ( !(BYTE3(v50->uFaceAttributes) & 2) || !v50->sCogTriggeredID )
+              if ( !(v50->uAttributes & 0x02000000) || !v50->sCogTriggeredID )
                 goto _continue;
               v44 = uNumSeconds;
               goto LABEL_415;
@@ -2081,7 +2082,7 @@
           v158 = (unsigned int)thise;
           v146 = pGlobalTXT_LocalizationStrings[475];// "Set %s over %s"
 _sprintex_draw_status_and_continue:
-          sprintfex(pTmpBuf, v146, v158, v174);
+          sprintf(pTmpBuf, v146, v158, v174);
           goto _set_status_string_pTmpBuf_and_continue;
         case UIMSG_B5:
           dword_50CDC8 = v0;
@@ -2351,7 +2352,7 @@
             if ( v70 <= 0 || v70 >= 77 )
             {
 LABEL_90:
-              v1 = nullstring;
+              v1 = "";
 LABEL_91:
               v0 = 1;
               goto _continue;
@@ -2673,7 +2674,7 @@
             v173 = pSpellStats->pInfos[dword_50654C + 11 * pPlayers[uActiveCharacter]->field_1A4E].pName;
             v157 = pGlobalTXT_LocalizationStrings[483];
 _sprintex_2args_draw_status_and_continue:
-            sprintfex(pTmpBuf, v157, v173);
+            sprintf(pTmpBuf, v157, v173);
           }
           else
           {
@@ -3154,7 +3155,7 @@
           }
           if ( pParty->uCurrentHour < 0xC || (uNumSeconds = v0, pParty->uCurrentHour >= 0x18) )
             uNumSeconds = 0;
-          sprintfex(
+          sprintf(
             pTmpBuf,
             "%d:%02d%s %s %d %s %d",
             v195,
@@ -3171,7 +3172,7 @@
           goto _sprintex_2args_draw_status_and_continue;
         case UIMSG_ShowStatus_Player:
           v106 = pPlayers[uMessageParam];
-          sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], v106->pName, pClassNames[v106->uClass]);// "%s the %s"
+          sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[429], v106->pName, pClassNames[v106->uClass]);// "%s the %s"
           strcat(pTmpBuf, ": ");
           v107 = v106->GetMajorConditionIdx();
           strcat(pTmpBuf, aCharacterConditionNames[v107]);
@@ -3187,7 +3188,7 @@
           v112 = v110->sMana;
           v113 = pGlobalTXT_LocalizationStrings[108];// "Hit Points"
           v114 = v110->GetMaxHealth();
-          sprintfex(pTmpBuf, "%d / %d %s    %d / %d %s", v110->sHealth, v114, v113, v112, v111, v109);
+          sprintf(pTmpBuf, "%d / %d %s    %d / %d %s", v110->sHealth, v114, v113, v112, v111, v109);
           goto _set_status_string_pTmpBuf_and_continue;
         case 0xC:
           if ( pCurrentScreen == 15 )
@@ -3947,17 +3948,13 @@
 }
 
 //----- (0043648F) --------------------------------------------------------
-void __thiscall Vec3_short__to_RenderVertexSoft(RenderVertexSoft *_this, Vec3_short_ *a2)
-{
-  signed int v2; // edx@1
-  double v3; // st7@1
-
+void Vec3_short__to_RenderVertexSoft(RenderVertexSoft *_this, Vec3_short_ *a2)
+{
   _this->flt_2C = 0.0;
-  v2 = a2->y;
-  v3 = (double)a2->z;
-  _this->vWorldPosition.x = (double)a2->x;
-  _this->vWorldPosition.y = (double)v2;
-  _this->vWorldPosition.z = v3;
+
+  _this->vWorldPosition.x = a2->x;
+  _this->vWorldPosition.y = a2->y;
+  _this->vWorldPosition.z = a2->z;
 }
 
 //----- (004369DB) --------------------------------------------------------
@@ -9057,9 +9054,9 @@
   unsigned int v45; // [sp+18h] [bp-Ch]@44
 
   v6 = uBaseLightLevel;
-  for (uint i = 0; i < uNumMobileLightsApplied; ++i)
-  {
-    auto p = pMobileLights + i;
+  for (uint i = 0; i < pMobileLightsStack->uNumLightsActive; ++i)
+  {
+    auto p = pMobileLightsStack->pLights + i;
 
       auto distX = abs(p->vPosition.x - x);
       if ( distX <= p->uRadius)
@@ -9105,8 +9102,8 @@
 
     for (uint i = 0; i < pSector->uNumLights; ++i)
     {
-        v16 = pIndoor->pLights + *(&pSector->pLights->vPosition.x + i);
-        if ( !(v16->uAtributes & 8) )
+        v16 = pIndoor->pLights + pSector->pLights[i];
+        if (~v16->uAtributes & 8)
         {
           v17 = abs(v16->vPosition.x - x);
           if ( v17 <= v16->uRadius )
@@ -9149,9 +9146,9 @@
     }
   }
 
-  for (uint i = 0; i < uNumStationaryLightsApplied; ++i)
-  {
-    auto p = pStationaryLights + i;
+  for (uint i = 0; i < pStationaryLightsStack->uNumLightsActive; ++i)
+  {
+    auto p = pStationaryLightsStack->pLights + i;
       v26 = abs(p->vPosition.x - x);
       if ( v26 <= p->uRadius)
       {
@@ -10906,7 +10903,7 @@
   signed int a5a; // [sp+2Ch] [bp+10h]@14
 
   v5 = a4;
-  v6 = a4->uFaceAttributes;
+  v6 = a4->uAttributes;
   v7 = 0;
   if ( v6 & 0x100 )
   {
@@ -15818,7 +15815,7 @@
         {
           lpsz = (LPCSTR)*(&pNPCStats->field_13A64 + 5 * v6->uProfession);
           if ( !lpsz )
-            lpsz = nullstring;
+            lpsz = "";
         }
         a1.Hint = 0;
         a1.uFrameX = 38;
@@ -17542,7 +17539,7 @@
                    0xA9u,
                    0,
                    0,
-                   nullstring,
+                   "",
                    (Texture *)(uTextureID_ar_up_up != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_up_up] : 0),
                    uTextureID_ar_up_dn != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_up_dn] : 0,
                    0);
@@ -17556,7 +17553,7 @@
                    0xAAu,
                    0,
                    0,
-                   nullstring,
+                   "",
                    (Texture *)(uTextureID_ar_dn_up != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_dn_up] : 0),
                    uTextureID_ar_dn_dn != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ar_dn_dn] : 0,
                    0);
@@ -17570,7 +17567,7 @@
                    0xC0u,
                    0,
                    0,
-                   nullstring,
+                   "",
                    0);
   }
 }
@@ -17673,7 +17670,7 @@
         0x79u,
         *v14,
         0,
-        nullstring,
+        "",
         0);
       v2 = pFontLucida;
     }
@@ -17701,7 +17698,7 @@
         0x79u,
         *v15,
         0,
-        nullstring,
+        "",
         0);
       v2 = pFontLucida;
     }
@@ -17729,7 +17726,7 @@
         0x79u,
         *v16,
         0,
-        nullstring,
+        "",
         0);
       v2 = pFontLucida;
     }
@@ -17757,7 +17754,7 @@
         0x79u,
         *v17,
         0,
-        nullstring,
+        "",
         0);
       v2 = pFontLucida;
     }