Mercurial > might-and-magic-trilogy
changeset 206:c38d2f00e3ad
9.01.13
author | Ritor1 |
---|---|
date | Wed, 09 Jan 2013 17:32:10 +0600 |
parents | 6d982dfab925 |
children | 8e3fea954768 |
files | AudioPlayer.cpp Game.cpp Outdoor.cpp mm7_2.cpp mm7_4.cpp mm7_5.cpp |
diffstat | 6 files changed, 432 insertions(+), 711 deletions(-) [+] |
line wrap: on
line diff
--- a/AudioPlayer.cpp Tue Jan 08 17:29:13 2013 +0600 +++ b/AudioPlayer.cpp Wed Jan 09 17:32:10 2013 +0600 @@ -720,7 +720,7 @@ _SAMPLE *v85; // ST18_4@186 unsigned int v86; // [sp+14h] [bp-60h]@84 int v87; // [sp+14h] [bp-60h]@115 - RenderVertexSoft RenderVertexSoft; // [sp+24h] [bp-50h]@1 + RenderVertexSoft pRenderVertexSoft; // [sp+24h] [bp-50h]@1 unsigned int v89; // [sp+54h] [bp-20h]@12 int v90; // [sp+58h] [bp-1Ch]@68 float v91; // [sp+5Ch] [bp-18h]@68 @@ -740,7 +740,7 @@ pAudioPlayer = this; v35 = this->bPlayerReady == 0; //pAudioPlayer = this; - RenderVertexSoft.flt_2C = 0.0; + pRenderVertexSoft.flt_2C = 0.0; LODWORD(v93) = 10000; if ( v35 || !uSoundVolumeMultiplier || !this->hDigDriver || !eSoundID ) return; @@ -1032,8 +1032,8 @@ v12 = v15 - 1; v96 = v12; //goto LABEL_46; - RenderVertexSoft.vWorldPosition.x = (double)pParty->vPosition.x; - RenderVertexSoft.vWorldPosition.y = (double)pParty->vPosition.y; + pRenderVertexSoft.vWorldPosition.x = (double)pParty->vPosition.x; + pRenderVertexSoft.vWorldPosition.y = (double)pParty->vPosition.y; v21 = (double)pParty->sEyelevel + (double)pParty->vPosition.z; goto LABEL_47; } @@ -1042,8 +1042,8 @@ v12 = v15; //goto LABEL_45; v96 = v15; - RenderVertexSoft.vWorldPosition.x = (double)pParty->vPosition.x; - RenderVertexSoft.vWorldPosition.y = (double)pParty->vPosition.y; + pRenderVertexSoft.vWorldPosition.x = (double)pParty->vPosition.x; + pRenderVertexSoft.vWorldPosition.y = (double)pParty->vPosition.y; v21 = (double)pParty->sEyelevel + (double)pParty->vPosition.z; goto LABEL_47; } @@ -1074,9 +1074,9 @@ v96 = 3; pActor1 = &pActors[a3 >> 3]; v20 = pActor1->vPosition.y; - RenderVertexSoft.vWorldPosition.x = (double)pActor1->vPosition.x; + pRenderVertexSoft.vWorldPosition.x = (double)pActor1->vPosition.x; v100 = pActor1->vPosition.z; - RenderVertexSoft.vWorldPosition.y = (double)v20; + pRenderVertexSoft.vWorldPosition.y = (double)v20; v21 = (double)v100; goto LABEL_47; } @@ -1090,8 +1090,8 @@ v96 = 9; v12 = 8; //goto LABEL_46; - RenderVertexSoft.vWorldPosition.x = (double)pParty->vPosition.x; - RenderVertexSoft.vWorldPosition.y = (double)pParty->vPosition.y; + pRenderVertexSoft.vWorldPosition.x = (double)pParty->vPosition.x; + pRenderVertexSoft.vWorldPosition.y = (double)pParty->vPosition.y; v21 = (double)pParty->sEyelevel + (double)pParty->vPosition.z; goto LABEL_47; } @@ -1105,8 +1105,8 @@ v96 = 12; v12 = 10; //LABEL_46: - RenderVertexSoft.vWorldPosition.x = (double)pParty->vPosition.x; - RenderVertexSoft.vWorldPosition.y = (double)pParty->vPosition.y; + pRenderVertexSoft.vWorldPosition.x = (double)pParty->vPosition.x; + pRenderVertexSoft.vWorldPosition.y = (double)pParty->vPosition.y; v21 = (double)pParty->sEyelevel + (double)pParty->vPosition.z; goto LABEL_47; } @@ -1117,8 +1117,8 @@ //LABEL_45: v96 = v15; //goto LABEL_46; - RenderVertexSoft.vWorldPosition.x = (double)pParty->vPosition.x; - RenderVertexSoft.vWorldPosition.y = (double)pParty->vPosition.y; + pRenderVertexSoft.vWorldPosition.x = (double)pParty->vPosition.x; + pRenderVertexSoft.vWorldPosition.y = (double)pParty->vPosition.y; v21 = (double)pParty->sEyelevel + (double)pParty->vPosition.z; goto LABEL_47; } @@ -1135,15 +1135,15 @@ } pLayingItem = (LayingItem *)&pLevelDecorations[a3 >> 3]; } - RenderVertexSoft.vWorldPosition.x = (double)pLayingItem->vPosition.x; - RenderVertexSoft.vWorldPosition.y = (double)pLayingItem->vPosition.y; + pRenderVertexSoft.vWorldPosition.x = (double)pLayingItem->vPosition.x; + pRenderVertexSoft.vWorldPosition.y = (double)pLayingItem->vPosition.y; v21 = (double)pLayingItem->vPosition.z; LABEL_47: - RenderVertexSoft.vWorldPosition.z = v21; + pRenderVertexSoft.vWorldPosition.z = v21; if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) - sub_4AAEA6_transform(&RenderVertexSoft); + sub_4AAEA6_transform(&pRenderVertexSoft); else - pGame->pIndoorCameraD3D->ViewTransform(&RenderVertexSoft, 1); + pGame->pIndoorCameraD3D->ViewTransform(&pRenderVertexSoft, 1); if ( a3 ) { if ( a3 != -1 ) @@ -1190,9 +1190,9 @@ { LODWORD(v91) = -1; v103 = 0; - *(float *)&varC = RenderVertexSoft.vWorldViewPosition.y * -0.012207031; + *(float *)&varC = pRenderVertexSoft.vWorldViewPosition.y * -0.012207031; v93 = 0.0; - v26 = RenderVertexSoft.vWorldViewPosition.x * 0.012207031; + v26 = pRenderVertexSoft.vWorldViewPosition.x * 0.012207031; *(float *)&uVolume = v26; v27 = abs((signed __int64)v26); v28 = abs((signed __int64)v93); @@ -1263,26 +1263,26 @@ pBLVDoor = &pIndoor->pDoors[a3 >> 3]; if ( !pBLVDoor->uDoorID ) return; - RenderVertexSoft.vWorldPosition.x = (double)*pBLVDoor->pXOffsets; - RenderVertexSoft.vWorldPosition.y = (double)*pBLVDoor->pYOffsets; + pRenderVertexSoft.vWorldPosition.x = (double)*pBLVDoor->pXOffsets; + pRenderVertexSoft.vWorldPosition.y = (double)*pBLVDoor->pYOffsets; v47 = (double)*pBLVDoor->pZOffsets; LABEL_101: - RenderVertexSoft.vWorldPosition.z = v47; + pRenderVertexSoft.vWorldPosition.z = v47; //if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) //{ - sub_4AAEA6_transform(&RenderVertexSoft); + sub_4AAEA6_transform(&pRenderVertexSoft); //goto LABEL_104; //} } //LABEL_103: if ( uCurrentlyLoadedLevelType != LEVEL_Indoor ) - pGame->pIndoorCameraD3D->ViewTransform(&RenderVertexSoft, 1); + pGame->pIndoorCameraD3D->ViewTransform(&pRenderVertexSoft, 1); //LABEL_104: AIL_start_3D_sample(*(int *)v42); AIL_set_3D_sample_float_distances(*(int **)v42, 100.0, 20.0, 100.0, 20.0); AIL_set_3D_sample_volume(*(int **)v42, pAudioPlayer->s3DSoundVolume); - v99 = RenderVertexSoft.vWorldViewPosition.y * -0.012207031; - v49 = RenderVertexSoft.vWorldViewPosition.x * 0.012207031; + v99 = pRenderVertexSoft.vWorldViewPosition.y * -0.012207031; + v49 = pRenderVertexSoft.vWorldViewPosition.x * 0.012207031; uNumRepeatsa = v49; v50 = abs((signed __int64)v49); v51 = abs(0); @@ -1315,29 +1315,29 @@ { pActor = &pActors[a3 >> 3]; v46 = pActor->vPosition.y; - RenderVertexSoft.vWorldPosition.x = (double)pActor->vPosition.x; + pRenderVertexSoft.vWorldPosition.x = (double)pActor->vPosition.x; uNumRepeatsb = pActor->vPosition.z; - RenderVertexSoft.vWorldPosition.y = (double)v46; + pRenderVertexSoft.vWorldPosition.y = (double)v46; v47 = (double)uNumRepeatsb; goto LABEL_101; } if ( (a3 & 7) != 5 ) { - RenderVertexSoft.vWorldPosition.x = (double)pParty->vPosition.x; + pRenderVertexSoft.vWorldPosition.x = (double)pParty->vPosition.x; v43 = (double)pParty->vPosition.y; LABEL_100: - RenderVertexSoft.vWorldPosition.y = v43; + pRenderVertexSoft.vWorldPosition.y = v43; v47 = (double)pParty->sEyelevel + (double)pParty->vPosition.z; goto LABEL_101; } pLayingItem2 = (LayingItem *)&pLevelDecorations[a3 >> 3]; } - RenderVertexSoft.vWorldPosition.x = (double)pLayingItem2->vPosition.x; - RenderVertexSoft.vWorldPosition.y = (double)pLayingItem2->vPosition.y; + pRenderVertexSoft.vWorldPosition.x = (double)pLayingItem2->vPosition.x; + pRenderVertexSoft.vWorldPosition.y = (double)pLayingItem2->vPosition.y; v47 = (double)pLayingItem2->vPosition.z; goto LABEL_101; } - RenderVertexSoft.vWorldPosition.x = (double)PartyX; + pRenderVertexSoft.vWorldPosition.x = (double)PartyX; v43 = (double)PartyY; goto LABEL_100; }
--- a/Game.cpp Tue Jan 08 17:29:13 2013 +0600 +++ b/Game.cpp Wed Jan 09 17:32:10 2013 +0600 @@ -76,7 +76,8 @@ } else { - if ( pParty->vPosition.x != pParty->vPrevPosition.x | pParty->sRotationY != pParty->sPrevRotationY | pParty->vPosition.y != pParty->vPrevPosition.z | pParty->sRotationX != pParty->sPrevRotationX | pParty->vPosition.z != pParty->vPrevPosition.y | pParty->sEyelevel != pParty->sPrevEyelevel ) + if ( pParty->vPosition.x != pParty->vPrevPosition.x | pParty->sRotationY != pParty->sPrevRotationY | pParty->vPosition.y != pParty->vPrevPosition.z + | pParty->sRotationX != pParty->sPrevRotationX | pParty->vPosition.z != pParty->vPrevPosition.y | pParty->sEyelevel != pParty->sPrevEyelevel ) pParty->uFlags |= 2u; pParty->vPrevPosition.x = pParty->vPosition.x; pParty->vPrevPosition.y = pParty->vPosition.z; @@ -137,12 +138,8 @@ if (v4) { if ( !sub_4226C2() && pRenderer->pRenderD3D) - pRenderer->FillRectFast( - pViewport->uViewportX, - pViewport->uViewportY, - pViewport->uViewportZ - pViewport->uViewportX, - pViewport->uViewportW - pViewport->uViewportY + 1, - pRenderer->uTargetGMask | pRenderer->uTargetBMask); + pRenderer->FillRectFast(pViewport->uViewportX, pViewport->uViewportY, pViewport->uViewportZ - pViewport->uViewportX, + pViewport->uViewportW - pViewport->uViewportY + 1, pRenderer->uTargetGMask | pRenderer->uTargetBMask); viewparams->field_48 = 0; } } @@ -150,7 +147,7 @@ pOtherOverlayList->field_3EC = 0; viewparams->bRedrawGameUI = v5; GameUI_DrawPartySpells(); - if (v4 || pParty->pHirelings[0].evtc || pParty->pHirelings[1].evtc ) + //if (v4 || pParty->pHirelings[0].evtc || pParty->pHirelings[1].evtc ) //DrawHiredNPCs();//Ritor1: it's temporarily GameUI_DrawPortraits(v4); GameUI_DrawLifeManaBars();
--- a/Outdoor.cpp Tue Jan 08 17:29:13 2013 +0600 +++ b/Outdoor.cpp Wed Jan 09 17:32:10 2013 +0600 @@ -91,11 +91,15 @@ pRenderer->OnOutdoorRedrawSW(); goto LABEL_16; } - goto LABEL_14; + //goto LABEL_14; + pRenderer->DrawSkyD3D(); + pRenderer->DrawBuildingsD3D(); + pRenderer->DrawBezierTerrain(); + goto LABEL_16; } if ( pRenderer->pRenderD3D ) { -LABEL_14: +//LABEL_14: pRenderer->DrawSkyD3D(); pRenderer->DrawBuildingsD3D(); pRenderer->DrawBezierTerrain();
--- a/mm7_2.cpp Tue Jan 08 17:29:13 2013 +0600 +++ b/mm7_2.cpp Wed Jan 09 17:32:10 2013 +0600 @@ -12880,7 +12880,7 @@ pEventTimer->Pause(); pMiscTimer->Pause(); pParty->uFlags = 2; - pStru277->_427D48(1u); + pStru277->_427D48(1); ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); DoPrepareWorld(0, (v1 == 0) + 1); pMiscTimer->Resume();
--- a/mm7_4.cpp Tue Jan 08 17:29:13 2013 +0600 +++ b/mm7_4.cpp Wed Jan 09 17:32:10 2013 +0600 @@ -3108,9 +3108,7 @@ { 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], + pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[v23], pHiredNPCsIconsOffsetsY[v23], (Texture *)(v15 != -1 ? &pIcons_LOD->pTextures[v15] : 0)); } else @@ -5848,14 +5846,14 @@ //----- (00497526) -------------------------------------------------------- bool __cdecl PlayerCreationUI_Loop() { - RGBTexture *v0; // ebx@1 + RGBTexture *pTexture; // ebx@1 UINT v1; // esi@1 unsigned int v2; // ecx@3 LONG uMouseX; // edi@6 LONG uMouseY; // eax@6 GUIButton *pControlsHead; // edx@6 - unsigned int v6; // ecx@7 - int v7; // esi@12 + unsigned int pNumMessage; // ecx@7 + int pControlParam; // esi@12 signed int v8; // edi@30 int v9; // edx@31 char *v10; // ebx@37 @@ -5877,7 +5875,7 @@ POINT v24; // [sp+78h] [bp-8h]@6 Player *pPlayer; - v0 = &pTexture_PCX; + pTexture = &pTexture_PCX; v1 = 0; v26 = 0; pTexture_PCX.Release(); @@ -5897,19 +5895,20 @@ pControlsHead = pGUIWindow_CurrentMenu->pControlsHead; if ( pControlsHead != (GUIButton *)v1 ) { - v6 = pMessageQueue_50CBD0->uNumMessages; + pNumMessage = pMessageQueue_50CBD0->uNumMessages; do { - if ( uMouseX >= (signed int)pControlsHead->uX && uMouseX <= (signed int)pControlsHead->uZ && uMouseY >= (signed int)pControlsHead->uY && uMouseY <= (signed int)pControlsHead->uW )//mouse movement - { - v7 = pControlsHead->uControlParam; - if ( (signed int)v6 < 40 ) - { - pMessageQueue_50CBD0->pMessages[v6].eType = (UIMessageType)pControlsHead->field_1C; - v0 = &pTexture_PCX; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v7; + if ( uMouseX >= (signed int)pControlsHead->uX && uMouseX <= (signed int)pControlsHead->uZ + && uMouseY >= (signed int)pControlsHead->uY && uMouseY <= (signed int)pControlsHead->uW )//mouse movement + { + pControlParam = pControlsHead->uControlParam; + if ( (signed int)pNumMessage < 40 ) + { + pMessageQueue_50CBD0->pMessages[pNumMessage].eType = (UIMessageType)pControlsHead->field_1C; + pTexture = &pTexture_PCX; + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = pControlParam; *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; - v6 = pMessageQueue_50CBD0->uNumMessages + 1; + pNumMessage = pMessageQueue_50CBD0->uNumMessages + 1; ++pMessageQueue_50CBD0->uNumMessages; } v1 = 0; @@ -5951,7 +5950,7 @@ } } } - v0->Release(); + pTexture->Release(); pGUIWindow_CurrentMenu->Release(); pIcons_LOD->_4114F2(); v20[0] = 0; @@ -6011,37 +6010,48 @@ { case 0: v18 = 61; - goto LABEL_69; + pPlayer->AddItem(-1, v18); + break; case 1: v18 = 1; - goto LABEL_69; + pPlayer->AddItem(-1, v18); + break; case 2: v18 = 15; - goto LABEL_69; + pPlayer->AddItem(-1, v18); + break; case 3: v18 = 23; - goto LABEL_69; + pPlayer->AddItem(-1, v18); + break; case 4: v18 = 31; - goto LABEL_69; + pPlayer->AddItem(-1, v18); + break; case 5: v18 = 47; - goto LABEL_69; + pPlayer->AddItem(-1, v18); + break; case 6: v18 = 50; - goto LABEL_69; + pPlayer->AddItem(-1, v18); + break; case 8: v18 = 84; - goto LABEL_69; + pPlayer->AddItem(-1, v18); + break; case 9: v18 = 66; - goto LABEL_69; + pPlayer->AddItem(-1, v18); + break; case 10: v18 = 71; - goto LABEL_69; + pPlayer->AddItem(-1, v18); + break; case 11: v18 = 76; - goto LABEL_69; + pPlayer->AddItem(-1, v18); + break; case 12: pPlayer->AddItem(-1, 0x191); pPlayer->spellbook.pFireSpellbook.bIsSpellbookAvailable = 1; @@ -6078,13 +6088,14 @@ case 36: pPlayer->AddItem(-1, 0xDC); v18 = 5 * (rand() % 3 + 40); - goto LABEL_69; + pPlayer->AddItem(-1, v18); + break; case 30: v18 = 115; - goto LABEL_69; + pPlayer->AddItem(-1, v18); + break; case 31: v18 = 110; -LABEL_69: pPlayer->AddItem(-1, v18); break; default:
--- a/mm7_5.cpp Tue Jan 08 17:29:13 2013 +0600 +++ b/mm7_5.cpp Wed Jan 09 17:32:10 2013 +0600 @@ -66,9 +66,9 @@ signed int v0; // edi@6 char *v1; // esi@6 unsigned int v2; // edx@7 - Actor *v3; // ecx@13 + Actor *pActor; // ecx@13 int v4; // ecx@18 - NPCData *v5; // eax@18 + NPCData *pNPCData; // eax@18 int v6; // edx@20 int v7; // ecx@29 unsigned int v8; // edx@59 @@ -89,31 +89,31 @@ unsigned int v23; // ecx@135 unsigned int v24; // ecx@149 unsigned int v25; // ecx@165 - GUIWindow *v26; // eax@204 + GUIWindow *pWindow; // eax@204 unsigned int v27; // edx@204 unsigned int v28; // ecx@204 - GUIWindow *v29; // ecx@248 + GUIWindow *pWindow2; // ecx@248 int v30; // edx@258 const char *v31; // ecx@262 signed int v32; // eax@269 unsigned int v33; // eax@277 unsigned __int8 v34; // al@279 unsigned __int8 v35; // al@280 - GUIWindow *v36; // ecx@332 + GUIWindow *pWindow3; // ecx@332 int v37; // eax@341 int v38; // eax@358 SHORT v39; // ax@365 signed int v40; // eax@365 char *v41; // eax@380 int v42; // eax@396 - POINT *v43; // eax@397 + POINT *pPoint; // eax@397 signed int v44; // eax@398 int v45; // edx@398 signed int v46; // ecx@398 char v47; // zf@399 char v48; // zf@405 - BLVFace *v49; // ecx@410 - ODMFace *v50; // ecx@412 + BLVFace *pBLVFace; // ecx@410 + ODMFace *pODMFace; // ecx@412 void *v51; // ecx@415 void *v52; // eax@424 __int16 v53; // ax@431 @@ -121,10 +121,10 @@ int v55; // ecx@432 int v56; // edx@432 int v57; // eax@432 - Player *v58; // edx@442 + Player *pPlayer; // edx@442 unsigned int v59; // eax@445 signed int v60; // ST64_4@459 - NPCData *v61; // eax@467 + NPCData *pNPCData2; // eax@467 unsigned __int64 v62; // kr00_8@467 __int16 v63; // dx@479 unsigned int v64; // eax@486 @@ -135,20 +135,20 @@ char *v69; // eax@512 int v70; // eax@525 int v71; // edi@527 - NPCData *v72; // esi@527 + NPCData *pNPCData3; // esi@527 char *v73; // ecx@533 signed int v74; // edi@535 int v75; // eax@535 int v76; // esi@535 int v77; // eax@537 - Player *v78; // ecx@549 + Player *pPlayer2; // ecx@549 int v79; // ecx@550 unsigned int v80; // edx@550 signed int v81; // eax@552 - POINT *v82; // eax@553 + POINT *pPoint2; // eax@553 signed int v83; // ecx@554 signed int v84; // ecx@554 - GUIButton *v85; // eax@578 + GUIButton *pButton; // eax@578 unsigned int v86; // eax@583 const char *v87; // ecx@595 const char *v88; // ecx@596 @@ -157,19 +157,19 @@ int v91; // edx@605 int v92; // eax@605 int v93; // edx@605 - int v94; // edx@611 + int pPlayerNum; // edx@611 int v95; // eax@611 const char *v96; // ecx@621 unsigned int v97; // eax@624 int v98; // eax@636 unsigned __int8 v99; // al@643 - Player *v100; // eax@648 + Player *pPlayer3; // eax@648 int v101; // ecx@648 int v102; // edx@652 int v103; // eax@671 - Player *v104; // ecx@718 + Player *pPlayer4; // ecx@718 int v105; // eax@718 - Player *v106; // ST78_4@758 + Player *pPlayer5; // ST78_4@758 unsigned int v107; // eax@758 unsigned int v108; // eax@758 char *v109; // ST64_4@759 @@ -180,7 +180,7 @@ signed int v114; // eax@759 unsigned int v115; // eax@764 int v116; // eax@776 - POINT *v117; // eax@777 + POINT *pPoint3; // eax@777 unsigned int v118; // eax@785 unsigned int v119; // ecx@786 unsigned int v120; // [sp-28h] [bp-624h]@86 @@ -204,15 +204,15 @@ unsigned int v138; // [sp-Ch] [bp-608h]@86 signed int v139; // [sp-Ch] [bp-608h]@107 unsigned int v140; // [sp-Ch] [bp-608h]@121 - enum WindowType v141; // [sp-8h] [bp-604h]@56 - enum WindowType v142; // [sp-8h] [bp-604h]@60 + enum WindowType pWindowType; // [sp-8h] [bp-604h]@56 + enum WindowType pWindowType1; // [sp-8h] [bp-604h]@60 unsigned __int8 v143; // [sp-8h] [bp-604h]@86 int v144; // [sp-8h] [bp-604h]@107 - enum WindowType v145; // [sp-8h] [bp-604h]@121 + enum WindowType pWindowType2; // [sp-8h] [bp-604h]@121 const char *v146; // [sp-8h] [bp-604h]@449 unsigned int v147; // [sp-8h] [bp-604h]@550 int v148; // [sp-4h] [bp-600h]@56 - GUIButton *v149; // [sp-4h] [bp-600h]@59 + GUIButton *pButton2; // [sp-4h] [bp-600h]@59 const char *v150; // [sp-4h] [bp-600h]@86 unsigned int v151; // [sp-4h] [bp-600h]@107 int v152; // [sp-4h] [bp-600h]@121 @@ -227,7 +227,7 @@ const char *v161; // [sp-4h] [bp-600h]@637 int v162; // [sp+0h] [bp-5FCh]@56 int v163; // [sp+0h] [bp-5FCh]@59 - Texture *v164; // [sp+0h] [bp-5FCh]@86 + Texture *pTexture; // [sp+0h] [bp-5FCh]@86 int v165; // [sp+0h] [bp-5FCh]@107 int v166; // [sp+0h] [bp-5FCh]@121 int v167; // [sp+0h] [bp-5FCh]@135 @@ -235,7 +235,7 @@ int v169; // [sp+0h] [bp-5FCh]@165 int v170; // [sp+0h] [bp-5FCh]@204 signed int v171; // [sp+0h] [bp-5FCh]@259 - KeyToggleType v172; // [sp+0h] [bp-5FCh]@287 + KeyToggleType pKeyToggleType; // [sp+0h] [bp-5FCh]@287 char *v173; // [sp+0h] [bp-5FCh]@444 char *v174; // [sp+0h] [bp-5FCh]@449 int v175; // [sp+0h] [bp-5FCh]@550 @@ -246,19 +246,19 @@ signed int _this; // [sp+14h] [bp-5E8h]@22 signed int thisa; // [sp+14h] [bp-5E8h]@251 signed int thisb; // [sp+14h] [bp-5E8h]@272 - Player *thisc; // [sp+14h] [bp-5E8h]@373 - Player *thisd; // [sp+14h] [bp-5E8h]@377 + Player *pPlayer7; // [sp+14h] [bp-5E8h]@373 + Player *pPlayer8; // [sp+14h] [bp-5E8h]@377 char *thise; // [sp+14h] [bp-5E8h]@445 - Player *thisf; // [sp+14h] [bp-5E8h]@455 + Player *pPlayer9; // [sp+14h] [bp-5E8h]@455 int thisg; // [sp+14h] [bp-5E8h]@467 int thish; // [sp+14h] [bp-5E8h]@528 signed int thisi; // [sp+14h] [bp-5E8h]@535 - MapInfo *thisj; // [sp+14h] [bp-5E8h]@604 - Player *thisk; // [sp+14h] [bp-5E8h]@641 + MapInfo *pMapInfo; // [sp+14h] [bp-5E8h]@604 + Player *pPlayer10; // [sp+14h] [bp-5E8h]@641 int thisl; // [sp+14h] [bp-5E8h]@648 int uMessageParam; // [sp+18h] [bp-5E4h]@7 int uAction; // [sp+1Ch] [bp-5E0h]@18 - NPCData *v195; // [sp+20h] [bp-5DCh]@23 + NPCData *pNPCData4; // [sp+20h] [bp-5DCh]@23 unsigned int uNumSeconds; // [sp+24h] [bp-5D8h]@18 char v197; // [sp+2Bh] [bp-5D1h]@101 enum UIMessageType uMessage; // [sp+2Ch] [bp-5D0h]@7 @@ -328,45 +328,44 @@ if ( pMessageQueue_50CBD0->uNumMessages ) pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; dword_5B65D0_dialogue_actor_npc_id = pActors[uMessageParam].uNPC_ID; - v3 = &pActors[uMessageParam]; + pActor = &pActors[uMessageParam]; goto _actor_init_dlg; case UIMSG_Quit|0x2: case 0x87: - if ( bNoNPCHiring != 1 - && !pCurrentScreen ) + if ( bNoNPCHiring != 1 && !pCurrentScreen ) { if ( pMessageQueue_50CBD0->uNumMessages ) pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; uAction = 0; uNumSeconds = uMessage - 134; v4 = 0; - v5 = pParty->pHirelings; + pNPCData = pParty->pHirelings; do { - if ( v5->pName ) + if ( pNPCData->pName ) { v6 = uAction++; pTmpBuf[v6] = v4; } - ++v5; + ++pNPCData; ++v4; } - while ( (signed int)v5 < (signed int)&pParty->pPickedItem ); + while ( (signed int)pNPCData < (signed int)&pParty->pPickedItem ); _this = 0; if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) { - v195 = pNPCStats->pNewNPCData; + pNPCData4 = pNPCStats->pNewNPCData; do { - if ( v195->uFlags & 0x80 - && (!pParty->pHirelings[0].pName || strcmp(v195->pName, pParty->pHirelings[0].pName)) - && (!pParty->pHirelings[1].pName || strcmp(v195->pName, pParty->pHirelings[1].pName)) ) + if ( pNPCData4->uFlags & 0x80 + && (!pParty->pHirelings[0].pName || strcmp(pNPCData4->pName, pParty->pHirelings[0].pName)) + && (!pParty->pHirelings[1].pName || strcmp(pNPCData4->pName, pParty->pHirelings[1].pName)) ) { v7 = uAction++; pTmpBuf[v7] = _this + 2; } ++_this; - ++v195; + ++pNPCData4; } while ( _this < (signed int)pNPCStats->uNumNewNPCs ); } @@ -375,9 +374,9 @@ //Actor::Actor(&actor); memset(&actor, 0, 0x344u); actor.uNPC_ID += -1 - (unsigned __int8)pParty->field_709 - uNumSeconds; - v3 = &actor; + pActor = &actor; _actor_init_dlg: - v3->InitializeDialogue(v0); + pActor->InitializeDialogue(v0); } } goto _continue; @@ -455,7 +454,7 @@ pCurrentScreen = 2; v162 = 0; v148 = 0; - v141 = (WindowType)8; + pWindowType = (WindowType)8; goto LABEL_439; case UIMSG_A2: --dword_6A0C9C; @@ -463,17 +462,22 @@ dword_6A0C9C = 0; v163 = 0; v8 = 199; - v149 = ptr_69BD5C; - goto LABEL_60; + pButton2 = ptr_69BD5C; + //goto LABEL_60; + pWindowType1 = (WindowType)90; + v137 = 17; + v133 = 17; + v9 = 215; + goto LABEL_733; case UIMSG_A3: ++dword_6A0C9C; if ( dword_6A0C9C >= uMessageParam ) dword_6A0C9C = uMessageParam - 1; v163 = 0; v8 = 323; - v149 = ptr_69BD58; -LABEL_60: - v142 = (WindowType)90; + pButton2 = ptr_69BD58; +//LABEL_60: + pWindowType1 = (WindowType)90; v137 = 17; v133 = 17; v9 = 215; @@ -481,26 +485,25 @@ case UIMSG_A6: v163 = 0; v8 = 302; - v149 = ptr_69BD60; + pButton2 = ptr_69BD60; v9 = 350; - v142 = (WindowType)96; + pWindowType1 = (WindowType)96; v137 = 42; v133 = 106; goto LABEL_733; case UIMSG_A4: v163 = 0; v8 = 302; - v149 = ptr_69BD64; + pButton2 = ptr_69BD64; v9 = 241; - v142 = (WindowType)94; + pWindowType1 = (WindowType)94; v137 = 42; v133 = 106; goto LABEL_733; case UIMSG_A5: if ( pGUIWindow_CurrentMenu->field_40 == v0 ) pKeyActionMap->_459ED1(0); - if ( pCurrentScreen != 11 - || uLoadGameUI_SelectedSlot != dword_6A0C9C + uMessageParam ) + if ( pCurrentScreen != 11 || uLoadGameUI_SelectedSlot != dword_6A0C9C + uMessageParam ) { v10 = dword_6A0C9C + uMessageParam; if ( dword_6BE138 == dword_6A0C9C + uMessageParam ) @@ -529,12 +532,8 @@ else { pKeyActionMap->_459E5A(0, 19, pGUIWindow_CurrentMenu); - if ( strcmp( - (const char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot, - pGlobalTXT_LocalizationStrings[72]) )// "Empty" - strcpy( - (char *)pKeyActionMap->pPressedKeysBuffer, - (const char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot); + if ( strcmp((const char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot, pGlobalTXT_LocalizationStrings[72]) )// "Empty" + strcpy((char *)pKeyActionMap->pPressedKeysBuffer, (const char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot); pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); } goto _continue; @@ -587,185 +586,54 @@ uTextureID_507CB8 = pIcons_LOD->LoadTexture("option02", TEXTURE_16BIT_PALETTE); uTextureID_507CB4 = pIcons_LOD->LoadTexture("option01", TEXTURE_16BIT_PALETTE); pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Options, 0, 0); - pGUIWindow_CurrentMenu->CreateButton( - 0x16u, - 0x10Eu, + pGUIWindow_CurrentMenu->CreateButton(0x16u, 0x10Eu, (uTextureID_507C6C != -1 ? pIcons_LOD->pTextures[uTextureID_507C6C].uTextureWidth : 24), (uTextureID_507C6C != -1 ? pIcons_LOD->pTextures[uTextureID_507C6C].uTextureHeight : 26), - v0, - 0, - 0xB8u, - 0x80u, - 0, - v1, - 0); - pGUIWindow_CurrentMenu->CreateButton( - 0x5Du, - 0x10Eu, + v0, 0, 0xB8u, 0x80u, 0, v1, 0); + pGUIWindow_CurrentMenu->CreateButton(0x5Du, 0x10Eu, (uTextureID_507C68 != -1 ? pIcons_LOD->pTextures[uTextureID_507C68].uTextureWidth : 24), (uTextureID_507C68 != -1 ? pIcons_LOD->pTextures[uTextureID_507C68].uTextureHeight : 26), - v0, - 0, - 0xB8u, - 0x40u, - 0, - v1, - 0); - pGUIWindow_CurrentMenu->CreateButton( - 0xA4u, - 0x10Eu, + v0, 0, 0xB8u, 0x40u, 0, v1, 0); + pGUIWindow_CurrentMenu->CreateButton(0xA4u, 0x10Eu, (uTextureID_507C64[0] != -1 ? pIcons_LOD->pTextures[uTextureID_507C64[0]].uTextureWidth : 24), (uTextureID_507C64[0] != -1 ? pIcons_LOD->pTextures[uTextureID_507C64[0]].uTextureHeight : 26), - v0, - 0, - 0xB8u, - 0, - 0, - v1, - 0); - pGUIWindow_CurrentMenu->CreateButton( - 0x14u, - 0x12Fu, + v0, 0, 0xB8u, 0, 0, v1, 0); + pGUIWindow_CurrentMenu->CreateButton(0x14u, 0x12Fu, (uTextureID_507CB4 != -1 ? pIcons_LOD->pTextures[uTextureID_507CB4].uTextureWidth : 24), (uTextureID_507CB4 != -1 ? pIcons_LOD->pTextures[uTextureID_507CB4].uTextureHeight : 26), - v0, - 0, - 0xB9u, - 0, - 0, - v1, - 0); - pGUIWindow_CurrentMenu->CreateButton( - 0x80u, - 0x12Fu, + v0, 0, 0xB9u, 0, 0, v1, 0); + pGUIWindow_CurrentMenu->CreateButton(0x80u, 0x12Fu, (uTextureID_507CB8 != -1 ? pIcons_LOD->pTextures[uTextureID_507CB8].uTextureWidth : 24), (uTextureID_507CB8 != -1 ? pIcons_LOD->pTextures[uTextureID_507CB8].uTextureHeight : 26), - v0, - 0, - 0xBBu, - 0, - 0, - v1, - 0); - pGUIWindow_CurrentMenu->CreateButton( - 0x14u, - 0x145u, + v0, 0, 0xBBu, 0, 0, v1, 0); + pGUIWindow_CurrentMenu->CreateButton(0x14u, 0x145u, (uTextureID_507CB0 != -1 ? pIcons_LOD->pTextures[uTextureID_507CB0].uTextureWidth : 24), (uTextureID_507CB0 != -1 ? pIcons_LOD->pTextures[uTextureID_507CB0].uTextureHeight : 26), - v0, - 0, - 0xE1u, - 0, - 0, - v1, - 0); - pGUIWindow_CurrentMenu->CreateButton( - 0x80u, - 0x145u, + v0, 0, 0xE1u, 0, 0, v1, 0); + pGUIWindow_CurrentMenu->CreateButton(0x80u, 0x145u, (uTextureID_507C84 != -1 ? pIcons_LOD->pTextures[uTextureID_507C84].uTextureWidth : 24), (uTextureID_507C84 != -1 ? pIcons_LOD->pTextures[uTextureID_507C84].uTextureHeight : 26), - v0, - 0, - 0xE2u, - 0, - 0, - v1, - 0); - pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton( - 243u, - 162u, - 16u, - 16u, - v0, - 0, - 111u, - 4u, - 0, - v1, - &pIcons_LOD->pTextures[uTextureID_507C70], - 0); - pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton( - 0x1B3u, - 0xA2u, - 0x10u, - 0x10u, - v0, - 0, - 0x6Fu, - 5u, - 0, - v1, - &pIcons_LOD->pTextures[uTextureID_507C74], - 0); + v0, 0, 0xE2u, 0, 0, v1, 0); + pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 162, 16, 16, v0, 0, 111, 4, 0, v1, + &pIcons_LOD->pTextures[uTextureID_507C70], 0); + pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0x1B3u, 0xA2u, 0x10u, 0x10u, v0, 0, 0x6Fu, 5, 0, v1, + &pIcons_LOD->pTextures[uTextureID_507C74], 0); pGUIWindow_CurrentMenu->CreateButton(0x107u, 0xA2u, 0xACu, 0x11u, v0, 0, 0x6Fu, 0, 0, v1, 0); - pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton( - 0xF3u, - 0xD8u, - 0x10u, - 0x10u, - v0, - 0, - 0x70u, - 4u, - 0, - v1, - &pIcons_LOD->pTextures[uTextureID_507C70], - 0); - pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton( - 0x1B3u, - 0xD8u, - 0x10u, - 0x10u, - v0, - 0, - 0x70u, - 5u, - 0, - v1, - &pIcons_LOD->pTextures[uTextureID_507C74], - 0); + pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0xF3u, 0xD8u, 0x10u, 0x10u, v0, 0, 0x70u, 4, 0, v1, + &pIcons_LOD->pTextures[uTextureID_507C70], 0); + pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0x1B3u, 0xD8u, 0x10u, 0x10u, v0, 0, 0x70u, 5, 0, v1, + &pIcons_LOD->pTextures[uTextureID_507C74], 0); pGUIWindow_CurrentMenu->CreateButton(0x107u, 0xD8u, 0xACu, 0x11u, v0, 0, 0x70u, 0, 0, v1, 0); - pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton( - 0xF3u, - 0x10Eu, - 0x10u, - 0x10u, - v0, - 0, - 0xBAu, - 4u, - 0, - v1, - &pIcons_LOD->pTextures[uTextureID_507C70], - 0); - pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton( - 0x1B3u, - 0x10Eu, - 0x10u, - 0x10u, - v0, - 0, - 0xBAu, - 5u, - 0, - v1, - &pIcons_LOD->pTextures[uTextureID_507C74], - 0); + pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0xF3u, 0x10Eu, 0x10u, 0x10u, v0, 0, 0xBAu, 4, 0, v1, + &pIcons_LOD->pTextures[uTextureID_507C70], 0); + pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0x1B3u, 0x10Eu, 0x10u, 0x10u, v0, 0, 0xBAu, 5u, 0, v1, + &pIcons_LOD->pTextures[uTextureID_507C74], 0); pGUIWindow_CurrentMenu->CreateButton(0x107u, 0x10Eu, 0xACu, 0x11u, v0, 0, 0xBAu, 0, 0, v1, 0); - pGUIWindow_CurrentMenu->CreateButton( - 0xF1u, - 0x12Eu, - 0xD6u, - 0x28u, - v0, - 0, - 0x71u, - 0, - 0, + pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, v0, 0, 0x71u, 0, 0, pGlobalTXT_LocalizationStrings[619],// "Return to Game" 0); pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x8Cu, 0xD6u, 0x28u, v0, 0, 0x19Fu, 0, 0x4Bu, v1, 0); - v164 = 0; + pTexture = 0; v150 = v1; v143 = 86; v138 = 0; @@ -846,8 +714,7 @@ GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[uAction]), v17, 0); } } - pPrevVirtualCidesMapping[uAction] = pKeyActionMap->GetActionVKey( - (enum InputAction)uAction); + pPrevVirtualCidesMapping[uAction] = pKeyActionMap->GetActionVKey((enum InputAction)uAction); v18 = uAction++; v13 = __OFSUB__(uAction, 28); v12 = uAction - 28 < 0; @@ -907,33 +774,11 @@ v0 = 1; if ( GammaController::IsGammaSupported() ) { - pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton( - 0x15u, - 0xA1u, - 0x10u, - 0x10u, - 1, - 0, - 0x1A9u, - 4u, - 0, - v1, - &pIcons_LOD->pTextures[uTextureID_507C20], - 0); - pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton( - 0xD5u, - 0xA1u, - 0x10u, - 0x10u, - 1, - 0, - 0x1A9u, - 5u, - 0, - v1, - &pIcons_LOD->pTextures[uTextureID_507C24], - 0); - v164 = 0; + pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0x15u, 0xA1u, 0x10u, 0x10u, 1, 0, 0x1A9u, 4u, 0, v1, + &pIcons_LOD->pTextures[uTextureID_507C20], 0); + pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0xD5u, 0xA1u, 0x10u, 0x10u, 1, 0, 0x1A9u, 5u, 0, v1, + &pIcons_LOD->pTextures[uTextureID_507C24], 0); + pTexture = 0; v150 = v1; v143 = 0; v138 = 0; @@ -945,18 +790,7 @@ v122 = 162; v120 = 42; LABEL_117: - pGUIWindow_CurrentMenu->CreateButton( - v120, - v122, - v124, - v126, - v129, - v131, - v134, - v138, - v143, - v150, - v164); + pGUIWindow_CurrentMenu->CreateButton(v120, v122, v124, v126, v129, v131, v134, v138, v143, v150, pTexture); } } goto _continue; @@ -973,7 +807,7 @@ pGame->pGammaController->Initialize(v19); v166 = v0; v152 = (int)pBtn_SliderLeft; - v145 = (WindowType)90; + pWindowType2 = (WindowType)90; v140 = 0; v136 = 0; v20 = 21; @@ -989,11 +823,11 @@ v20 = 213; v166 = v0; v152 = (int)pBtn_SliderRight; - v145 = (WindowType)90; + pWindowType2 = (WindowType)90; v140 = 0; v136 = 0; LABEL_122: - GUIWindow::Create(v20, 0xA1u, v136, v140, v145, v152, v166); + GUIWindow::Create(v20, 0xA1u, v136, v140, pWindowType2, v152, v166); goto LABEL_128; } uGammaPos = 9; @@ -1051,17 +885,9 @@ uMusicVolimeMultiplier = 9; LABEL_143: if ( uMusicVolimeMultiplier ) - pAudioPlayer->PlaySound( - SOUND_Bell, - -1, - 0, - -1, - 0, - 0, - (signed __int64)(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0), - 0); - pAudioPlayer->SetMusicVolume( - (signed __int64)(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0)); + pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, + (signed __int64)(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0), 0); + pAudioPlayer->SetMusicVolume((signed __int64)(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0)); goto _continue; case UIMSG_ChangeSoundVolume: if ( uMessageParam == 4 ) @@ -1090,8 +916,7 @@ if ( (char)uSoundVolumeMultiplier > 8 ) uSoundVolumeMultiplier = 9; LABEL_157: - pAudioPlayer->SetMasterVolume( - (signed __int64)(pSoundVolumeLevels[(char)uSoundVolumeMultiplier] * 128.0)); + pAudioPlayer->SetMasterVolume((signed __int64)(pSoundVolumeLevels[(char)uSoundVolumeMultiplier] * 128.0)); v165 = 0; v151 = 0; v144 = 0; @@ -1215,7 +1040,7 @@ viewparams->sPartyPosX = pParty->vPosition.x; viewparams->sPartyPosZ = pParty->vPosition.y; pAudioPlayer->StopChannels(-1, -1); - v26 = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0); + pWindow = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0); v27 = 353; v28 = 546; v170 = 0; @@ -1228,13 +1053,13 @@ pGUIWindow_CurrentMenu->Release(); pEventTimer->Pause(); pAudioPlayer->StopChannels(-1, -1); - v26 = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0); + pWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0); v27 = 354; v28 = 570; v170 = 0; v156 = (int)pBtn_Calendar; LABEL_210: - pGUIWindow_CurrentMenu = v26; + pGUIWindow_CurrentMenu = pWindow; pBooksWindow = GUIWindow::Create(v28, v27, 0, 0, (enum WindowType)99, v156, v170); goto _continue; case UIMSG_OpenHistoryBook: @@ -1254,9 +1079,7 @@ pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; if ( pCurrentScreen > 15 ) { - if ( pCurrentScreen >= 17 - && (pCurrentScreen <= 18 - || pCurrentScreen == 104) ) + if ( pCurrentScreen >= 17 && (pCurrentScreen <= 18 || pCurrentScreen == 104) ) { LABEL_229: if ( dword_50CDC8 ) @@ -1267,13 +1090,9 @@ } else { - if ( pCurrentScreen >= 14 - || pCurrentScreen == 4 - || pCurrentScreen == 10 ) + if ( pCurrentScreen >= 14 || pCurrentScreen == 4 || pCurrentScreen == 10 ) goto LABEL_229; - if ( pCurrentScreen == 13 - && !dword_50CDC8 - && !dword_5C35C8 ) + if ( pCurrentScreen == 13 && !dword_50CDC8 && !dword_5C35C8 ) { sub_42FC15(); dword_5C35C8 = 0; @@ -1336,12 +1155,12 @@ pCurrentScreen = 10; goto _continue; case 10: - v29 = pChestWindow; + pWindow2 = pChestWindow; goto LABEL_249; case 25: - v29 = ptr_507BC8; + pWindow2 = ptr_507BC8; LABEL_249: - v29->Release(); + pWindow2->Release(); pIcons_LOD->_4114F2(); pCurrentScreen = 0; viewparams->bRedrawGameUI = v0; @@ -1442,19 +1261,11 @@ GUI_ReplaceHotkey(v35, LOBYTE(pPrevVirtualCidesMapping[uAction]), 0); } } - if ( uAction - && uAction != 2 - && uAction != 3 - && uAction != v0 - && uAction != 25 - && uAction != 26 ) - v172 = (KeyToggleType)v0; + if ( uAction && uAction != 2 && uAction != 3 && uAction != v0 && uAction != 25 && uAction != 26 ) + pKeyToggleType = (KeyToggleType)v0; else - v172 = (KeyToggleType)0; - pKeyActionMap->SetKeyMapping( - uAction, - pPrevVirtualCidesMapping[uAction], - v172); + pKeyToggleType = (KeyToggleType)0; + pKeyActionMap->SetKeyMapping(uAction, pPrevVirtualCidesMapping[uAction], pKeyToggleType); ++uAction; } while ( uAction < 28 ); @@ -1580,8 +1391,8 @@ pIcons_LOD->_4355F7(); goto _continue; } - v36 = pGUIWindow_Settings; - if ( !pGUIWindow_Settings ) + pWindow3 = pGUIWindow_Settings; + if ( !pGUIWindow_Settings )//Draw Menu { dword_6BE138 = -1; GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, (enum WindowType)90, (int)pBtn_GameSettings, v0); @@ -1599,84 +1410,24 @@ uTextureID_507934 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE); uTextureID_507930 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE); uTextureID_50792C = pIcons_LOD->LoadTexture("quit1", TEXTURE_16BIT_PALETTE); - pBtn_NewGame = pGUIWindow_CurrentMenu->CreateButton( - 0x13u, - 0x9Bu, - 0xD6u, - 0x28u, - v0, - 0, - 0x7Cu, - 0, - 0x4Eu, + pBtn_NewGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x9Bu, 0xD6u, 0x28u, v0, 0, 0x7Cu, 0, 0x4Eu, pGlobalTXT_LocalizationStrings[614],// "New Game" - (Texture *)(uTextureID_507940 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507940] : 0), - 0); - pBtn_SaveGame = pGUIWindow_CurrentMenu->CreateButton( - 0x13u, - 0xD1u, - 0xD6u, - 0x28u, - v0, - 0, - 0x7Eu, - 0, - 0x53u, + (Texture *)(uTextureID_507940 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507940] : 0), 0); + pBtn_SaveGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0xD1u, 0xD6u, 0x28u, v0, 0, 0x7Eu, 0, 0x53u, pGlobalTXT_LocalizationStrings[615],// "Save Game" - (Texture *)(uTextureID_507938 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507938] : 0), - 0); - pBtn_LoadGame = pGUIWindow_CurrentMenu->CreateButton( - 0x13u, - 0x107u, - 0xD6u, - 0x28u, - v0, - 0, - 0x7Du, - 0, - 0x4Cu, + (Texture *)(uTextureID_507938 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507938] : 0), 0); + pBtn_LoadGame = pGUIWindow_CurrentMenu->CreateButton(19, 263, 0xD6u, 0x28u, v0, 0, 0x7Du, 0, 0x4Cu, pGlobalTXT_LocalizationStrings[616],// "Load Game" - (Texture *)(uTextureID_50793C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50793C] : 0), - 0); - pBtn_GameControls = pGUIWindow_CurrentMenu->CreateButton( - 0xF1u, - 0x9Bu, - 0xD6u, - 0x28u, - v0, - 0, - 0x7Fu, - 0, - 0x43u, + (Texture *)(uTextureID_50793C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50793C] : 0), 0); + pBtn_GameControls = pGUIWindow_CurrentMenu->CreateButton(241, 155, 214, 40, v0, 0, 0x7Fu, 0, 0x43u, pGlobalTXT_LocalizationStrings[617],// ""Sound, Keyboard, Game Options:"" - (Texture *)(uTextureID_507934 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507934] : 0), - 0); - pBtn_QuitGame = pGUIWindow_CurrentMenu->CreateButton( - 0xF1u, - 0xD1u, - 0xD6u, - 0x28u, - v0, - 0, - 0x84u, - 0, - 0x51u, + (Texture *)(uTextureID_507934 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507934] : 0), 0); + pBtn_QuitGame = pGUIWindow_CurrentMenu->CreateButton(241, 209, 214, 40, v0, 0, 0x84u, 0, 0x51u, pGlobalTXT_LocalizationStrings[618],// "Quit" - (Texture *)(uTextureID_50792C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50792C] : 0), - 0); - pBtn_Resume = pGUIWindow_CurrentMenu->CreateButton( - 0xF1u, - 0x107u, - 0xD6u, - 0x28u, - v0, - 0, - 0x7Bu, - 0, - 0x52u, + (Texture *)(uTextureID_50792C != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_50792C] : 0), 0); + pBtn_Resume = pGUIWindow_CurrentMenu->CreateButton(241, 263, 214, 40, v0, 0, 0x7Bu, 0, 0x52u, pGlobalTXT_LocalizationStrings[619],// "Return to Game" - (Texture *)(uTextureID_507930 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507930] : 0), - 0); + (Texture *)(uTextureID_507930 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507930] : 0), 0); pGUIWindow_CurrentMenu->_41D08F(6, v0, 0, 0); viewparams->field_48 = v0; stru_506E40.Release(); @@ -1695,18 +1446,12 @@ if ( uMessageParam ) { GUIWindow::Create(0x272u, 0xB3u, 0, 0, (enum WindowType)90, (int)pBtn_NPCRight, 0); - v37 = (pParty->pHirelings[0].pName != 0) - + (pParty->pHirelings[1].pName != 0) - + (unsigned __int8)pParty->field_70A - - 2; + v37 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + (unsigned __int8)pParty->field_70A - 2; if ( (unsigned __int8)pParty->field_709 < v37 ) { ++pParty->field_709; if ( (unsigned __int8)pParty->field_709 >= v37 ) - pParty->field_709 = (pParty->pHirelings[0].pName != 0) - + (pParty->pHirelings[1].pName != 0) - + pParty->field_70A - - 2; + pParty->field_709 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + pParty->field_70A - 2; } } else @@ -1797,7 +1542,7 @@ pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; dword_50CDC8 = v0; sub_42FBDD(); - v195 = (NPCData *)GetTravelTime(); + pNPCData4 = (NPCData *)GetTravelTime(); strcpy(pOutdoor->pLevelFilename, pCurrentMapName); if ( bUnderwater != 1 && pParty->bFlying || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, &pOut, 20) != v0 ) @@ -1828,32 +1573,32 @@ ++pGameLoadingUI_ProgressBar->uProgressMax; SaveGame(v0, 0); pGameLoadingUI_ProgressBar->Progress(); - RestAndHeal(1440 * (signed int)v195); + RestAndHeal(1440 * (signed int)pNPCData4); if ( pParty->uNumFoodRations ) { pParty->RestAndHeal(); - if ( ((pParty->uNumFoodRations - (signed int)v195) & 0x80000000u) != 0 ) + if ( ((pParty->uNumFoodRations - (signed int)pNPCData4) & 0x80000000u) != 0 ) { - thisc = pParty->pPlayers; + pPlayer7 = pParty->pPlayers; do { - thisc->SetCondition(v0, 0); - ++thisc; + pPlayer7->SetCondition(v0, 0); + ++pPlayer7; } - while ( (signed int)thisc < (signed int)pParty->pHirelings ); + while ( (signed int)pPlayer7 < (signed int)pParty->pHirelings ); ++pParty->field_764; } - Party::TakeFood((unsigned int)v195); + Party::TakeFood((unsigned int)pNPCData4); } else { - thisd = pParty->pPlayers; + pPlayer8 = pParty->pPlayers; do { - thisd->SetCondition(v0, 0); - ++thisd; + pPlayer8->SetCondition(v0, 0); + ++pPlayer8; } - while ( (signed int)thisd < (signed int)pParty->pHirelings ); + while ( (signed int)pPlayer8 < (signed int)pParty->pHirelings ); ++pParty->field_764; } pPaletteManager->ResetNonLocked(); @@ -1902,8 +1647,8 @@ else { uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v210); - v43 = pMouse->GetCursorPos(&v208); - v42 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[v43->y]]; + pPoint = pMouse->GetCursorPos(&v208); + v42 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint->y]]; } v44 = (unsigned __int16)v42; v45 = v44 & 7; @@ -1932,16 +1677,16 @@ goto _continue; if ( uCurrentlyLoadedLevelType != v0 ) { - v50 = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F]; - if ( !(v50->uAttributes & 0x02000000) || !v50->sCogTriggeredID ) + pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F]; + if ( !(pODMFace->uAttributes & 0x02000000) || !pODMFace->sCogTriggeredID ) goto _continue; v44 = uNumSeconds; goto LABEL_415; } - v49 = &pIndoor->pFaces[v46]; - if ( !(BYTE3(v49->uAttributes) & 2) ) + pBLVFace = &pIndoor->pFaces[v46]; + if ( !(BYTE3(pBLVFace->uAttributes) & 2) ) goto _continue; - v48 = pIndoor->pFaceExtras[v49->uFaceExtraID].uEventID == 0; + v48 = pIndoor->pFaceExtras[pBLVFace->uFaceExtraID].uEventID == 0; } if ( v48 ) goto _continue; @@ -1952,9 +1697,9 @@ *((short *)v51 + 2) = uMessageParam; *((int *)v51 + 3) = v44; pParty->pPlayers[*((short *)v51 + 1)].SetRecoveryTime(300); - v36 = pGUIWindow_Settings; + pWindow3 = pGUIWindow_Settings; LABEL_333: - v36->Release(); + pWindow3->Release(); pGUIWindow_Settings = 0; pMouse->SetCursorBitmap("MICON1"); GameUI_StatusBar_TimedStringTimeLeft = 0; @@ -2009,12 +1754,9 @@ strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename); dword_6BE364_game_settings_1 |= v0; uGameState = 2; - - - //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C]; + //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C]; v53 = p2DEvents[(unsigned int)ptr_507BC0->ptr_1C - 1]._quest_related; - - if ( v53 < 0 ) + if ( v53 < 0 ) { v54 = abs(v53) - 1; _5B65B8_npcdata_hiword_house_or_other = 0; @@ -2040,9 +1782,9 @@ v162 = 0; v148 = 177; LABEL_438: - v141 = (WindowType)9; + pWindowType = (WindowType)9; LABEL_439: - pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, v141, v148, v162); + pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, pWindowType, v148, v162); goto _continue; case UIMSG_B2: v165 = 0; @@ -2058,13 +1800,13 @@ case UIMSG_B4: if ( !pGUIWindow_CurrentMenu ) goto _continue; - v58 = pPlayers[_506348_current_lloyd_playerid + 1]; - uNumSeconds = (unsigned int)&v58->pInstalledBeacons[uMessageParam]; + pPlayer = pPlayers[_506348_current_lloyd_playerid + 1]; + uNumSeconds = (unsigned int)&pPlayer->pInstalledBeacons[uMessageParam]; if ( bRecallingBeacon ) { if ( !*((int *)&pSavegameThumbnails->pPixels + 10 * uMessageParam) ) goto _continue; - v173 = pMapStats->pInfos[sub_410D99_get_map_index(HIWORD(v58->pInstalledBeacons[uMessageParam].field_18))].pName; + v173 = pMapStats->pInfos[sub_410D99_get_map_index(HIWORD(pPlayer->pInstalledBeacons[uMessageParam].field_18))].pName; v157 = pGlobalTXT_LocalizationStrings[474];// "Recall to %s" goto _sprintex_2args_draw_status_and_continue; } @@ -2088,57 +1830,48 @@ dword_50CDC8 = v0; goto LABEL_453; case UIMSG_B3: - thisf = pPlayers[_506348_current_lloyd_playerid + 1]; - v195 = (NPCData *)&thisf->pInstalledBeacons[uMessageParam]; - if ( !*(_QWORD *)&v195->pName && bRecallingBeacon ) + pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1]; + pNPCData4 = (NPCData *)&pPlayer9->pInstalledBeacons[uMessageParam]; + if ( !*(_QWORD *)&pNPCData4->pName && bRecallingBeacon ) goto _continue; byte_506360 = 1; - thisf->CanCastSpell(uRequiredMana); + pPlayer9->CanCastSpell(uRequiredMana); if ( pParty->bTurnBasedModeOn ) { v60 = sRecoveryTime; pParty->pTurnBasedPlayerRecoveryTimes[_506348_current_lloyd_playerid] = sRecoveryTime; - thisf->SetRecoveryTime(v60); + pPlayer9->SetRecoveryTime(v60); pTurnEngine->_40471C(); } else { - thisf->SetRecoveryTime( - (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); - } - pAudioPlayer->PlaySound( - (SoundID)word_4EE088_sound_ids[dword_506338], - 0, - 0, - -1, - 0, - dword_50633C, - 0, - 0); + pPlayer9->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); + } + pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[dword_506338], 0, 0, -1, 0, dword_50633C, 0, 0); if ( bRecallingBeacon ) { - if ( _strcmpi(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[HIWORD(v195->uProfession)]) ) + if ( _strcmpi(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[HIWORD(pNPCData4->uProfession)]) ) { SaveGame(v0, 0); OnMapLeave(); - strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[HIWORD(v195->uProfession)]); + strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[HIWORD(pNPCData4->uProfession)]); dword_6BE364_game_settings_1 |= v0; uGameState = 2; - _5B65A8_npcdata_uflags_or_other = v195->uFlags; - _5B65AC_npcdata_fame_or_other = v195->fame; - _5B65B0_npcdata_rep_or_other = v195->rep; - _5B65B4_npcdata_loword_house_or_other = LOWORD(v195->house); - _5B65B8_npcdata_hiword_house_or_other = HIWORD(v195->house); + _5B65A8_npcdata_uflags_or_other = pNPCData4->uFlags; + _5B65AC_npcdata_fame_or_other = pNPCData4->fame; + _5B65B0_npcdata_rep_or_other = pNPCData4->rep; + _5B65B4_npcdata_loword_house_or_other = LOWORD(pNPCData4->house); + _5B65B8_npcdata_hiword_house_or_other = HIWORD(pNPCData4->house); dword_5B65C0 = v0; } else { - pParty->vPosition.x = v195->uFlags; - pParty->vPosition.y = v195->fame; - pParty->vPosition.z = v195->rep; + pParty->vPosition.x = pNPCData4->uFlags; + pParty->vPosition.y = pNPCData4->fame; + pParty->vPosition.z = pNPCData4->rep; pParty->uFallStartY = pParty->vPosition.z; - pParty->sRotationY = LOWORD(v195->house); - pParty->sRotationX = HIWORD(v195->house); + pParty->sRotationY = LOWORD(pNPCData4->house); + pParty->sRotationX = HIWORD(pNPCData4->house); } if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) { @@ -2159,16 +1892,16 @@ SaveScreenshot(a1); LoadThumbnailLloydTexture(uMessageParam, _506348_current_lloyd_playerid + 1); v212 = qword_506350 << 7; - v61 = v195; + pNPCData2 = pNPCData4; thisg = 0; v62 = pParty->uTimePlayed + (signed __int64)((double)(qword_506350 << 7) * 0.033333335); - v195->pName = (char *)v62; - v61->uPortraitID = HIDWORD(v62); - v61->uFlags = pParty->vPosition.x; - v61->fame = pParty->vPosition.y; - v61->rep = pParty->vPosition.z; - LOWORD(v61->house) = LOWORD(pParty->sRotationY); - HIWORD(v61->house) = LOWORD(pParty->sRotationX); + pNPCData4->pName = (char *)v62; + pNPCData2->uPortraitID = HIDWORD(v62); + pNPCData2->uFlags = pParty->vPosition.x; + pNPCData2->fame = pParty->vPosition.y; + pNPCData2->rep = pParty->vPosition.z; + LOWORD(pNPCData2->house) = LOWORD(pParty->sRotationY); + HIWORD(pNPCData2->house) = LOWORD(pParty->sRotationX); if ( (signed int)pGames_LOD->uNumSubIndices / 2 <= 0 ) goto _continue; uAction = 0; @@ -2179,7 +1912,7 @@ if ( thisg >= (signed int)pGames_LOD->uNumSubIndices / 2 ) goto _continue; } - HIWORD(v195->uProfession) = thisg; + HIWORD(pNPCData4->uProfession) = thisg; } goto _continue; case UIMSG_B7: @@ -2310,7 +2043,12 @@ break; default: if ( uMessageParam != 5 ) - goto LABEL_519; + //goto LABEL_519; + { + v173 = v200; + v157 = pGlobalTXT_LocalizationStrings[35]; + goto _sprintex_2args_draw_status_and_continue; + } v69 = pMapStats->pInfos[8].pName; break; } @@ -2320,15 +2058,12 @@ v69 = pMapStats->pInfos[21].pName; } v200 = v69; -LABEL_519: +//LABEL_519: v173 = v200; v157 = pGlobalTXT_LocalizationStrings[35]; goto _sprintex_2args_draw_status_and_continue; case UIMSG_ShowFinalWindow: - sprintf( - pFinalMessage, - "%s\n \n%s\n \n%s", - pGlobalTXT_LocalizationStrings[151],// "Congratulations Adventurer." + sprintf(pFinalMessage, "%s\n \n%s\n \n%s", pGlobalTXT_LocalizationStrings[151],// "Congratulations Adventurer." pGlobalTXT_LocalizationStrings[118],// "We hope that you've enjoyed playing Might and Magic VII as much as we did making it. We have saved this screen as MM7_WIN.PCX in your MM7 directory. You can print it out as proof of your accomplishment." pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team." ModalWindow(pFinalMessage, 196); @@ -2341,13 +2076,10 @@ case UIMSG_D5|0x8: LABEL_524: sprintf(pTmpBuf, "%s", pKeyActionMap->pPressedKeysBuffer); - memcpy( - &v216, - texture_frame_table_txt_parser((const char *)pKeyActionMap->pPressedKeysBuffer, &v218), - sizeof(v216)); + memcpy(&v216, texture_frame_table_txt_parser((const char *)pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216)); if ( v216.field_0 == 1 ) { - v195 = (NPCData *)((signed int)pGames_LOD->uNumSubIndices / 2); + pNPCData4 = (NPCData *)((signed int)pGames_LOD->uNumSubIndices / 2); v70 = atoi(v216.pProperties[0]); if ( v70 <= 0 || v70 >= 77 ) { @@ -2359,8 +2091,8 @@ } v71 = v70; strcpy(Str2, pMapStats->pInfos[v70].pFilename); - v72 = 0; - if ( (signed int)v195 > 0 ) + pNPCData3 = 0; + if ( (signed int)pNPCData4 > 0 ) { thish = 0; do @@ -2368,16 +2100,19 @@ if ( !_strcmpi((const char *)&pGames_LOD->pSubIndices[thish], Str2) ) break; ++thish; - v72 = (NPCData *)((char *)v72 + 1); + pNPCData3 = (NPCData *)((char *)pNPCData3 + 1); } - while ( (signed int)v72 < (signed int)v195 ); - if ( (signed int)v72 < (signed int)v195 ) + while ( (signed int)pNPCData3 < (signed int)pNPCData4 ); + if ( (signed int)pNPCData3 < (signed int)pNPCData4 ) { - strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[(int)v72]); + strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[(int)pNPCData3]); dword_6BE364_game_settings_1 |= 1u; uGameState = 2; OnMapLeave(); - goto LABEL_90; + //goto LABEL_90; + v1 = ""; + v0 = 1; + goto _continue; } } sprintf(Str2, "No map found for %s", pMapStats->pInfos[v71].pName); @@ -2423,13 +2158,16 @@ v73 = "Can't jump to that location!"; } ShowStatusBarString(v73, 6u); - goto LABEL_90; + //goto LABEL_90; + v1 = ""; + v0 = 1; + goto _continue; case 0x19: if ( bUnderwater == 1 ) goto LABEL_682; - if ( !uActiveCharacter || (v78 = pPlayers[uActiveCharacter], v78->uTimeToRecovery) ) + if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) ) goto LABEL_90; - v79 = v78->uQuickSpell; + v79 = pPlayer2->uQuickSpell; v175 = uActiveCharacter; v159 = 0; v147 = 0; @@ -2444,14 +2182,19 @@ else { uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v206); - v82 = pMouse->GetCursorPos(&v201); - v81 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[v82->y]]; + pPoint2 = pMouse->GetCursorPos(&v201); + v81 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint2->y]]; } v83 = v81; v44 = (unsigned __int16)v81; v84 = v83 >> 16; if ( (v44 & 7) != 3 || v84 >= 5120 ) - goto LABEL_90; + //goto LABEL_90; + { + v1 = ""; + v0 = 1; + goto _continue; + } v51 = pGUIWindow_Settings->ptr_1C; if ( uMessage == 70 ) { @@ -2466,20 +2209,34 @@ } goto LABEL_416; case 0x1C: - if ( !uActiveCharacter - || pCurrentScreen ) - goto LABEL_90; + if ( !uActiveCharacter || pCurrentScreen ) + //goto LABEL_90; + { + v1 = ""; + v0 = 1; + goto _continue; + } ptr_507BC8 = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)104, uMessageParam, 0); pCurrentScreen = 25; pEventTimer->Pause(); goto _continue; case 0x1B: if ( !uActiveCharacter ) - goto LABEL_90; + //goto LABEL_90; + { + v1 = ""; + v0 = 1; + goto _continue; + } if ( pParty->bTurnBasedModeOn != v0 ) goto LABEL_569; if ( pTurnEngine->field_4 == v0 || pTurnEngine->field_4 == 3 ) - goto LABEL_90; + //goto LABEL_90; + { + v1 = ""; + v0 = 1; + goto _continue; + } if ( !(pTurnEngine->field_18 & 2) ) { LABEL_569: @@ -2491,46 +2248,44 @@ goto _continue; case 0x17: if ( !uActiveCharacter ) - goto LABEL_90; + //goto LABEL_90; + { + v1 = ""; + v0 = 1; + goto _continue; + } if ( pParty->bTurnBasedModeOn != v0 ) goto LABEL_577; if ( pTurnEngine->field_4 == v0 || pTurnEngine->field_4 == 3 ) - goto LABEL_90; + //goto LABEL_90; + { + v1 = ""; + v0 = 1; + goto _continue; + } if ( !(pTurnEngine->field_18 & 2) ) LABEL_577: _42ECB5_PlayerAttacksActor(); goto _continue; case UIMSG_A7: v163 = (int)pGlobalTXT_LocalizationStrings[81];// "Exit Rest" - v85 = pButton_RestUI_Exit; - v149 = pButton_RestUI_Exit; - v142 = (WindowType)96; + pButton = pButton_RestUI_Exit; + pButton2 = pButton_RestUI_Exit; + pWindowType1 = (WindowType)96; goto LABEL_731; case UIMSG_ShowStatus_Player|0x1: if ( dword_506F14 == 2 ) goto LABEL_621; - GUIWindow::Create( - pButton_RestUI_Wait5Minutes->uX, - pButton_RestUI_Wait5Minutes->uY, - 0, - 0, - (enum WindowType)90, - (int)pButton_RestUI_Wait5Minutes, - (int)pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes" + GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, (enum WindowType)90, + (int)pButton_RestUI_Wait5Minutes, (int)pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes" dword_506F14 = v0; _506F18_num_hours_to_sleep = 5; goto _continue; case 0x60: if ( dword_506F14 == 2 ) goto LABEL_621; - GUIWindow::Create( - pButton_RestUI_Wait1Hour->uX, - pButton_RestUI_Wait1Hour->uY, - 0, - 0, - (enum WindowType)90, - (int)pButton_RestUI_Wait1Hour, - (int)pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour" + GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, (enum WindowType)90, + (int)pButton_RestUI_Wait1Hour, (int)pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour" dword_506F14 = v0; _506F18_num_hours_to_sleep = 60; goto _continue; @@ -2569,7 +2324,12 @@ ShowStatusBarString(v88, 2u); v89 = uActiveCharacter; if ( !uActiveCharacter ) - goto LABEL_90; + //goto LABEL_90; + { + v1 = ""; + v0 = 1; + goto _continue; + } v176 = 0; v160 = 13; goto LABEL_619; @@ -2597,23 +2357,23 @@ v90 = pMapStats->GetMapInfo(pCurrentMapName); if ( !v90 ) v90 = rand() % (signed int)pMapStats->uNumMaps + 1; - thisj = &pMapStats->pInfos[v90]; - if ( rand() % 100 + 1 <= thisj->field_30 ) + pMapInfo = &pMapStats->pInfos[v90]; + if ( rand() % 100 + 1 <= pMapInfo->field_30 ) { v91 = rand() % 100; - v92 = thisj->field_31; + v92 = pMapInfo->field_31; v93 = v91 + 1; if ( v93 > v92 ) - v195 = (NPCData *)((v93 > v92 + thisj->field_32) + 2); + pNPCData4 = (NPCData *)((v93 > v92 + pMapInfo->field_32) + 2); else - v195 = (NPCData *)v0; - if ( !sub_45063B(thisj, (int)v195) ) - v195 = 0; - if ( v195 ) + pNPCData4 = (NPCData *)v0; + if ( !sub_45063B(pMapInfo, (int)pNPCData4) ) + pNPCData4 = 0; + if ( pNPCData4 ) { - v94 = rand() % 4; - LODWORD(pParty->pPlayers[v94].pConditions[2]) = 0; - HIDWORD(pParty->pPlayers[v94].pConditions[2]) = 0; + pPlayerNum = rand() % 4; + LODWORD(pParty->pPlayers[pPlayerNum].pConditions[2]) = 0; + HIDWORD(pParty->pPlayers[pPlayerNum].pConditions[2]) = 0; v95 = rand(); Rest(v95 % 6 + 60); _506F18_num_hours_to_sleep = 0; @@ -2656,14 +2416,8 @@ v96 = pGlobalTXT_LocalizationStrings[477];// "You are already resting!" goto LABEL_622; } - GUIWindow::Create( - pButton_RestUI_WaitUntilDawn->uX, - pButton_RestUI_WaitUntilDawn->uY, - 0, - 0, - (enum WindowType)90, - (int)pButton_RestUI_WaitUntilDawn, - (int)pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn" + GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, (enum WindowType)90, + (int)pButton_RestUI_WaitUntilDawn, (int)pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn" v97 = sub_494820(pParty->uCurrentHour); dword_506F14 = v0; _506F18_num_hours_to_sleep = 60 * v97 - pParty->uCurrentMinute; @@ -2712,7 +2466,7 @@ GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, (enum WindowType)90, (int)pBtn_InstallRemoveSpell, 0); if ( !uActiveCharacter ) goto _continue; - thisk = pPlayers[uActiveCharacter]; + pPlayer10 = pPlayers[uActiveCharacter]; if ( !byte_506550 || !dword_50654C ) { v165 = 0; @@ -2721,7 +2475,7 @@ v139 = 0; v135 = -1; v132 = 0; - thisk->uQuickSpell = 0; + pPlayer10->uQuickSpell = 0; v130 = 0; dword_50654C = 0; v127 = 203; @@ -2731,43 +2485,43 @@ pPlayers[uActiveCharacter]->uQuickSpell = v99; stru_A750F8[uActiveCharacter + 3]._494836(v99, uActiveCharacter); if ( uActiveCharacter ) - thisk->PlaySound(12, 0); + pPlayer10->PlaySound(12, 0); byte_506550 = 0; goto _continue; case 0x33: if ( !uActiveCharacter ) goto _continue; - v100 = pPlayers[uActiveCharacter]; - v195 = 0; + pPlayer3 = pPlayers[uActiveCharacter]; + pNPCData4 = 0; uAction = 0; v101 = 0; - thisl = (int)&v100->pActiveSkills[12]; + thisl = (int)&pPlayer3->pActiveSkills[12]; do { if ( *(short *)thisl ) { - if ( v100->pNumSpellBookPage == v101 ) - uAction = (int)v195; - v102 = (int)v195; - v195 = (NPCData *)((char *)v195 + 1); + if ( pPlayer3->pNumSpellBookPage == v101 ) + uAction = (int)pNPCData4; + v102 = (int)pNPCData4; + pNPCData4 = (NPCData *)((char *)pNPCData4 + 1); v217[v102] = v101; } thisl += 2; ++v101; } while ( v101 < 9 ); - if ( !v195 ) + if ( !pNPCData4 ) goto LABEL_662; if ( GetAsyncKeyState(16) ) { --uAction; if ( uAction < 0 ) - uAction = (int)((char *)v195 - 1); + uAction = (int)((char *)pNPCData4 - 1); } else { ++uAction; - if ( uAction >= (signed int)v195 ) + if ( uAction >= (signed int)pNPCData4 ) uAction = 0; } sub_41140B(); @@ -2905,20 +2659,9 @@ pCurrentScreen = 104; pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)12, 5, 0); papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE); - pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton( - 0x187u, - 0x13Cu, - 0x4Bu, - 0x21u, - v0, - 0, - 0x71u, - 0, - 0, + pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, v0, 0, 0x71u, 0, 0, pGlobalTXT_LocalizationStrings[79],// "Exit" - (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0), - 0, - v179); + (Texture *)(uTextureID_BUTTDESC2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTDESC2] : 0), 0, v179); goto _continue; case 0x6B: if ( pCurrentScreen ) @@ -2972,30 +2715,10 @@ v123 = 300; v121 = 600; } - pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton( - v121, - v123, - v125, - v128, - v0, - 0, - 0x55u, - 0, - 0, + pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton(v121, v123, v125, v128, v0, 0, 0x55u, 0, 0, pGlobalTXT_LocalizationStrings[64],// "Detail Toggle" 0); - pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton( - 0x1DCu, - 0, - 0xA4u, - 0x159u, - v0, - 0, - 0x85u, - 0, - 0, - v1, - 0); + pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, v0, 0, 0x85u, 0, 0, v1, 0); goto LABEL_422; case UIMSG_Quit|0x1: OnPaperdollLeftClick(); @@ -3004,21 +2727,21 @@ pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; sub_4196A0(); sub_419379(); - v85 = pCharacterScreen_StatsBtn; + pButton = pCharacterScreen_StatsBtn; goto LABEL_716; case UIMSG_ChangeMusicVolume|0x2: pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101; sub_4196A0(); sub_419379(); sub_419401(); - v85 = pCharacterScreen_SkillsBtn; + pButton = pCharacterScreen_SkillsBtn; goto LABEL_716; case UIMSG_SkillUp: - v104 = pPlayers[uActiveCharacter]; - v105 = (int)&v104->pActiveSkills[uMessageParam]; + pPlayer4 = pPlayers[uActiveCharacter]; + v105 = (int)&pPlayer4->pActiveSkills[uMessageParam]; LOWORD(v2) = *(short *)v105; uNumSeconds = v2; - if ( v104->uSkillPoints < (v2 & 0x3F) + 1 ) + if ( pPlayer4->uSkillPoints < (v2 & 0x3F) + 1 ) { v87 = pGlobalTXT_LocalizationStrings[488];// "You don't have enough skill points!" } @@ -3027,8 +2750,8 @@ if ( (uNumSeconds & 0x3F) < 0x3C ) { *(short *)v105 = uNumSeconds + 1; - v104->uSkillPoints -= v104->pActiveSkills[uMessageParam] & 0x3F; - v104->PlaySound(14, 0); + pPlayer4->uSkillPoints -= pPlayer4->pActiveSkills[uMessageParam] & 0x3F; + pPlayer4->PlaySound(14, 0); v165 = 0; v151 = 0; v144 = 0; @@ -3048,34 +2771,28 @@ pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; sub_419379(); sub_4196A0(); - v85 = pCharacterScreen_InventoryBtn; + pButton = pCharacterScreen_InventoryBtn; LABEL_716: v163 = 0; - v149 = v85; - v142 = (WindowType)91; + pButton2 = pButton; + pWindowType1 = (WindowType)91; goto LABEL_731; case UIMSG_A8: - v85 = pCharacterScreen_ExitBtn; + pButton = pCharacterScreen_ExitBtn; v163 = 0; - v149 = pCharacterScreen_ExitBtn; - v142 = (WindowType)97; + pButton2 = pCharacterScreen_ExitBtn; + pWindowType1 = (WindowType)97; goto LABEL_731; case UIMSG_CloseBook|0x4: sub_419379(); sub_4196A0(); sub_419220(); pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102; - GUIWindow::Create( - pCharacterScreen_AwardsBtn->uX, - pCharacterScreen_AwardsBtn->uY, - 0, - 0, - (WindowType)(WINDOW_HouseInterior|0x42), - (int)pCharacterScreen_AwardsBtn, - 0); + GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, (WindowType)(WINDOW_HouseInterior|0x42), + (int)pCharacterScreen_AwardsBtn, 0); sub_419100(); goto _continue; - case 0x47: + case 71://0x47: switch ( uMessageParam ) { default: @@ -3085,52 +2802,52 @@ case 10: goto LABEL_709; case 0: - v85 = pBtn_Book_1; + pButton = pBtn_Book_1; dword_506544 = v0; break; case 1: - v85 = pBtn_Book_2; + pButton = pBtn_Book_2; dword_506548 = v0; break; case 2: dword_506540 = v0; if ( dword_506364 ) goto _continue; - v85 = pBtn_Book_3; + pButton = pBtn_Book_3; break; case 3: dword_50653C = v0; if ( dword_506364 ) goto _continue; - v85 = pBtn_Book_4; + pButton = pBtn_Book_4; break; case 4: dword_506538 = v0; if ( dword_506364 ) goto _continue; - v85 = pBtn_Book_5; + pButton = pBtn_Book_5; break; case 5: dword_506534 = v0; if ( dword_506364 ) goto _continue; - v85 = pBtn_Book_6; + pButton = pBtn_Book_6; break; case 6: - v85 = pBtn_Autonotes_Misc; + pButton = pBtn_Autonotes_Misc; dword_506530 = v0; break; case 7: - v85 = pBtn_Autonotes_Instructors; + pButton = pBtn_Autonotes_Instructors; dword_50652C = v0; break; } v163 = v0; - v149 = v85; - v142 = (WindowType)92; + pButton2 = pButton; + pWindowType1 = (WindowType)92; LABEL_731: - v8 = v85->uY; - v9 = v85->uX; + v8 = pButton->uY; + v9 = pButton->uX; goto LABEL_732; case UIMSG_SelectCharacter: if ( pMessageQueue_50CBD0->uNumMessages ) @@ -3143,38 +2860,30 @@ v146 = pGlobalTXT_LocalizationStrings[489];// "You have %d total gold, %d in the Bank"" goto _sprintex_draw_status_and_continue; case UIMSG_ShowStatus_DateTime: - v195 = (NPCData *)pParty->uCurrentHour; + pNPCData4 = (NPCData *)pParty->uCurrentHour; if ( (signed int)pParty->uCurrentHour <= 12 ) { - if ( !v195 ) - v195 = (NPCData *)12; + if ( !pNPCData4 ) + pNPCData4 = (NPCData *)12; } else { - v195 = (NPCData *)((char *)v195 - 12); + pNPCData4 = (NPCData *)((char *)pNPCData4 - 12); } if ( pParty->uCurrentHour < 0xC || (uNumSeconds = v0, pParty->uCurrentHour >= 0x18) ) uNumSeconds = 0; - sprintf( - pTmpBuf, - "%d:%02d%s %s %d %s %d", - v195, - pParty->uCurrentMinute, - aAMPMNames[uNumSeconds], - aDayNames[pParty->uDaysPlayed % 7], - 7 * pParty->uCurrentMonthWeek + pParty->uDaysPlayed % 7 + 1, - aMonthNames[pParty->uCurrentMonth], - pParty->uCurrentYear); + sprintf(pTmpBuf, "%d:%02d%s %s %d %s %d", pNPCData4, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7], + 7 * pParty->uCurrentMonthWeek + pParty->uDaysPlayed % 7 + 1, aMonthNames[pParty->uCurrentMonth], pParty->uCurrentYear); goto _set_status_string_pTmpBuf_and_continue; case UIMSG_ShowStatus_Food: v173 = (char *)pParty->uNumFoodRations; v157 = pGlobalTXT_LocalizationStrings[501];// You have %lu food" goto _sprintex_2args_draw_status_and_continue; case UIMSG_ShowStatus_Player: - v106 = pPlayers[uMessageParam]; - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[429], v106->pName, pClassNames[v106->uClass]);// "%s the %s" + pPlayer5 = pPlayers[uMessageParam]; + sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[429], pPlayer5->pName, pClassNames[pPlayer5->uClass]);// "%s the %s" strcat(pTmpBuf, ": "); - v107 = v106->GetMajorConditionIdx(); + v107 = pPlayer5->GetMajorConditionIdx(); strcat(pTmpBuf, aCharacterConditionNames[v107]); sub_41C0B8_set_status_string(pTmpBuf); v108 = 8 * uMessageParam - 8; @@ -3235,17 +2944,17 @@ else { uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v209); - v117 = pMouse->GetCursorPos(&v204); - v116 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[v117->y]]; + pPoint3 = pMouse->GetCursorPos(&v204); + v116 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint3->y]]; } v163 = 0; - v149 = (GUIButton *)(unsigned __int16)v116; - v142 = (WindowType)15; + pButton2 = (GUIButton *)(unsigned __int16)v116; + pWindowType1 = (WindowType)15; goto LABEL_779; case 0x54: v163 = 0; - v149 = (GUIButton *)uMessageParam; - v142 = (WindowType)22; + pButton2 = (GUIButton *)uMessageParam; + pWindowType1 = (WindowType)22; LABEL_779: v8 = 0; v9 = 0; @@ -3253,7 +2962,7 @@ v137 = 0; v133 = 0; LABEL_733: - GUIWindow::Create(v9, v8, v133, v137, v142, (int)v149, v163); + GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163); goto _continue; case 0x194: if ( pMessageQueue_50CBD0->uNumMessages )