comparison mm7_4.cpp @ 44:916bec351934

22.10.12(pCurrentScreen)
author Ritor1
date Mon, 22 Oct 2012 17:28:15 +0600
parents 484492a6dd28
children 79a30ee1ecdb 6a62c4005f0e
comparison
equal deleted inserted replaced
43:484492a6dd28 44:916bec351934
4252 } 4252 }
4253 4253
4254 v51 = v65; 4254 v51 = v65;
4255 if ( v65 ) 4255 if ( v65 )
4256 goto LABEL_135; 4256 goto LABEL_135;
4257 if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions != 5 ) 4257 if ( pCurrentScreen != 5 )
4258 { 4258 {
4259 v52 = (signed int)&pPlayers[1]; 4259 v52 = (signed int)&pPlayers[1];
4260 while ( 1 ) 4260 while ( 1 )
4261 { 4261 {
4262 v53 = *(int *)v52; 4262 v53 = *(int *)v52;
4268 } 4268 }
4269 *(int *)(v53 + 16) = 0; 4269 *(int *)(v53 + 16) = 0;
4270 *(int *)(v53 + 20) = 0; 4270 *(int *)(v53 + 20) = 0;
4271 v51 = 1; 4271 v51 = 1;
4272 LABEL_135: 4272 LABEL_135:
4273 if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions != 5 4273 if ( pCurrentScreen != 5
4274 && (!v51 || dword_5C35C0) ) 4274 && (!v51 || dword_5C35C0) )
4275 uGameState = 8; 4275 uGameState = 8;
4276 } 4276 }
4277 if ( uActiveCharacter ) 4277 if ( uActiveCharacter )
4278 { 4278 {
4279 if ( uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions != 5 ) 4279 if ( pCurrentScreen != 5 )
4280 { 4280 {
4281 v54 = pPlayers[uActiveCharacter]; 4281 v54 = pPlayers[uActiveCharacter];
4282 if ( v54->pConditions[2] 4282 if ( v54->pConditions[2]
4283 || v54->pConditions[12] 4283 || v54->pConditions[12]
4284 || v54->pConditions[13] 4284 || v54->pConditions[13]
5474 uColor1 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xD1u, 0xBBu, 0x61u); 5474 uColor1 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xD1u, 0xBBu, 0x61u);
5475 uColorTeal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xF7u, 0xF7u); 5475 uColorTeal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xF7u, 0xF7u);
5476 uColorGreen = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0); 5476 uColorGreen = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0);
5477 uColorWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 5477 uColorWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
5478 pRenderer->BeginScene(); 5478 pRenderer->BeginScene();
5479 pRenderer->DrawTextureRGB(0, 0, &stru_506F20); 5479 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX);
5480 v0 = pTexture_MAKESKY; 5480 v0 = pTexture_MAKESKY;
5481 pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos, 2u, pTexture_MAKESKY); 5481 pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos, 2u, pTexture_MAKESKY);
5482 pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos++ - 640, 2u, v0); 5482 pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos++ - 640, 2u, v0);
5483 if ( (signed int)uPlayerCreationUI_SkySliderPos > 640 ) 5483 if ( (signed int)uPlayerCreationUI_SkySliderPos > 640 )
5484 uPlayerCreationUI_SkySliderPos = 0; 5484 uPlayerCreationUI_SkySliderPos = 0;
5625 } 5625 }
5626 uNumRace = pPlayer->GetRace(); 5626 uNumRace = pPlayer->GetRace();
5627 switch (uNumRace) 5627 switch (uNumRace)
5628 { 5628 {
5629 case 0: uRaceName = pGlobalTXT_LocalizationStrings[99]; break; // "Human" 5629 case 0: uRaceName = pGlobalTXT_LocalizationStrings[99]; break; // "Human"
5630 case 1: uRaceName = pGlobalTXT_LocalizationStrings[101]; break; // "Dwarf" 5630 case 1: uRaceName = pGlobalTXT_LocalizationStrings[103]; break; // "Dwarf"
5631 case 2: uRaceName = pGlobalTXT_LocalizationStrings[106]; break; // "Goblin" 5631 case 2: uRaceName = pGlobalTXT_LocalizationStrings[106]; break; // "Goblin"
5632 case 3: uRaceName = pGlobalTXT_LocalizationStrings[103]; break; // "Elf" 5632 case 3: uRaceName = pGlobalTXT_LocalizationStrings[101]; break; // "Elf"
5633 }; 5633 };
5634 strcpy(pTmpBuf, uRaceName); 5634 strcpy(pTmpBuf, uRaceName);
5635 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, v134 + 72, v128 + 12, 0, pTmpBuf, 130, 0); 5635 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, v134 + 72, v128 + 12, 0, pTmpBuf, 130, 0);
5636 v21 = uColor1; 5636 v21 = uColor1;
5637 v22 = pFontCreate->AlignText_Center(0x96u, Str1); 5637 v22 = pFontCreate->AlignText_Center(0x96u, Str1);
5804 strcpy(Str1, pSkillNames[v102]); 5804 strcpy(Str1, pSkillNames[v102]);
5805 v103 = strlen(Str1); 5805 v103 = strlen(Str1);
5806 v104 = 0; 5806 v104 = 0;
5807 if ( (signed int)v103 > 0 ) 5807 if ( (signed int)v103 > 0 )
5808 { 5808 {
5809 while ( Str1[v104] != 32 ) 5809 if ( Str1[v104] == 32 )
5810 { 5810 {
5811 ++v104; 5811 Str1[v104] = 0;
5812 if ( v104 >= (signed int)v103 ) 5812 }
5813 goto LABEL_77; 5813 else
5814 } 5814 {
5815 Str1[v104] = 0; 5815 while ( Str1[v104] != 32 )
5816 } 5816 {
5817 LABEL_77: 5817 ++v104;
5818 if ( v104 >= (signed int)v103 )
5819 break;
5820 }
5821 }
5822 }
5818 uColorGreen = -5; 5823 uColorGreen = -5;
5819 if ( (signed int)v124 <= 3 ) 5824 if ( (signed int)v124 <= 3 )
5820 uColorGreen = 0; 5825 uColorGreen = 0;
5821 v105 = uColorTeal; 5826 v105 = uColorTeal;
5822 if ( !pParty->pPlayers[0].pActiveSkills[v102 + 3486 * uPlayerCreationUI_SelectedCharacter] ) 5827 if ( !pParty->pPlayers[0].pActiveSkills[v102 + 3486 * uPlayerCreationUI_SelectedCharacter] )
5845 v114 = uColorWhite; 5850 v114 = uColorWhite;
5846 v115 = pFontCreate->AlignText_Center(84u, pTmpBuf); 5851 v115 = pFontCreate->AlignText_Center(84u, pTmpBuf);
5847 pGUIWindow_CurrentMenu->DrawText(pFontCreate, v115 + 530, 410, v114, pTmpBuf, 0, 0, 0); 5852 pGUIWindow_CurrentMenu->DrawText(pFontCreate, v115 + 530, 410, v114, pTmpBuf, 0, 0, 0);
5848 if ( GameUI_StatusBar_TimedStringTimeLeft > GetTickCount() ) 5853 if ( GameUI_StatusBar_TimedStringTimeLeft > GetTickCount() )
5849 { 5854 {
5850 pWindow.str_48 = pGlobalTXT_LocalizationStrings[412];// "Create Party cannot be completed unless you have assigned all characters 2 extra skills and have spent all of your bonus points." 5855 pWindow.Hint = pGlobalTXT_LocalizationStrings[412];// "Create Party cannot be completed unless you have assigned all characters 2 extra skills and have spent all of your bonus points."
5851 if ( v113 < 0 ) 5856 if ( v113 < 0 )
5852 pWindow.str_48 = pGlobalTXT_LocalizationStrings[413];// "You can't spend more than 50 points." 5857 pWindow.Hint = pGlobalTXT_LocalizationStrings[413];// "You can't spend more than 50 points."
5853 pWindow.uFrameWidth = 300; 5858 pWindow.uFrameWidth = 300;
5854 pWindow.uFrameHeight = 100; 5859 pWindow.uFrameHeight = 100;
5855 pWindow.uFrameX = 170; 5860 pWindow.uFrameX = 170;
5856 pWindow.uFrameY = 140; 5861 pWindow.uFrameY = 140;
5857 pWindow.uFrameZ = 469; 5862 pWindow.uFrameZ = 469;
5858 pWindow.uFrameW = 239; 5863 pWindow.uFrameW = 239;
5859 pWindow._415551(0); 5864 pWindow.DrawMessageBox(0);
5860 } 5865 }
5861 pRenderer->EndScene(); 5866 pRenderer->EndScene();
5862 } 5867 }
5863 5868
5864 //----- (0049695A) -------------------------------------------------------- 5869 //----- (0049695A) --------------------------------------------------------
5884 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; 5889 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
5885 pAudioPlayer->SetMusicVolume((signed __int64)(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0)); 5890 pAudioPlayer->SetMusicVolume((signed __int64)(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0));
5886 ++pIcons_LOD->uTexturePacksCount; 5891 ++pIcons_LOD->uTexturePacksCount;
5887 if ( !pIcons_LOD->uNumPrevLoadedFiles ) 5892 if ( !pIcons_LOD->uNumPrevLoadedFiles )
5888 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; 5893 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
5889 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 21; 5894 pCurrentScreen = 21;
5890 uPlayerCreationUI_ArrowAnim = 0; 5895 uPlayerCreationUI_ArrowAnim = 0;
5891 uPlayerCreationUI_SkySliderPos = 0; 5896 uPlayerCreationUI_SkySliderPos = 0;
5892 uPlayerCreationUI_SelectedCharacter = 0; 5897 uPlayerCreationUI_SelectedCharacter = 0;
5893 v0 = LOBYTE(pFontCreate->uFontHeight) - 2; 5898 v0 = LOBYTE(pFontCreate->uFontHeight) - 2;
5894 pTexture_IC_KNIGHT[0] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_KNIGHT", TEXTURE_16BIT_PALETTE)]; 5899 pTexture_IC_KNIGHT[0] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("IC_KNIGHT", TEXTURE_16BIT_PALETTE)];
6359 nullstring, 6364 nullstring,
6360 pTexture_buttplus, 6365 pTexture_buttplus,
6361 0); 6366 0);
6362 pFontCChar = LoadFont("cchar.fnt", "FONTPAL", 0); 6367 pFontCChar = LoadFont("cchar.fnt", "FONTPAL", 0);
6363 } 6368 }
6364 // 4E28F8: using guessed type int uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions; 6369 // 4E28F8: using guessed type int pCurrentScreen;
6365 6370
6366 //----- (0049750E) -------------------------------------------------------- 6371 //----- (0049750E) --------------------------------------------------------
6367 void __cdecl DeleteCCharFont() 6372 void __cdecl DeleteCCharFont()
6368 { 6373 {
6369 pAllocator->FreeChunk(pFontCChar); 6374 pAllocator->FreeChunk(pFontCChar);
6399 MSG Msg; // [sp+50h] [bp-30h]@17 6404 MSG Msg; // [sp+50h] [bp-30h]@17
6400 POINT v25; // [sp+6Ch] [bp-14h]@6 6405 POINT v25; // [sp+6Ch] [bp-14h]@6
6401 bool v26; // [sp+74h] [bp-Ch]@1 6406 bool v26; // [sp+74h] [bp-Ch]@1
6402 POINT v24; // [sp+78h] [bp-8h]@6 6407 POINT v24; // [sp+78h] [bp-8h]@6
6403 6408
6404 v0 = &stru_506F20; 6409 v0 = &pTexture_PCX;
6405 v1 = 0; 6410 v1 = 0;
6406 v26 = 0; 6411 v26 = 0;
6407 stru_506F20.Release(); 6412 pTexture_PCX.Release();
6408 stru_506F20.Load("makeme.pcx", 0); 6413 pTexture_PCX.Load("makeme.pcx", 0);
6409 if (pAsyncMouse) 6414 if (pAsyncMouse)
6410 pAsyncMouse->Resume(); 6415 pAsyncMouse->Resume();
6411 v2 = 6; 6416 v2 = 6;
6412 pGUIWindow_CurrentMenu->field_40 = 0; 6417 pGUIWindow_CurrentMenu->field_40 = 0;
6413 LABEL_27: 6418 LABEL_27:
6422 if ( v5 != (GUIButton *)v1 ) 6427 if ( v5 != (GUIButton *)v1 )
6423 { 6428 {
6424 v6 = pMessageQueue_50CBD0->uNumMessages; 6429 v6 = pMessageQueue_50CBD0->uNumMessages;
6425 do 6430 do
6426 { 6431 {
6427 if ( uMouseX >= (signed int)v5->uX 6432 if ( uMouseX >= (signed int)v5->uX //mouse movement
6428 && uMouseX <= (signed int)v5->uZ 6433 && uMouseX <= (signed int)v5->uZ
6429 && uMouseY >= (signed int)v5->uY 6434 && uMouseY >= (signed int)v5->uY
6430 && uMouseY <= (signed int)v5->uW ) 6435 && uMouseY <= (signed int)v5->uW )
6431 { 6436 {
6432 v7 = v5->uControlParam; 6437 v7 = v5->uControlParam;
6433 if ( (signed int)v6 < 40 ) 6438 if ( (signed int)v6 < 40 )
6434 { 6439 {
6435 pMessageQueue_50CBD0->pMessages[v6].eType = (UIMessageType)v5->field_1C; 6440 pMessageQueue_50CBD0->pMessages[v6].eType = (UIMessageType)v5->field_1C;
6436 v0 = &stru_506F20; 6441 v0 = &pTexture_PCX;
6437 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v7; 6442 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v7;
6438 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; 6443 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
6439 v6 = pMessageQueue_50CBD0->uNumMessages + 1; 6444 v6 = pMessageQueue_50CBD0->uNumMessages + 1;
6440 ++pMessageQueue_50CBD0->uNumMessages; 6445 ++pMessageQueue_50CBD0->uNumMessages;
6441 } 6446 }
6761 v21.pPixels, 6766 v21.pPixels,
6762 (signed __int16)v21.uWidth); 6767 (signed __int16)v21.uWidth);
6763 free(pString); 6768 free(pString);
6764 pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, (int)ptr); 6769 pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, (int)ptr);
6765 pWindow_MainMenu->CreateButton(0, 0, 0, 0, 1, 0, 0x71u, 0, 0x1Bu, nullstring, 0); 6770 pWindow_MainMenu->CreateButton(0, 0, 0, 0, 1, 0, 0x71u, 0, 0x1Bu, nullstring, 0);
6766 uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 9; 6771 pCurrentScreen = 9;
6767 SetCurrentMenuID(MENU_Credits); 6772 SetCurrentMenuID(MENU_Credits);
6768 pRenderer->BeginScene(); 6773 pRenderer->BeginScene();
6769 pRenderer->DrawTextureRGB(0, 0, &v16); 6774 pRenderer->DrawTextureRGB(0, 0, &v16);
6770 pRenderer->Clip(a2, a3, a2 + v20, a3 + a4); 6775 pRenderer->Clip(a2, a3, a2 + v20, a3 + a4);
6771 pRenderer->_4A5D33(a2, a3, 0, 0, &v21); 6776 pRenderer->_4A5D33(a2, a3, 0, 0, &v21);
9702 sprintfex(pTmpBuf, "%s%03d", spellbook_texture_filename_suffices[v11 / 4], v2); 9707 sprintfex(pTmpBuf, "%s%03d", spellbook_texture_filename_suffices[v11 / 4], v2);
9703 if ( pMouse->GetCursorPos(&a2)->y <= 320 ) 9708 if ( pMouse->GetCursorPos(&a2)->y <= 320 )
9704 v3 = pMouse->GetCursorPos(&a2)->y + 30; 9709 v3 = pMouse->GetCursorPos(&a2)->y + 30;
9705 else 9710 else
9706 v3 = 30; 9711 v3 = 30;
9707 a1.str_48 = 0; 9712 a1.Hint = 0;
9708 a1.uFrameY = v3; 9713 a1.uFrameY = v3;
9709 a1.uFrameWidth = 328; 9714 a1.uFrameWidth = 328;
9710 a1.uFrameHeight = 68; 9715 a1.uFrameHeight = 68;
9711 a1.uFrameX = 90; 9716 a1.uFrameX = 90;
9712 a1.uFrameZ = 417; 9717 a1.uFrameZ = 417;
9745 v6 = pFontSmallnum->CalcTextHeight(pTmpBuf2, &a1, 0, 0); 9750 v6 = pFontSmallnum->CalcTextHeight(pTmpBuf2, &a1, 0, 0);
9746 a1.uFrameHeight += v6; 9751 a1.uFrameHeight += v6;
9747 if ( (signed int)a1.uFrameHeight < 150 ) 9752 if ( (signed int)a1.uFrameHeight < 150 )
9748 a1.uFrameHeight = 150; 9753 a1.uFrameHeight = 150;
9749 a1.uFrameWidth = 460; 9754 a1.uFrameWidth = 460;
9750 a1._415551(0); 9755 a1.DrawMessageBox(0);
9751 a1.uFrameWidth -= 12; 9756 a1.uFrameWidth -= 12;
9752 a1.uFrameHeight -= 12; 9757 a1.uFrameHeight -= 12;
9753 v7 = pSpellStats->pInfos[v1].pName; 9758 v7 = pSpellStats->pInfos[v1].pName;
9754 a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1; 9759 a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1;
9755 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1; 9760 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1;