comparison mm7_4.cpp @ 169:d1dde383af89

Merge
author Nomad
date Thu, 14 Feb 2013 14:03:17 +0200
parents ee11772d0ad2 90521fb9766c
children 91fa025e6ca6
comparison
equal deleted inserted replaced
168:ee11772d0ad2 169:d1dde383af89
3057 if (pParty->pHirelings[1].pName) 3057 if (pParty->pHirelings[1].pName)
3058 pTmpBuf[v22++] = 1; 3058 pTmpBuf[v22++] = 1;
3059 3059
3060 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i) 3060 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i)
3061 { 3061 {
3062 if (pNPCStats->pNewNPCData[i].uFlags & 0x80) 3062 if (pNPCStats->pNewNPCData[i].uFlags == 128)
3063 { 3063 {
3064 if (!pParty->pHirelings[0].pName || strcmp(pNPCStats->pNewNPCData[i].pName, pParty->pHirelings[0].pName)) 3064 if (!pParty->pHirelings[0].pName || strcmp(pNPCStats->pNewNPCData[i].pName, pParty->pHirelings[0].pName))
3065 { 3065 {
3066 if (!pParty->pHirelings[1].pName || strcmp(pNPCStats->pNewNPCData[i].pName, pParty->pHirelings[1].pName)) 3066 if (!pParty->pHirelings[1].pName || strcmp(pNPCStats->pNewNPCData[i].pName, pParty->pHirelings[1].pName))
3067 pTmpBuf[v22++] = i + 2; 3067 pTmpBuf[v22++] = i + 2;
4176 } 4176 }
4177 4177
4178 v51 = v65; 4178 v51 = v65;
4179 if ( v65 ) 4179 if ( v65 )
4180 goto LABEL_135; 4180 goto LABEL_135;
4181 if ( pCurrentScreen != 5 ) 4181 if ( pCurrentScreen != SCREEN_REST )
4182 { 4182 {
4183 v52 = (signed int)&pPlayers[1]; 4183 v52 = (signed int)&pPlayers[1];
4184 while ( 1 ) 4184 while ( 1 )
4185 { 4185 {
4186 v53 = *(int *)v52; 4186 v53 = *(int *)v52;
4192 } 4192 }
4193 *(int *)(v53 + 16) = 0; 4193 *(int *)(v53 + 16) = 0;
4194 *(int *)(v53 + 20) = 0; 4194 *(int *)(v53 + 20) = 0;
4195 v51 = 1; 4195 v51 = 1;
4196 LABEL_135: 4196 LABEL_135:
4197 if ( pCurrentScreen != 5 4197 if ( pCurrentScreen != SCREEN_REST
4198 && (!v51 || dword_5C35C0) ) 4198 && (!v51 || dword_5C35C0) )
4199 uGameState = 8; 4199 uGameState = 8;
4200 } 4200 }
4201 if ( uActiveCharacter ) 4201 if ( uActiveCharacter )
4202 { 4202 {
4203 if ( pCurrentScreen != 5 ) 4203 if ( pCurrentScreen != SCREEN_REST )
4204 { 4204 {
4205 v54 = pPlayers[uActiveCharacter]; 4205 v54 = pPlayers[uActiveCharacter];
4206 if ( v54->pConditions[2] 4206 if ( v54->pConditions[2]
4207 || v54->pConditions[12] 4207 || v54->pConditions[12]
4208 || v54->pConditions[13] 4208 || v54->pConditions[13]
5448 { 5448 {
5449 if ( v14 == 1 ) 5449 if ( v14 == 1 )
5450 { 5450 {
5451 pGUIWindow_CurrentMenu->field_40 = 0; 5451 pGUIWindow_CurrentMenu->field_40 = 0;
5452 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 124, 0, player->pName, 130, 0); 5452 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 124, 0, player->pName, 130, 0);
5453 SetCurrentMenuID(MENU_7); 5453 SetCurrentMenuID(MENU_NAMEPANELESC);
5454 } 5454 }
5455 } 5455 }
5456 else 5456 else
5457 { 5457 {
5458 pGUIWindow_CurrentMenu->field_40 = 0; 5458 pGUIWindow_CurrentMenu->field_40 = 0;
5703 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 5703 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
5704 pAudioPlayer->SetMusicVolume((pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0)); 5704 pAudioPlayer->SetMusicVolume((pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0));
5705 ++pIcons_LOD->uTexturePacksCount; 5705 ++pIcons_LOD->uTexturePacksCount;
5706 if ( !pIcons_LOD->uNumPrevLoadedFiles ) 5706 if ( !pIcons_LOD->uNumPrevLoadedFiles )
5707 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; 5707 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
5708 pCurrentScreen = 21;//окно Создания группы 5708 pCurrentScreen = SCREEN_PARTY_CREATION;
5709 uPlayerCreationUI_ArrowAnim = 0; 5709 uPlayerCreationUI_ArrowAnim = 0;
5710 uPlayerCreationUI_SkySliderPos = 0; 5710 uPlayerCreationUI_SkySliderPos = 0;
5711 uPlayerCreationUI_SelectedCharacter = 0; 5711 uPlayerCreationUI_SelectedCharacter = 0;
5712 v0 = LOBYTE(pFontCreate->uFontHeight) - 2; 5712 v0 = LOBYTE(pFontCreate->uFontHeight) - 2;
5713 pTexture_IC_KNIGHT[0] = pIcons_LOD->LoadTexturePtr("IC_KNIGHT", TEXTURE_16BIT_PALETTE); 5713 pTexture_IC_KNIGHT[0] = pIcons_LOD->LoadTexturePtr("IC_KNIGHT", TEXTURE_16BIT_PALETTE);
6205 pFontQuick->_44D2FD_prolly_draw_credits_entry(pFontCChar, 0, a4, (signed __int16)pTexture2.uWidth, (signed __int16)pTexture2.uHeight, pColor1, 6205 pFontQuick->_44D2FD_prolly_draw_credits_entry(pFontCChar, 0, a4, (signed __int16)pTexture2.uWidth, (signed __int16)pTexture2.uHeight, pColor1,
6206 pColor2, pString, pTexture2.pPixels, (signed __int16)pTexture2.uWidth); 6206 pColor2, pString, pTexture2.pPixels, (signed __int16)pTexture2.uWidth);
6207 free(pString); 6207 free(pString);
6208 pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, (int)ptr); 6208 pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, (int)ptr);
6209 pWindow_MainMenu->CreateButton(0, 0, 0, 0, 1, 0, 0x71u, 0, 0x1Bu, "", 0); 6209 pWindow_MainMenu->CreateButton(0, 0, 0, 0, 1, 0, 0x71u, 0, 0x1Bu, "", 0);
6210 pCurrentScreen = 9; // окно Credits 6210 pCurrentScreen = SCREEN_CREATORS;
6211 SetCurrentMenuID(MENU_Credits); 6211 SetCurrentMenuID(MENU_CREDITSPROC);
6212 do 6212 do
6213 { 6213 {
6214 while ( PeekMessageA(&Msg, 0, 0, 0, 1) ) 6214 while ( PeekMessageA(&Msg, 0, 0, 0, 1) )
6215 { 6215 {
6216 if ( Msg.message == 18 ) 6216 if ( Msg.message == 18 )
6234 pRenderer->EndScene(); 6234 pRenderer->EndScene();
6235 ++a5; 6235 ++a5;
6236 if ( a5 >= (signed __int16)pTexture2.uHeight ) 6236 if ( a5 >= (signed __int16)pTexture2.uHeight )
6237 SetCurrentMenuID(MENU_MAIN); 6237 SetCurrentMenuID(MENU_MAIN);
6238 pRenderer->Present(); 6238 pRenderer->Present();
6239 pCurrentScreen = 0;//Ritor1: temporarily, must be corrected GUI_MainMenuMessageProc() 6239 pCurrentScreen = SCREEN_GAME;//Ritor1: temporarily, must be corrected GUI_MainMenuMessageProc()
6240 GUI_MainMenuMessageProc(); 6240 GUI_MainMenuMessageProc();
6241 } 6241 }
6242 } 6242 }
6243 while ( GetCurrentMenuID() == MENU_Credits ); 6243 while ( GetCurrentMenuID() == MENU_CREDITSPROC );
6244 pAudioPlayer->_4AA258(1); 6244 pAudioPlayer->_4AA258(1);
6245 pAllocator->FreeChunk(ptr); 6245 pAllocator->FreeChunk(ptr);
6246 pAllocator->FreeChunk(pFontQuick); 6246 pAllocator->FreeChunk(pFontQuick);
6247 pAllocator->FreeChunk(pFontCChar); 6247 pAllocator->FreeChunk(pFontCChar);
6248 pWindow_MainMenu->Release(); 6248 pWindow_MainMenu->Release();
9668 v19 = pGlobalTXT_LocalizationStrings[155]; 9668 v19 = pGlobalTXT_LocalizationStrings[155];
9669 goto LABEL_77; 9669 goto LABEL_77;
9670 } 9670 }
9671 Party::TakeGold(v21); 9671 Party::TakeGold(v21);
9672 } 9672 }
9673 LOBYTE(v2->uFlags) |= 0x80u; 9673 //LOBYTE(v2->uFlags) |= 0x80u;
9674 v2->uFlags = 128;
9674 pParty->field_709 = 0; 9675 pParty->field_709 = 0;
9675 sub_44A56A(); 9676 sub_44A56A();
9676 if ( pParty->pHirelings[0].pName ) 9677 if ( pParty->pHirelings[0].pName )
9677 { 9678 {
9678 memcpy(&pParty->pHirelings[1], v2, sizeof(pParty->pHirelings[1])); 9679 memcpy(&pParty->pHirelings[1], v2, sizeof(pParty->pHirelings[1]));
11079 //----- (004B3E1E) -------------------------------------------------------- 11080 //----- (004B3E1E) --------------------------------------------------------
11080 void __cdecl sub_4B3E1E() 11081 void __cdecl sub_4B3E1E()
11081 { 11082 {
11082 NPCData *v0; // ST40_4@1 11083 NPCData *v0; // ST40_4@1
11083 signed int v1; // edi@1 11084 signed int v1; // edi@1
11084 GUIWindow *v2; // ecx@1 11085 //GUIWindow *v2; // ecx@1
11085 11086
11087 __debugbreak();
11086 v0 = GetNPCData(uDialogue_SpeakingActorNPC_ID); 11088 v0 = GetNPCData(uDialogue_SpeakingActorNPC_ID);
11087 v1 = 0; 11089 v1 = 0;
11088 pDialogueWindow->eWindowType = WINDOW_MainMenu; 11090 pDialogueWindow->eWindowType = WINDOW_MainMenu;
11089 pDialogueWindow->Release(); 11091 pDialogueWindow->Release();
11090 v2 = GUIWindow::Create(0, 0, 640, 480, WINDOW_A, 1, 0); 11092 pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Dialogue, 1, 0);
11091 pDialogueWindow = v2;
11092 if ( *(&pNPCStats->field_13A5C + 5 * v0->uProfession) ) 11093 if ( *(&pNPCStats->field_13A5C + 5 * v0->uProfession) )
11093 { 11094 {
11094 v2->CreateButton( 11095 pDialogueWindow->CreateButton(480, 160, 140, 28, 1, 0, 136, 77, 0, pGlobalTXT_LocalizationStrings[407], 0);
11095 0x1E0u,
11096 0xA0u,
11097 0x8Cu,
11098 0x1Eu,
11099 1,
11100 0,
11101 0x88u,
11102 0x4Du,
11103 0,
11104 pGlobalTXT_LocalizationStrings[407],
11105 0);
11106 v1 = 1; 11096 v1 = 1;
11107 } 11097 }
11108 pDialogueWindow->CreateButton( 11098 pDialogueWindow->CreateButton(480, 30 * v1 + 160, 140, 30, 1, 0, 136, 76, 0, pGlobalTXT_LocalizationStrings[406], 0);//Нанять
11109 0x1E0u,
11110 30 * v1 + 160,
11111 0x8Cu,
11112 0x1Eu,
11113 1,
11114 0,
11115 0x88u,
11116 0x4Cu,
11117 0,
11118 pGlobalTXT_LocalizationStrings[406],
11119 0);
11120 pDialogueWindow->_41D08F(v1 + 1, 1, 0, 1); 11099 pDialogueWindow->_41D08F(v1 + 1, 1, 0, 1);
11121 } 11100 }
11122 11101
11123 //----- (004B3EF0) -------------------------------------------------------- 11102 //----- (004B3EF0) --------------------------------------------------------
11124 void __fastcall sub_4B3EF0(int a4) 11103 void __fastcall sub_4B3EF0(int a4)
11308 0x59u, 11287 0x59u,
11309 byte_591098, 11288 byte_591098,
11310 (Texture *)(uTextureID_BUTTYES2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTYES2] : 0), 11289 (Texture *)(uTextureID_BUTTYES2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BUTTYES2] : 0),
11311 0); 11290 0);
11312 pDialogueWindow->CreateButton( 11291 pDialogueWindow->CreateButton(
11313 _4E5E50_transui_x, 11292 pNPCPortraits_x,
11314 _4E5EE0_transui_y, 11293 pNPCPortraits_y,
11315 63u, 11294 63u,
11316 73u, 11295 73u,
11317 1, 11296 1,
11318 0, 11297 0,
11319 0xBFu, 11298 0xBFu,