Mercurial > mm7
diff mm7_2.cpp @ 1465:090ff42290c4
Слияние
author | Ritor1 |
---|---|
date | Mon, 26 Aug 2013 10:39:24 +0600 |
parents | 2ca62c9e7b3c |
children | 0a7ceb4b25b7 |
line wrap: on
line diff
--- a/mm7_2.cpp Mon Aug 26 10:39:10 2013 +0600 +++ b/mm7_2.cpp Mon Aug 26 10:39:24 2013 +0600 @@ -296,7 +296,7 @@ } //----- (004BBCDD) -------------------------------------------------------- -void __cdecl sub_4BBCDD() +void sub_4BBCDD() { signed int v0; // ebp@3 Actor *v1; // eax@4 @@ -387,7 +387,7 @@ } //----- (004BC109) -------------------------------------------------------- -void __cdecl ArenaFight() +void ArenaFight() { int v0; // edi@1 char *v1; // eax@7 @@ -598,7 +598,7 @@ } //----- (004BD8B5) -------------------------------------------------------- -signed int __cdecl sub_4BD8B5() +int sub_4BD8B5() { int v0; // eax@4 int v1; // eax@29 @@ -607,7 +607,7 @@ if ( pMessageQueue_50CBD0->uNumMessages ) pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; - pKeyActionMap->SetWindowInputStatus(3); + pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); pKeyActionMap->ResetKeys(); activeLevelDecoration = NULL; current_npc_text = 0; @@ -694,7 +694,7 @@ } //----- (004BF91E) -------------------------------------------------------- -unsigned int __thiscall GameOverMenu(void *ecx0) +unsigned int GameOverMenu(void *ecx0) { char *v1; // eax@2 unsigned int result; // eax@3 @@ -1578,7 +1578,7 @@ } //----- (00450521) -------------------------------------------------------- -signed int __fastcall sub_450521_ProllyDropItemAt(int ecx0, signed int a2, int a3, int a4, int a5, unsigned __int16 a6) +int __fastcall sub_450521_ProllyDropItemAt(int ecx0, signed int a2, int a3, int a4, int a5, unsigned __int16 a6) { int v6; // edi@1 int v7; // esi@1 @@ -1962,7 +1962,7 @@ // 5C6DF8: using guessed type int dword_5C6DF8; //----- (00450DA3) -------------------------------------------------------- -int __cdecl GetAlertStatus() +int GetAlertStatus() { int result; // eax@2 @@ -3034,7 +3034,7 @@ // 6BE35C: using guessed type int uLevel_StartingPointType; //----- (00461103) -------------------------------------------------------- -void __cdecl sub_461103() +void _461103_load_level_sub() { //GUIProgressBar *v0; // ebx@1 //signed int v1; // ebp@1 @@ -3188,7 +3188,7 @@ uNumActors = 0; if ( dword_6BE368_debug_settings_2 & 8 ) uNumLevelDecorations = 0; - sub_4613C4(); + init_event_triggers(); pGameLoadingUI_ProgressBar->Progress(); @@ -3206,38 +3206,15 @@ } //----- (004613C4) -------------------------------------------------------- -int __cdecl sub_4613C4() +void init_event_triggers() { - unsigned __int16 v0; // ax@1 - size_t v1; // ecx@1 - int v2; // esi@1 - int result; // eax@1 - LevelDecoration *v4; // edx@2 - int v5; // edi@4 - - _6836C8_num_decorations_6807E8 = 0; - v0 = pDecorationList->GetDecorIdByName("Event Trigger"); - v1 = uNumLevelDecorations; - v2 = (signed __int16)v0; - result = 0; - if ( (signed int)uNumLevelDecorations > 0 ) - { - v4 = pLevelDecorations.data(); - do - { - if ( v4->uDecorationDescID == v2 ) - { - v5 = _6836C8_num_decorations_6807E8++; - _6807E8_level_decorations_ids[v5] = result; - } - ++result; - ++v4; - } - while ( result < (signed int)v1 ); - } - return result; + uint id = pDecorationList->GetDecorIdByName("Event Trigger"); + + num_event_triggers = 0; + for (uint i = 0; i < uNumLevelDecorations; ++i) + if (pLevelDecorations[i].uDecorationDescID == id) + event_triggers[num_event_triggers++] = i; } -// 6836C8: using guessed type int 6836C8_num_decorations_6807E8; //----- (004621DA) -------------------------------------------------------- int int_get_vector_length(signed int x, signed int y, signed int z) @@ -3267,7 +3244,7 @@ OPENFILENAMEA ofn; //----- (0046271C) -------------------------------------------------------- -void __cdecl crt_init_globals_46271C() +void CreateDefaultBLVLevel() { ofn.lStructSize = 0x4Cu; ofn.hwndOwner = hWnd; @@ -3378,7 +3355,7 @@ } else { - if ( !ptr_507BDC )// ??? + if ( !pModalWindow )// ??? { pButton = pWindow->pControlsHead; for ( pButton = pWindow->pControlsHead; pButton; pButton = pButton->pNext ) @@ -3448,6 +3425,7 @@ switch (Msg) { + case WM_SIZING: return 1; case WM_SETTEXT: return DefWindowProcW(hWnd, Msg, wParam, lParam); case WM_CHAR: { @@ -3456,6 +3434,14 @@ } return DefWindowProcA(hWnd, Msg, wParam, lParam); + + case WM_DEVICECHANGE: + { + if (wParam == 0x8000) // CD or some device has been inserted - notify InsertCD dialog + PostMessageA(hInsertCDWindow, WM_USER + 1, 0, 0); + return 0; + } + case WM_COMMAND: { switch (wParam) @@ -3640,12 +3626,6 @@ { switch ( Msg ) { - case WM_DEVICECHANGE: - if ( wParam == 0x8000 ) - PostMessageA(hInsertCDWindow, WM_CHOOSEFONT_GETLOGFONT, 0, 0); - return 0; - case WM_SIZING: - return 1; case WM_LBUTTONDOWN: if ( pArcomageGame->bGameInProgress ) { @@ -3763,7 +3743,6 @@ if ( !pGame ) //goto _def_wnd_proc; return DefWindowProcA(hWnd, Msg, wParam, lParam); - sub_417871(0); return DefWindowProcA(hWnd, Msg, wParam, lParam); case WM_MOUSEMOVE: if ( pArcomageGame->bGameInProgress ) @@ -3846,14 +3825,14 @@ } if ( wParam >= VK_LEFT && wParam <= VK_DOWN ) { - if ( pCurrentScreen != SCREEN_GAME && pCurrentScreen != SCREEN_PRESS_ESCAPE_MESSAGE ) + if ( pCurrentScreen != SCREEN_GAME && pCurrentScreen != SCREEN_MODAL_WINDOW ) { if ( !viewparams->field_4C ) UI_OnKeyDown(wParam); return 0; } } - if ( pCurrentScreen != SCREEN_GAME && pCurrentScreen != SCREEN_PRESS_ESCAPE_MESSAGE ) + if ( pCurrentScreen != SCREEN_GAME && pCurrentScreen != SCREEN_MODAL_WINDOW ) return 0; } @@ -4023,7 +4002,7 @@ } //----- (00464479) -------------------------------------------------------- -void __cdecl ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows() +void ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows() { int v0; // esi@9 @@ -4056,11 +4035,8 @@ } //----- (004646F0) -------------------------------------------------------- -void PrepareWorld(unsigned int this_) +void PrepareWorld(unsigned int _0_box_loading_1_fullscreen) { - unsigned int v1; // ebx@1 - - v1 = this_; if ( pRenderer->pRenderD3D ) pGame->pVisInstance->_4C1A02(); pEventTimer->Pause(); @@ -4068,13 +4044,13 @@ pParty->uFlags = 2; pCastSpellInfo.data()->_427D48(1); ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); - DoPrepareWorld(0, (v1 == 0) + 1); + DoPrepareWorld(0, (_0_box_loading_1_fullscreen == 0) + 1); pMiscTimer->Resume(); pEventTimer->Resume(); } //----- (00464761) -------------------------------------------------------- -void __thiscall Game_DeinitializeAndTerminate(int exitCode) +void Game_DeinitializeAndTerminate(int exitCode) { int v1; // esi@1 HANDLE v2; // eax@1 @@ -4109,22 +4085,22 @@ // 6BE3A0: using guessed type float flt_6BE3A0; //----- (00464839) -------------------------------------------------------- -char __cdecl Is_out15odm_underwater() +char Is_out15odm_underwater() { return _stricmp(pCurrentMapName.data(), "out15.odm") == 0; } //----- (00464851) -------------------------------------------------------- -void __cdecl SetUnderwaterFog() +void SetUnderwaterFog() { day_fogrange_1 = 50; day_fogrange_2 = 5000; } //----- (00464866) -------------------------------------------------------- -void __fastcall DoPrepareWorld(unsigned int bLoading, int a2) +void DoPrepareWorld(unsigned int bLoading, int _1_fullscreen_loading_2_box) { - int v2; // esi@1 + //int v2; // esi@1 char *v3; // eax@1 //char *v4; // eax@1 unsigned int v5; // eax@3 @@ -4133,11 +4109,11 @@ char Str1[20]; // [sp+Ch] [bp-18h]@1 unsigned int v9; // [sp+20h] [bp-4h]@1 - v2 = a2; v9 = bLoading; ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); pDecalBuilder->Reset(0); - pGameLoadingUI_ProgressBar->Initialize((GUIProgressBar::Type)v2); + pGameLoadingUI_ProgressBar->Initialize(_1_fullscreen_loading_2_box == 1 ? GUIProgressBar::TYPE_Fullscreen : + GUIProgressBar::TYPE_Box); strcpy(Str1, pCurrentMapName.data()); v3 = strtok(Str1, "."); strcpy(Str1, v3); @@ -4166,7 +4142,7 @@ else PrepareToLoadBLV(v9); pAudioPlayer->SetMapEAX(); - sub_461103(); + _461103_load_level_sub(); if ( !_stricmp(pCurrentMapName.data(), "d11.blv") || !_stricmp(pCurrentMapName.data(), "d10.blv") ) { //spawning grounds & good analogue - no loot & exp from monsters @@ -4181,7 +4157,7 @@ bDialogueUI_InitializeActor_NPC_ID = 0; OnMapLoad(); pGameLoadingUI_ProgressBar->Progress(); -memset(&pRenderer->pBillboardRenderListD3D, 0, sizeof(pRenderer->pBillboardRenderListD3D)); + memset(&pRenderer->pBillboardRenderListD3D, 0, sizeof(pRenderer->pBillboardRenderListD3D)); pGameLoadingUI_ProgressBar->Release(); _flushall(); } @@ -5087,7 +5063,7 @@ } //----- (00465D0B) -------------------------------------------------------- -void __cdecl SecondaryInitialization() +void SecondaryInitialization() { __int16 v4; // ax@4 signed int v5; // esi@5 @@ -5456,13 +5432,16 @@ } else { - if (GetCurrentMenuID() == MENU_10) + if (GetCurrentMenuID() == MENU_DebugBLVLevel) { pMouse->Activate(0); pParty->Reset(); pParty->CreateDefaultParty(1); - crt_init_globals_46271C(); + + extern void CreateDefaultBLVLevel(); + CreateDefaultBLVLevel(); + extern OPENFILENAMEA ofn; if ( !GetOpenFileNameA((LPOPENFILENAMEA)&ofn) ) { @@ -5509,7 +5488,7 @@ } //----- (004637E0) -------------------------------------------------------- -char __cdecl sub_4637E0_is_there_popup_onscreen() +char sub_4637E0_is_there_popup_onscreen() { return dword_507BF0_is_there_popup_onscreen == 1; } @@ -5659,7 +5638,7 @@ } //----- (004666D5) -------------------------------------------------------- -void __cdecl MM7Initialization() +void MM7Initialization() { if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) { @@ -5705,7 +5684,7 @@ } //----- (00466B8C) -------------------------------------------------------- -int __cdecl AbortWithError() +int AbortWithError() { if ( !aborting_app ) { @@ -5754,7 +5733,7 @@ case MENU_NAMEPANELESC: return L"MENU_NAMEPANELESC"; case MENU_CREDITSPROC: return L"MENU_CREDITSPROC"; case MENU_LoadingProcInMainMenu: return L"MENU_LoadingProcInMainMenu"; - case MENU_10: return L"MENU_10"; + case MENU_DebugBLVLevel: return L"MENU_DebugBLVLevel"; case MENU_CREDITSCLOSE: return L"MENU_CREDITSCLOSE"; default: return L"unk"; }; @@ -5772,12 +5751,9 @@ return uCurrentMenuID; } -// 720980: using guessed type int uTextureID_720980; - -// 4E28F8: using guessed type int pCurrentScreen; //----- (0046A6AC) -------------------------------------------------------- -int __fastcall sub_46A6AC(int a1, int a2, int a3) +int __fastcall _46A6AC_spell_render(int a1, int a2, int a3) { int result; // eax@2 unsigned int v4; // edx@3 @@ -5798,10 +5774,11 @@ v14 = a1; if ( pRenderer->pRenderD3D ) { - result = sub_46A7C8(a1, a2, a3); + result = _46A6AC_spell_render_d3d(a1, a2, a3); } else { + __debugbreak(); // SW render never called v16 = 0; v4 = viewparams->uScreen_topL_X; v12 = viewparams->uScreen_BttmR_X; @@ -5860,7 +5837,7 @@ } //----- (0046A7C8) -------------------------------------------------------- -int __fastcall sub_46A7C8(int a1, int a2, signed int a3) +int __fastcall _46A6AC_spell_render_d3d(int a1, int a2, int a3) { unsigned int v3; // eax@2 int v4; // ecx@2 @@ -5929,7 +5906,7 @@ } //----- (0046A89E) -------------------------------------------------------- -int __fastcall sub_46A89E(int a1, int a2, signed int a3) +int __fastcall _46A89E_immolation_effect(int a1, int a2, int a3) { signed int v3; // edi@1 Actor *v4; // esi@2 @@ -6013,7 +5990,7 @@ } //----- (0046A99B) -------------------------------------------------------- -int __cdecl sub_46A99B() +int sub_46A99B() { int v0; // ebx@1 signed int v1; // ecx@1 @@ -6219,7 +6196,7 @@ } //----- (0046BDA8) -------------------------------------------------------- -unsigned int __cdecl GetGravityStrength() +unsigned int GetGravityStrength() { int v0; // eax@1 @@ -6229,7 +6206,7 @@ } //----- (0046BDC0) -------------------------------------------------------- -void __cdecl UpdateUserInput_and_MapSpecificStuff() +void UpdateUserInput_and_MapSpecificStuff() { if ( dword_6BE364_game_settings_1 & 0x80 ) { @@ -6766,7 +6743,7 @@ v16 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; v124 = 8 * v153; LOBYTE(v124) = v124 | 2; - v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id] + 1; + v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; pAudioPlayer->PlaySound((SoundID)v125, v124, v9, -1, v9, v16, v9, v9); return 0; } @@ -6823,7 +6800,7 @@ v16 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; v124 = 8 * v153; LOBYTE(v124) = v124 | 2; - v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id] + 1; + v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; pAudioPlayer->PlaySound((SoundID)v125, v124, v9, -1, v9, v16, v9, v9); return 0; } @@ -6924,7 +6901,7 @@ v16 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; v124 = 8 * v153; LOBYTE(v124) = v124 | 2; - v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id] + 1; + v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id-1] + 1; pAudioPlayer->PlaySound((SoundID)v125, v124, v9, -1, v9, v16, v9, v9); return 0; } @@ -7058,7 +7035,7 @@ v16 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; v124 = 8 * v153; LOBYTE(v124) = v124 | 2; - v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id] + 1; + v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v16, 0, 0); return 0; }