changeset 1505:6306a33af531

UIGame.cpp cleaning(continue) wizard_eye
author Ritor1
date Mon, 02 Sep 2013 12:03:25 +0600
parents 58d43397b827
children c76c0f6974bc
files UI/UiGame.cpp mm7_2.cpp
diffstat 2 files changed, 49 insertions(+), 96 deletions(-) [+]
line wrap: on
line diff
--- a/UI/UiGame.cpp	Thu Aug 29 18:10:53 2013 +0600
+++ b/UI/UiGame.cpp	Mon Sep 02 12:03:25 2013 +0600
@@ -2356,10 +2356,6 @@
   signed int v27; // eax@37
   unsigned __int16 *v28; // ecx@37
   signed int v29; // edi@40
-  //signed int v33; // ebx@50
-  //unsigned int v34; // eax@50
-  //signed int v35; // ecx@50
-  //unsigned __int16 v36; // di@66
   int v37; // edi@72
   int v38; // ebx@72
   __int16 v39; // ax@87
@@ -2373,44 +2369,29 @@
   int v47; // eax@108
   unsigned int v48; // ebx@114
   unsigned int v49; // ST64_4@114
-  //unsigned int v51; // [sp-10h] [bp-64h]@79
   unsigned int v52; // [sp-10h] [bp-64h]@100
-  //unsigned int v53; // [sp-Ch] [bp-60h]@79
   unsigned int v54; // [sp-Ch] [bp-60h]@100
-  //unsigned int v55; // [sp-8h] [bp-5Ch]@77
   unsigned int v56; // [sp-8h] [bp-5Ch]@100
-  //signed int v57; // [sp-4h] [bp-58h]@54
-  //unsigned __int16 v58; // [sp-4h] [bp-58h]@77
   unsigned __int16 v59; // [sp-4h] [bp-58h]@100
-  //unsigned __int16 v60; // [sp+10h] [bp-44h]@66
-  //unsigned int v61; // [sp+10h] [bp-44h]@85
-  //unsigned int v63; // [sp+14h] [bp-40h]@85
-  //unsigned int v65; // [sp+18h] [bp-3Ch]@85
   unsigned int lPitch; // [sp+20h] [bp-34h]@1
   unsigned int lPitcha; // [sp+20h] [bp-34h]@23
   char *lPitchb; // [sp+20h] [bp-34h]@106
   unsigned int v69; // [sp+24h] [bp-30h]@23
   signed int v70; // [sp+24h] [bp-30h]@37
-  //unsigned __int16 uBlue; // [sp+28h] [bp-2Ch]@1
   signed int uBluea; // [sp+28h] [bp-2Ch]@37
   int v73; // [sp+2Ch] [bp-28h]@30
   int v76; // [sp+34h] [bp-20h]@91
   int v77; // [sp+34h] [bp-20h]@108
-  //int v79; // [sp+38h] [bp-1Ch]@72
-  //char *a2c; // [sp+40h] [bp-14h]@68
   signed int uCenterY; // [sp+48h] [bp-Ch]@1
   signed int uCenterX; // [sp+4Ch] [bp-8h]@1
   signed int uWidth; // [sp+5Ch] [bp+8h]@30
-  //signed int uZe; // [sp+5Ch] [bp+8h]@67
   signed int uZf; // [sp+5Ch] [bp+8h]@85
   signed int uZg; // [sp+5Ch] [bp+8h]@105
   unsigned int uWa; // [sp+60h] [bp+Ch]@23
   float uWb; // [sp+60h] [bp+Ch]@30
   unsigned int uWd; // [sp+60h] [bp+Ch]@95
   float uZooma; // [sp+64h] [bp+10h]@117
-  //unsigned int flagsb; // [sp+68h] [bp+14h]@66
   Actor *flagsc; // [sp+68h] [bp+14h]@86
-  //unsigned int flagsd; // [sp+68h] [bp+14h]@105
 
   uCenterX = (uX + uZ) / 2;
   uCenterY = (uY + uW) / 2;
@@ -2419,13 +2400,17 @@
   //uBlue = TargetColor(0, 0, 0xFFu);
   auto bWizardEyeActive = pParty->WizardEyeActive();
   auto uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel();
-  if (CheckHiredNPCSpeciality(Cartographer))
+  if ( CheckHiredNPCSpeciality(Cartographer) )
   {
     bWizardEyeActive = true;
     uWizardEyeSkillLevel = 2;
   }
+  extern bool wizard_eye;
+  if ( wizard_eye )
+  {
     bWizardEyeActive = true;
     uWizardEyeSkillLevel = 3;
+  }
   pRenderer->SetRasterClipRect(uX, uY, uZ - 1, uW - 1);
   uHeight = uW - uY;
   uWidth = uZ - uX;
@@ -2768,65 +2753,47 @@
 
 //----- (00441498) --------------------------------------------------------
 void  GameUI_DrawTorchlightAndWizardEye()
+{
+  if (pCurrentScreen == SCREEN_GAME
+      || pCurrentScreen == SCREEN_MENU
+      || pCurrentScreen == SCREEN_OPTIONS
+      || pCurrentScreen == SCREEN_REST
+      || pCurrentScreen == SCREEN_SPELL_BOOK
+      || pCurrentScreen == SCREEN_CHEST
+      || pCurrentScreen == SCREEN_SAVEGAME
+      || pCurrentScreen == SCREEN_LOADGAME
+      || pCurrentScreen == SCREEN_CHEST_INVENTORY
+      || pCurrentScreen == SCREEN_BOOKS
+      || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG )
+  {
+    if (pParty->TorchlightActive())
     {
-    if (pCurrentScreen == SCREEN_GAME
-        || pCurrentScreen == SCREEN_MENU
-        || pCurrentScreen == SCREEN_OPTIONS
-        || pCurrentScreen == SCREEN_REST
-        || pCurrentScreen == SCREEN_SPELL_BOOK
-        || pCurrentScreen == SCREEN_CHEST
-        || pCurrentScreen == SCREEN_SAVEGAME
-        || pCurrentScreen == SCREEN_LOADGAME
-        || pCurrentScreen == SCREEN_CHEST_INVENTORY
-        || pCurrentScreen == SCREEN_BOOKS
-        || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG )
-        {
-        if (pParty->TorchlightActive())
-            {
-            auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, pEventTimer->Time());
-            pRenderer->DrawTextureTransparent(pUIAnum_Torchlight->x, pUIAnum_Torchlight->y, pIcons_LOD->GetTexture(icon->uTextureID));
-            }
-        if (pParty->WizardEyeActive())
-            {
-            auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, pEventTimer->Time());
-            pRenderer->DrawTextureTransparent(pUIAnim_WizardEye->x, pUIAnim_WizardEye->y, pIcons_LOD->GetTexture(icon->uTextureID));
-            }
-        }
+      auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, pEventTimer->Time());
+      pRenderer->DrawTextureTransparent(pUIAnum_Torchlight->x, pUIAnum_Torchlight->y, pIcons_LOD->GetTexture(icon->uTextureID));
     }
+    if (pParty->WizardEyeActive())
+    {
+      auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, pEventTimer->Time());
+      pRenderer->DrawTextureTransparent(pUIAnim_WizardEye->x, pUIAnim_WizardEye->y, pIcons_LOD->GetTexture(icon->uTextureID));
+    }
+  }
+}
 // 4E28F8: using guessed type int pCurrentScreen;
 
 
 //----- (00491F87) --------------------------------------------------------
 void GameUI_DrawHiredNPCs()
 {
-  //int v6; // eax@15
-  char v7; // al@17
-  unsigned int v8; // eax@18
-  int v9; // esi@18
-  int v10; // eax@18
-  unsigned int v11; // eax@19
-  unsigned int v12; // esi@19
   unsigned int v13; // eax@23
-  IconFrame *v14; // eax@24
-  unsigned int v15; // eax@26
   char pContainer[20]; // [sp+Ch] [bp-30h]@18
-  unsigned int v17; // [sp+20h] [bp-1Ch]@19
   signed int uFrameID; // [sp+24h] [bp-18h]@19
-  //int i; // [sp+28h] [bp-14h]@15
-  unsigned int v20; // [sp+2Ch] [bp-10h]@20
-  unsigned int v21; // [sp+30h] [bp-Ch]@19
   int v22; // [sp+34h] [bp-8h]@2
-  unsigned __int8 v23; // [sp+3Bh] [bp-1h]@2
+  unsigned __int8 pNPC_limit_ID; // [sp+3Bh] [bp-1h]@2
 
   if ( bNoNPCHiring != 1 )
   {
-    v23 = 0;
+    pNPC_limit_ID = 0;
     v22 = 0;
-    /*for (uint i = 0; i < 2; ++i)
-    { 
-      if (pParty->pHirelings[i].pName)
-        pTmpBuf[v22++] = i;
-    }*/
     if (pParty->pHirelings[0].pName)
       pTmpBuf[v22++] = 0;
     if (pParty->pHirelings[1].pName)
@@ -2845,51 +2812,36 @@
     }
 
     //v6 = (unsigned __int8)pParty->field_709;
-	for ( int i = (unsigned __int8)pParty->field_709; i < v22 && v23 < 2; i++ )
+    for ( int i = (unsigned __int8)pParty->field_709; i < v22 && pNPC_limit_ID < 2; i++ )
     {
-      v7 = pTmpBuf[i];
-      if ( (unsigned __int8)v7 >= 2 )
+      if ( (unsigned __int8)pTmpBuf[i] >= 2 )
       {
-        sprintf(pContainer, "NPC%03d", pNPCStats->pNPCData[(unsigned __int8)v7 + 499].uPortraitID);
-        v15 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
-        pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[v23], pHiredNPCsIconsOffsetsY[v23], pIcons_LOD->GetTexture(v15));
+        sprintf(pContainer, "NPC%03d", pNPCStats->pNPCData[(unsigned __int8)pTmpBuf[i] + 499].uPortraitID);
+        pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID],
+                      pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)));
       }
       else
       {
-        sprintf(pContainer, "NPC%03d", pParty->pHirelings[(unsigned __int8)v7].uPortraitID);
-        v8 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
-        v9 = v23;
-        pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[v9], pHiredNPCsIconsOffsetsY[v9], pIcons_LOD->GetTexture(v8));
-        v10 = (unsigned __int8)pTmpBuf[i];
-        if ( pParty->pHirelings[v10].evt_A == 1 )
+        sprintf(pContainer, "NPC%03d", pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].uPortraitID);
+        pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID],
+                   pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)));
+        if ( pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].evt_A == 1 )
         {
-          uFrameID = pParty->pHirelings[v10].evt_B;
-          v11 = pHiredNPCsIconsOffsetsX[v9];
-          v12 = pHiredNPCsIconsOffsetsY[v9];
-          v17 = v11;
-          v21 = 0;
-          if ( (signed int)pIconsFrameTable->uNumIcons <= 0 )
+          uFrameID = pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].evt_B;
+          v13 = 0;
+          if ( (signed int)pIconsFrameTable->uNumIcons )
           {
-LABEL_23:
-            v13 = 0;
-          }
-          else
-          {
-            v20 = 0;
-            while ( _stricmp("spell96", pIconsFrameTable->pIcons[v20 / 0x20].pAnimationName) )
+            for ( v13 = 0; v13 < pIconsFrameTable->uNumIcons; ++v13 )
             {
-              ++v21;
-              v20 += 32;
-              if ( (signed int)v21 >= (signed int)pIconsFrameTable->uNumIcons )
-                goto LABEL_23;
+              if ( !_stricmp("spell96", pIconsFrameTable->pIcons[v13].pAnimationName) )
+                break;
             }
-            v13 = v21;
           }
-          v14 = pIconsFrameTable->GetFrame(v13, uFrameID);
-          pRenderer->DrawTextureTransparent(v17, v12, &pIcons_LOD->pTextures[v14->uTextureID]);
+          pRenderer->DrawTextureTransparent(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID],
+                        &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(v13, uFrameID)->uTextureID]);
         }
       }
-      ++v23;
+      ++pNPC_limit_ID;
     }
   }
 }
--- a/mm7_2.cpp	Thu Aug 29 18:10:53 2013 +0600
+++ b/mm7_2.cpp	Mon Sep 02 12:03:25 2013 +0600
@@ -5288,6 +5288,7 @@
 bool new_sky = false;
 bool change_seasons = false;
 bool all_magic = true;
+bool wizard_eye = true;
 
 //----- (00462C94) --------------------------------------------------------
 bool MM_Main(const wchar_t *pCmdLine)