changeset 243:a6a8fa73b4ec

cleaning
author zipi
date Sun, 17 Feb 2013 23:40:46 +0000
parents 578b4a1e58ba
children bb9e946cbcbf
files Actor.cpp Items.cpp Player.cpp mm7_1.cpp mm7_5.cpp mm7_6.cpp
diffstat 6 files changed, 23 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/Actor.cpp	Sun Feb 17 23:04:07 2013 +0000
+++ b/Actor.cpp	Sun Feb 17 23:40:46 2013 +0000
@@ -2482,7 +2482,7 @@
 
   v1 = uActiveCharacter;
   v7 = uActorID;
-  pPlayer = &pParty->pPlayers[uActiveCharacter-1];//(Player *)&stru_AA1058[3].pSounds[6972 * uActiveCharacter + 40552];
+  pPlayer = &pParty->pPlayers[uActiveCharacter-1];
   result = pPlayer->CanAct();
   if ( result )
   {
--- a/Items.cpp	Sun Feb 17 23:04:07 2013 +0000
+++ b/Items.cpp	Sun Feb 17 23:40:46 2013 +0000
@@ -1381,7 +1381,7 @@
   v1 = this;
   uBaseValue = pItemsTable->pItems[this->uItemID].uValue;
   if ( this->uAttributes & ITEM_TEMP_BONUS || pItemsTable->_456D5E_is_some_material(this) )
-    goto LABEL_12;
+    return uBaseValue;
   if ( v1->_bonus_type )
   {
     v3 = 100 * v1->_bonus_strength;
@@ -1390,12 +1390,11 @@
   v4 = v1->uAdditionalValue;
   if ( !v4 )
   {
-LABEL_12:
     result = uBaseValue;
   }
   else
   {
-    v3 = *(unsigned int *)&pItemsTable->pEnchantments[23].to_item[28 * v4 + 8];
+	v3 = pItemsTable->pSpecialEnchantments[v4].iTreasureLevel;
     if ( (unsigned int)v3 > 0xA )
       return uBaseValue + v3;
     result = uBaseValue * v3;
@@ -1437,7 +1436,6 @@
     v11 = pItemsTable->pItems[v2].pName;
     v4 = item__getname_buffer;
     v10 = "%s";
-LABEL_10:
     sprintf(v4, v10, v11);
     return v4;
   }
@@ -1457,7 +1455,8 @@
           v10 = pGlobalTXT_LocalizationStrings[655];
         else
           v10 = pGlobalTXT_LocalizationStrings[654];
-        goto LABEL_10;
+		sprintf(v4, v10, v11);
+		return v4;
       }
     }
   }
@@ -1491,12 +1490,12 @@
         sprintf(
           item__getname_buffer,
           "%s %s",
-          *(unsigned int *)&pItemsTable->pEnchantments[22].to_item[28 * v7 + 8],
+		  pItemsTable->pSpecialEnchantments[v7].pBonusStatement,
           pItemsTable->pItems[v1->uItemID].pName);
         return v4;
       }
       strcat(item__getname_buffer, " ");
-      v9 = *(const char **)&pItemsTable->pEnchantments[22].to_item[28 * v1->uAdditionalValue + 8];
+	  v9 = pItemsTable->pSpecialEnchantments[v1->uAdditionalValue].pBonusStatement;
     }
     strcat(item__getname_buffer, v9);
   }
--- a/Player.cpp	Sun Feb 17 23:04:07 2013 +0000
+++ b/Player.cpp	Sun Feb 17 23:40:46 2013 +0000
@@ -6977,7 +6977,7 @@
   unsigned int thisa; // [sp+28h] [bp-4h]@22
 
   thisb = this;
-  v3 = &pParty->pPlayers[a2-1];//(Player *)&stru_AA1058[3].pSounds[6972 * a2 + 40552];
+  v3 = &pParty->pPlayers[a2-1];
   v73 = 1;
   if ( pParty->bTurnBasedModeOn == 1 && (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3) )
     return;
@@ -7005,7 +7005,7 @@
         }
         v69 = 2;
 LABEL_111:
-        pParty->pPlayers[a2-1].Heal(v69);//((Player *)&stru_AA1058[3].pSounds[6972 * a2 + 40552])->Heal(v69);
+        pParty->pPlayers[a2-1].Heal(v69);
       }
 LABEL_112:
       v3->PlaySound(SPEECH_36, 0);
@@ -7178,7 +7178,7 @@
         v33 = HIDWORD(v3->pConditions[15]);
         v34 = LODWORD(v3->pConditions[16]);
         v35 = HIDWORD(v3->pConditions[16]);
-        memset(&pParty->pPlayers[a2-1],0,0xA0u);//memset(&stru_AA1058[3].pSounds[6972 * a2 + 40552], 0, 0xA0u);
+        memset(&pParty->pPlayers[a2-1],0,0xA0u);
         HIDWORD(v3->pConditions[14]) = v31;
         LODWORD(v3->pConditions[15]) = v32;
         HIDWORD(v3->pConditions[15]) = v33;
@@ -7549,7 +7549,7 @@
         pMouse->RemoveHoldingItem();
         return;
       }
-      if ( pParty->pPlayers[a2-1].CanAct() )//if ( ((Player *)&stru_AA1058[3].pSounds[6972 * a2 + 40552])->CanAct() )
+      if ( pParty->pPlayers[a2-1].CanAct() )
       {
         sub_467F48(pParty->pPickedItem.uItemID);
         v65 = 0;
@@ -7593,7 +7593,7 @@
       pAudioPlayer->PlaySound(v37, v39, v41, v43, v45, v48, v52, v61);
       return;
     }
-    if ( !pParty->pPlayers[a2-1].CanAct() )//if ( !((Player *)&stru_AA1058[3].pSounds[6972 * a2 + 40552])->CanAct() )
+    if ( !pParty->pPlayers[a2-1].CanAct() )
     {
       v66 = aCharacterConditionNames[v3->GetMajorConditionIdx()];
       v57 = pGlobalTXT_LocalizationStrings[382];
@@ -7705,7 +7705,7 @@
   }
   if ( pCurrentScreen == SCREEN_CASTING )
     return;
-  if ( !pParty->pPlayers[a2-1].CanAct() )//if ( !((Player *)&stru_AA1058[3].pSounds[6972 * a2 + 40552])->CanAct() )
+  if ( !pParty->pPlayers[a2-1].CanAct() )
     goto LABEL_89;
   if ( bUnderwater == 1 )
   {
--- a/mm7_1.cpp	Sun Feb 17 23:04:07 2013 +0000
+++ b/mm7_1.cpp	Sun Feb 17 23:40:46 2013 +0000
@@ -207,7 +207,7 @@
   v85 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem;
   v86 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0);
   v79 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0);
-  pPlayer = &pParty->pPlayers[v1-1];//(Player *)&stru_AA1058[3].pSounds[6972 * v1 + 40552];
+  pPlayer = &pParty->pPlayers[v1-1];
   v3 = pIcons_LOD->LoadTexture("fr_skill", TEXTURE_16BIT_PALETTE);
   pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(v3 != -1 ? (int)&pIcons_LOD->pTextures[v3] : 0));
   v4 = v79;
@@ -641,8 +641,8 @@
   sprintf(pTmpBuf, "%s \f%05d", pGlobalTXT_LocalizationStrings[23], v2);// TODO check args
   sprintf(Source,
     pGlobalTXT_LocalizationStrings[429],
-	&pParty->pPlayers[v1-1].pName,//&stru_AA1058[3].pSounds[6972 * v1 + 40720],
-	pClassNames[pParty->pPlayers[v1-1].classType]);//&pClassNames[stru_AA1058[3].pSounds[6972 * v1 + 40737]]);
+	&pParty->pPlayers[v1-1].pName,
+	pClassNames[pParty->pPlayers[v1-1].classType]);
   strcat(pTmpBuf, Source);
   strcat(pTmpBuf, "\xC" "00000");
   pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf, 0, 0, 0);
@@ -2803,7 +2803,7 @@
   int v8; // eax@4
   unsigned __int16 v9; // dx@4
   SpriteFrame *v10; // edi@17
-  int v11; // esi@17
+  LODSprite *v11; // esi@17
   unsigned int v12; // ecx@17
   Sprite *v13; // edi@18
   int v14; // ecx@18
@@ -2956,7 +2956,7 @@
   v10 = pSpriteFrameTable->GetFrame(
           v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation],
           pMonsterInfoUI_Doll.uCurrentActionTime);
-  v11 = (int)pSprites_LOD[v10->pHwSpriteIDs[0]].pSpriteHeaders;//40 * v10->pHwSpriteIDs[0] + 7218180;
+  v11 = pSprites_LOD[v10->pHwSpriteIDs[0]].pSpriteHeaders;//40 * v10->pHwSpriteIDs[0] + 7218180;
   v106.pTarget = pRenderer->pTargetSurface;
   v106.pTargetZ = pRenderer->pActiveZBuffer;
   v106.uTargetPitch = pRenderer->uTargetSurfacePitch;
@@ -2968,7 +2968,7 @@
   v106.uScreenSpaceX = (signed int)(v106.uViewportX + 128 + v106.uViewportX) / 2;
   v106._screenspace_x_scaler_packedfloat = 65536;
   v106._screenspace_y_scaler_packedfloat = 65536;
-  v106.uScreenSpaceY = v115 + v12 + *(short *)(v11 + 18);
+  v106.uScreenSpaceY = v115 + v12 + v11->uHeight;
   v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1);
   v106.sZValue = 0;
   v106.uFlags = 0;
--- a/mm7_5.cpp	Sun Feb 17 23:04:07 2013 +0000
+++ b/mm7_5.cpp	Sun Feb 17 23:40:46 2013 +0000
@@ -17400,7 +17400,7 @@
   int v137; // [sp+1Ch] [bp-4h]@27
   int v138; // [sp+1Ch] [bp-4h]@33
 
-  pPlayer = &pParty->pPlayers[uPlayerID-1];//(Player *)&stru_AA1058[3].pSounds[6972 * uPlayerID + 40552];
+  pPlayer = &pParty->pPlayers[uPlayerID-1];
   v2 = pIcons_LOD->LoadTexture("fr_stats", TEXTURE_16BIT_PALETTE);
   pRenderer->DrawTextureIndexed(8, 8, (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0));
   v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
@@ -17857,7 +17857,7 @@
   }
   v12 = 0;
   a5 = pGUIWindow_CurrentMenu->uNumControls;
-  v18 = &pParty->pPlayers[v0-1];	  //&stru_AA1058[3].pSounds[6972 * v0 + 40552];
+  v18 = &pParty->pPlayers[v0-1];
   v2 = pFontLucida;
   v14 = pWeaponSkills;
   v3 = 2 * LOBYTE(pFontLucida->uFontHeight) + 13;
--- a/mm7_6.cpp	Sun Feb 17 23:04:07 2013 +0000
+++ b/mm7_6.cpp	Sun Feb 17 23:40:46 2013 +0000
@@ -7873,8 +7873,8 @@
 
   v0 = uActiveCharacter;
   v27 = 6972 * uActiveCharacter;
-  v1 = &pParty->pPlayers[uActiveCharacter-1];//(Player *)&stru_AA1058[3].pSounds[6972 * uActiveCharacter + 40552];
-  result = pParty->pPlayers[uActiveCharacter-1].CanAct();//((Player *)&stru_AA1058[3].pSounds[6972 * uActiveCharacter + 40552])->CanAct();
+  v1 = &pParty->pPlayers[uActiveCharacter-1];
+  result = pParty->pPlayers[uActiveCharacter-1].CanAct();
   if ( result )
   {
     pStru277->_427D48(v0);