Mercurial > might-and-magic-trilogy
diff mm7_4.cpp @ 2:2ca04ccb612a
NoCD, main menu, various
author | Nomad |
---|---|
date | Wed, 10 Oct 2012 14:21:15 +0200 |
parents | ac0fb48cd27a |
children | 540178ef9b18 |
line wrap: on
line diff
--- a/mm7_4.cpp Tue Oct 09 13:09:08 2012 +0200 +++ b/mm7_4.cpp Wed Oct 10 14:21:15 2012 +0200 @@ -5139,7 +5139,7 @@ } else { - v11 = (char *)dword_721824; + v11 = (char *)pNPCTopics[55].pText; } pPlayer = v61; v13 = a3; @@ -6000,7 +6000,7 @@ pTextures_arrowr[v4] = &pIcons_LOD->pTextures[v3]; } while ( uControlParam < 20 ); - pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Credits, 0, 0); + pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); uControlParama = 0; uXa = 8; do @@ -6478,7 +6478,7 @@ v26 = 0; stru_506F20.Release(); stru_506F20.Load("makeme.pcx", 0); - if ( pAsyncMouse ) + if (pAsyncMouse) pAsyncMouse->Resume(); v2 = 6; pGUIWindow_CurrentMenu->field_40 = 0; @@ -6714,7 +6714,7 @@ } while ( (signed int)v10 < (signed int)((char *)&pParty->field_871C[455] + 2) ); pAudioPlayer->StopChannels(-1, -1); - if ( pAsyncMouse ) + if (pAsyncMouse) pAsyncMouse->Suspend(); return v26; } @@ -6832,7 +6832,7 @@ v21.pPixels, (signed __int16)v21.uWidth); free(pString); - pWindow_Credits = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Credits, 0, (int)ptr); + pWindow_Credits = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, (int)ptr); pWindow_Credits->CreateButton(0, 0, 0, 0, 1, 0, 0x71u, 0, 0x1Bu, nullstring, 0); uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 9; SetCurrentMenuID(8u); @@ -6862,7 +6862,7 @@ } else { - if ( pAsyncMouse ) + if (pAsyncMouse) pAsyncMouse->_46B736_consume_click_lists(1); if ( dword_A74C88 ) { @@ -10110,7 +10110,7 @@ dword_F8B1A8 = 0; v11 = 0; uDialogueType = 84; - ptr_F8B1E8 = (char *)dword_722B44; + ptr_F8B1E8 = (char *)pNPCTopics[667].pText; v0 = _4F0882_evt_VAR_PlayerItemInHands_vals; while ( 1 ) { @@ -10135,7 +10135,7 @@ if ( (signed int)v0 >= (signed int)((char *)dword_4F08EC + 2) ) goto LABEL_10; } - ptr_F8B1E8 = (char *)dword_722B3C; + ptr_F8B1E8 = (char *)pNPCTopics[666].pText; v4 = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11]; dword_F8B1A8 = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11]; pParty->pPlayers[0].AddVariable(VAR_PlayerItemInHands, v4); @@ -10231,7 +10231,7 @@ if ( a1 == 13 ) { ptr_F8B1E8 = (char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession); - ptr_F8B1E8 = sub_495461(ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0); + ptr_F8B1E8 = sub_495461((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0); sub_4B40E6(); byte_F8B1EC = 0; goto _return; @@ -10432,7 +10432,7 @@ byte_F8B1EC = 0; uDialogueType = 13; ptr_F8B1E8 = (char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession); - ptr_F8B1E8 = sub_495461(ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0); + ptr_F8B1E8 = sub_495461((char *)ptr_F8B1E8, uActiveCharacter - 1, 0, 0, 0, 0); if ( uActiveCharacter ) pPlayers[uActiveCharacter]->PlaySound(38, 0); v19 = pGlobalTXT_LocalizationStrings[155]; @@ -10477,13 +10477,7 @@ _return: pVideoPlayer->_4BF5B2(); } -// 591080: using guessed type int dword_591080; -// F8B19C: using guessed type int dword_F8B19C; -// F8B1A8: using guessed type int dword_F8B1A8; -// F8B1B0: using guessed type int dword_F8B1B0; -// F8B1B4: using guessed type int dword_F8B1B4; -// F8B1D8: using guessed type int dword_F8B1D8; -// F8B1EC: using guessed type char byte_F8B1EC; + //----- (004B254D) -------------------------------------------------------- char *__thiscall _4B254D_SkillMasteryTeacher(int _this) @@ -10528,7 +10522,7 @@ v2 = (_this - 200) % 3; v3 = (_this - 200) / 3; v4 = v2; - v35 = (char *)dword_721A64; + v35 = (char *)pNPCTopics[127].pText; dword_F8B1AC_something_todo_with_awards = v3; if ( v2 ) { @@ -10613,12 +10607,12 @@ return pTmpBuf; } if ( !v1->CanAct() ) - return _721A3C_npc_text; + return (char *)pNPCTopics[122].pText; if ( !v7 ) - return (char *)_721A84_npc_text; + return (char *)pNPCTopics[131].pText; v16 = SkillToMastery(a1[0]); if ( (signed int)v16 > v4 + 1 ) - return (char *)_721A6C_npc_text[2 * v4]; + return (char *)pNPCTopics[v4 + 128].pText; if ( v34 != 2 ) { if ( v34 == 3 ) @@ -10785,7 +10779,7 @@ dword_F8B1B4 = 1000; LABEL_42: if ( dword_F8B1B4 > pParty->uNumGold ) - return (char *)dword_721A4C; + return (char *)pNPCTopics[124].pText; LABEL_79: dword_F8B1A8 = 1; if ( v34 == 2 ) @@ -10816,13 +10810,12 @@ //----- (004B29F2) -------------------------------------------------------- -int __fastcall sub_4B29F2(int a1) +const char *__fastcall sub_4B29F2(int a1) { int v1; // esi@1 Player *v2; // edi@1 int v3; // eax@1 Player *v4; // ecx@1 - int result; // eax@2 v1 = a1; dword_F8B1A8 = 0; @@ -10835,26 +10828,25 @@ { if ( (unsigned __int16)_449B57_test_bit((unsigned __int8 *)v2->field_152, dword_F8B1AC_something_todo_with_awards) ) { - result = dword_721A44; + return pNPCTopics[123].pText; } else { if ( dword_F8B1B4 <= pParty->uNumGold ) { - result = dword_7219DC[2 * v1]; dword_F8B1A8 = 1; + return pNPCTopics[v1 + 110].pText; } else { - result = dword_721A4C; - } - } - } - else - { - result = (int)_721A3C_npc_text; - } - return result; + return pNPCTopics[124].pText; + } + } + } + else + { + return pNPCTopics[122].pText; + } } @@ -11863,9 +11855,9 @@ v0 = GetNPCData(uDialogue_SpeakingActorNPC_ID); v1 = 0; - pDialogueWindow->uWindowType = 1; + pDialogueWindow->eWindowType = WINDOW_MainMenu; pDialogueWindow->Release(); - v2 = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, (enum WindowType)10, 1, 0); + v2 = GUIWindow::Create(0, 0, 640, 480, WINDOW_A, 1, 0); pDialogueWindow = v2; if ( *(&pNPCStats->field_13A5C + 5 * v0->uProfession) ) { @@ -11905,22 +11897,22 @@ v1 = a4; uDialogueType = 81; - ptr_F8B1E8 = (char *)dword_721984[2 * a4]; + ptr_F8B1E8 = (char *)pNPCTopics[a4 + 99].pText; sub_4B29F2(a4); pDialogueWindow->Release(); - pDialogueWindow = GUIWindow::Create(0, 0, 0x280u, 0x15Eu, WINDOW_Credits, v1, 0); + pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15E, WINDOW_MainMenu, v1, 0); ptr_5076F4 = pDialogueWindow->CreateButton( - 0x1D7u, - 0x1BDu, - 0xA9u, - 0x23u, + 0x1D7, + 0x1BD, + 0xA9, + 0x23, 1, 0, - 0x71u, + 0x71, 0, 0, pGlobalTXT_LocalizationStrings[34], - (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0), + (Texture *)(uTextureID_506438 != -1 ? &pIcons_LOD->pTextures[uTextureID_506438] : 0), 0); pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, 0x51u, 0, 0, nullstring, 0); pDialogueWindow->CreateButton( @@ -11948,10 +11940,10 @@ v1 = a4; uDialogueType = 78; - ptr_F8B1E8 = (char *)dword_721BAC[2 * a4]; + ptr_F8B1E8 = (char *)pNPCTopics[a4 + 168].pText; _4B254D_SkillMasteryTeacher(a4); pDialogueWindow->Release(); - pDialogueWindow = GUIWindow::Create(0, 0, 0x280u, 0x15Eu, WINDOW_Credits, v1, 0); + pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, v1, 0); v2 = nullstring; ptr_5076F4 = pDialogueWindow->CreateButton( 0x1D7u, @@ -11985,7 +11977,7 @@ v0 = 0; v1 = array_5913D8[(unsigned int)((char *)array_5913D8[6] + -(dword_591080 != 0) - 1)]; pDialogueWindow->Release(); - pDialogueWindow = GUIWindow::Create(0, 0, 0x280u, 0x15Eu, WINDOW_Credits, 0, 0); + pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, 0, 0); ptr_5076F4 = pDialogueWindow->CreateButton( 0x1D7u, 0x1BDu, @@ -12059,7 +12051,7 @@ if ( _this + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic ) { pDialogueWindow->Release(); - pDialogueWindow = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, WINDOW_Credits, 0, 0); + pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); sprintfex(byte_591098, pGlobalTXT_LocalizationStrings[411], pMapStats->pInfos[uHouse_ExitPic].pName); ptr_5076F4 = pDialogueWindow->CreateButton( 0x236u, @@ -12114,7 +12106,7 @@ GUIButton::_41D0D8((GUIButton *)array_5913D8[i + 7]); } v4 = 1; - pDialogueWindow = GUIWindow::Create(0, 0, 0x280u, 0x159u, WINDOW_Credits, 0, 0); + pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0); ptr_5076F4 = pDialogueWindow->CreateButton( 471u, 445u, @@ -12518,9 +12510,9 @@ } if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) { - v31 = _721A3C_npc_text; + v31 = pNPCTopics[122].pText; v32 = v71; - v33 = pFontArrus->CalcTextHeight(_721A3C_npc_text, &v65, 0, 0); + v33 = pFontArrus->CalcTextHeight(pNPCTopics[122].pText, &v65, 0, 0); v65.DrawText2(pFontArrus, 0, (212 - v33) / 2 + 101, v32, v31, 3u); result = (int)pDialogueWindow; pDialogueWindow->field_28 = 0; @@ -13915,9 +13907,9 @@ (unsigned __int8 *)v1->field_152, word_4F0704[2 * (unsigned int)ptr_507BC0->ptr_1C]) ) { - v36 = dword_721A34; + v36 = pNPCTopics[121].pText; v37 = v57; - v38 = pFontArrus->CalcTextHeight(dword_721A34, &v52, 0, 0); + v38 = pFontArrus->CalcTextHeight(pNPCTopics[121].pText, &v52, 0, 0); v52.DrawText2(pFontArrus, 0, (212 - v38) / 2 + 101, v37, v36, 3u); result = (int)pDialogueWindow; pDialogueWindow->field_28 = 0; @@ -14612,9 +14604,9 @@ (unsigned __int8 *)v1->field_152, word_4F0754[2 * (unsigned int)ptr_507BC0->ptr_1C]) ) { - v24 = dword_721BC4; + v24 = pNPCTopics[171].pText; v25 = v31; - v26 = pFontArrus->CalcTextHeight(dword_721BC4, &v28, 0, 0); + v26 = pFontArrus->CalcTextHeight(pNPCTopics[171].pText, &v28, 0, 0); v28.DrawText2(pFontArrus, 0, (212 - v26) / 2 + 101, v25, v24, 3u); result = (int)pDialogueWindow; pDialogueWindow->field_28 = 0; @@ -15689,7 +15681,7 @@ LABEL_19: strcpy(byte_591098, v21); LABEL_20: - pDialogueWindow = GUIWindow::Create(0, 0, 0x280u, 0x1E0u, (enum WindowType)26, 0, (int)byte_591098); + pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, (enum WindowType)26, 0, (int)byte_591098); //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * v9]].field_C) ) if ( BYTE1(pAnimatedRooms[p2DEvents[v9 - 1].uAnimationID].field_C) ) HousePlaySomeSound(v9, 1);