Mercurial > mm7
comparison Engine/Engine.cpp @ 2544:c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
author | a.parshin |
---|---|
date | Mon, 11 May 2015 09:51:04 +0200 |
parents | b6140dfeac27 |
children | 4008b2f34be0 |
comparison
equal
deleted
inserted
replaced
2543:b6140dfeac27 | 2544:c674d547cc7c |
---|---|
1057 // static_assert(sizeof(Render) == 0x129844, "Wrong type size"); | 1057 // static_assert(sizeof(Render) == 0x129844, "Wrong type size"); |
1058 static_assert(sizeof(Player) == 0x1B3C, "Wrong type size"); | 1058 static_assert(sizeof(Player) == 0x1B3C, "Wrong type size"); |
1059 static_assert(sizeof(PartyTimeStruct) == 0x678, "Wrong type size"); | 1059 static_assert(sizeof(PartyTimeStruct) == 0x678, "Wrong type size"); |
1060 static_assert(sizeof(Party) == 0x16238, "Wrong type size"); | 1060 static_assert(sizeof(Party) == 0x16238, "Wrong type size"); |
1061 static_assert(sizeof(GUIButton) == 0xBC, "Wrong type size"); | 1061 static_assert(sizeof(GUIButton) == 0xBC, "Wrong type size"); |
1062 static_assert(sizeof(GUIWindow) == 0x54, "Wrong type size"); | 1062 //static_assert(sizeof(GUIWindow) == 0x54, "Wrong type size"); |
1063 //static_assert(sizeof(GUIProgressBar) == 0x1B8, "Wrong type size"); | 1063 //static_assert(sizeof(GUIProgressBar) == 0x1B8, "Wrong type size"); |
1064 static_assert(sizeof(GUIFont) == 0x1020, "Wrong type size"); | 1064 static_assert(sizeof(GUIFont) == 0x1020, "Wrong type size"); |
1065 // static_assert(sizeof(stru262_TurnBased) == 0x40, "Wrong type size"); | 1065 // static_assert(sizeof(stru262_TurnBased) == 0x40, "Wrong type size"); |
1066 //static_assert(sizeof(ArcomageGame) == 0xFB, "Wrong type size"); | 1066 //static_assert(sizeof(ArcomageGame) == 0xFB, "Wrong type size"); |
1067 static_assert(sizeof(CastSpellInfo) == 0x14, "Wrong type size"); | 1067 static_assert(sizeof(CastSpellInfo) == 0x14, "Wrong type size"); |
1809 MMT_MainMenu_Loop(); | 1809 MMT_MainMenu_Loop(); |
1810 | 1810 |
1811 Log::Warning(L"MM: entering main loop"); | 1811 Log::Warning(L"MM: entering main loop"); |
1812 while (1) | 1812 while (1) |
1813 { | 1813 { |
1814 //MainMenuWindow* main_menu_window = MainMenuWindow::Create(); | 1814 MainMenuWindow *main_menu_window = MainMenuWindow::Create(); |
1815 //window->AddControl(main_menu_window); | 1815 window->AddControl(main_menu_window); |
1816 MainMenu_Loop(); | 1816 MainMenu_Loop(); |
1817 uGameState = GAME_STATE_PLAYING; | 1817 uGameState = GAME_STATE_PLAYING; |
1818 while (1) | 1818 while (1) |
1819 { | 1819 { |
1820 if (uGameState == GAME_FINISHED || GetCurrentMenuID() == MENU_EXIT_GAME) | 1820 if (uGameState == GAME_FINISHED || GetCurrentMenuID() == MENU_EXIT_GAME) |
2125 uCurrentlyLoadedLevelType = LEVEL_null; | 2125 uCurrentlyLoadedLevelType = LEVEL_null; |
2126 pSpriteFrameTable->ResetSomeSpriteFlags(); | 2126 pSpriteFrameTable->ResetSomeSpriteFlags(); |
2127 v0 = uNumVisibleWindows; | 2127 v0 = uNumVisibleWindows; |
2128 pParty->armageddon_timer = 0; | 2128 pParty->armageddon_timer = 0; |
2129 while (v0 > 0) | 2129 while (v0 > 0) |
2130 pWindowList[pVisibleWindowsIdxs[v0--] - 1].Release(); | 2130 { |
2131 pWindowList[pVisibleWindowsIdxs[v0--] - 1]->Release(); | |
2132 delete pWindowList[pVisibleWindowsIdxs[v0--] - 1]; | |
2133 pWindowList[pVisibleWindowsIdxs[v0--] - 1] = nullptr; | |
2134 } | |
2131 } | 2135 } |
2132 | 2136 |
2133 //----- (00461103) -------------------------------------------------------- | 2137 //----- (00461103) -------------------------------------------------------- |
2134 void _461103_load_level_sub() | 2138 void _461103_load_level_sub() |
2135 { | 2139 { |
3403 pMiscTimer->Pause(); | 3407 pMiscTimer->Pause(); |
3404 pEventTimer->Pause(); | 3408 pEventTimer->Pause(); |
3405 dword_5C3418 = a1; | 3409 dword_5C3418 = a1; |
3406 dword_5C341C = a2; | 3410 dword_5C341C = a2; |
3407 _591094_decoration = activeLevelDecoration; | 3411 _591094_decoration = activeLevelDecoration; |
3408 pGUIWindow2 = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_GreetingNPC, a4, 0); | 3412 pGUIWindow2 = new GUIWindow_GenericDialogue(0, 0, window->GetWidth(), window->GetHeight(), a4, 0); |
3409 pGUIWindow2->CreateButton(61, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0); | 3413 pGUIWindow2->CreateButton(61, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0); |
3410 pGUIWindow2->CreateButton(177, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0); | 3414 pGUIWindow2->CreateButton(177, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0); |
3411 pGUIWindow2->CreateButton(292, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0); | 3415 pGUIWindow2->CreateButton(292, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0); |
3412 pGUIWindow2->CreateButton(407, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); | 3416 pGUIWindow2->CreateButton(407, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0); |
3413 } | 3417 } |