From 8ed857691bfa83ab06174e5ac6b4378a831c89d5 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:47:56 +0100 Subject: [PATCH 01/58] reimplement: SHC_3BB0A8C1_0x00433030 100.0% Reimplemented MenuView_BuildMenu_DoEveryFrame, gynt's version as it stands on his fork's archive/UI-MenuViews-development-second-pass at 32939bbc1 (2026-10-25), where its status line reads 100.0%; that commit is also the last one to change the file. Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_BuildMenu_DoEveryFrame.cpp | 111 ++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp diff --git a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp new file mode 100644 index 0000000000..3e437054cc --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp @@ -0,0 +1,111 @@ +#include "../BuildMenu.func.hpp" + +#include "OpenSHC/UI/DisplayElements.func.hpp" +#include "OpenSHC/UI/MenuHandlerState.func.hpp" +#include "OpenSHC/UI/MinimapViewState.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eGM.hpp" +#include "OpenSHC/IO/Graphics/GmID.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/Rendering/ScreenResolutionEnum.hpp" +#include "OpenSHC/UI/Enums/BuildMenuTabType.hpp" +#include "OpenSHC/UI/Enums/DisplayElementID.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/COL_MAGENTA.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_MinimapViewState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using OpenSHC::DE::SHCDE::eGM; + using OpenSHC::IO::Graphics::GmID; + using OpenSHC::Rendering::ScreenResolutionEnum; + using OpenSHC::Rendering::Enums::RenderTarget; + using OpenSHC::UI::Enums::BuildMenuTabType; + using OpenSHC::UI::Enums::DisplayElementID; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00433030 + void BuildMenu::MenuView_BuildMenu_DoEveryFrame() + { + if ((DAT_GameCore::instance.activeMenuTab.buildMenuTab != OpenSHC::UI::Enums::BMTT_MENU_HIDDEN) + && (DAT_GameCore::instance.activeMenuTab.buildMenuTab + != (OpenSHC::UI::Enums::BuildMenuTabTypeShort)0x3e)) { + if (DAT_MinimapViewState::instance.field3_0xc == 0) { + DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated = 2; + } + if (DAT_MenuHandlerState::instance.isBuildMenuTransitioning_0x18 != FALSE) { + MACRO_CALL_MEMBER(OpenSHC::UI::MenuHandlerState_Func::computeBuildMenuTransitionShift, + DAT_MenuHandlerState::ptr)(); + } + if (DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated == 2) { + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue + = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_640x480) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_PANELS, 2, + DAT_MenuHandlerState::instance.x, (int)(DAT_MenuHandlerState::instance.y + 472)); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, + DAT_PencilRenderCore::ptr)(DAT_MenuHandlerState::instance.x, + DAT_MenuHandlerState::instance.y + 0x196, DAT_MenuHandlerState::instance.x + 799, + DAT_MenuHandlerState::instance.y + 0x1d7, (ushort)(COL_MAGENTA::instance.shortValue)); + if (DAT_GameCore::instance.activeMenuTab.buildMenuTab == OpenSHC::UI::Enums::BMTT_SOLDIERS) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_PANELS, 5, + DAT_MenuHandlerState::instance.x, DAT_MenuHandlerState::instance.y + 0x1bd); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_PANELS, 1, + DAT_MenuHandlerState::instance.x, DAT_MenuHandlerState::instance.y + 0x1c2); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::setRenderingRect, + DAT_TextureRenderCoreObject::ptr)(DAT_MenuHandlerState::instance.x + 0x11, + DAT_MenuHandlerState::instance.y + 0x1d9, DAT_MenuHandlerState::instance.x + 0x201, + DAT_MenuHandlerState::instance.y + 0x240); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawTgxGmOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::IO::Graphics::GID_INTERFACE_BUTTONS, 7, + (DAT_MenuHandlerState::instance.x + - DAT_MenuHandlerState::instance.buildMenuBackgroundLeftShift_0x24) + + 0x11, + DAT_MenuHandlerState::instance.y + 0x1d9); + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::setRenderingRectToGameResolution, + DAT_TextureRenderCoreObject::ptr)(); + } + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue + = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + DAT_MinimapViewState::instance.needsRedraw = 1; + if (DAT_GameCore::instance.isBinkVideoPlaying == 0) { + MACRO_CALL_MEMBER( + OpenSHC::UI::MinimapViewState_Func::renderMinimapMain, DAT_MinimapViewState::ptr)(); + } + } + if (DAT_GameCore::instance.isVictoryOrDefeatUnk != 0) { + DAT_GameCore::instance.isVictoryOrDefeatUnk = 0; + DAT_GameState::instance.mapAndTime.gameOver = TRUE; + DWORD _currentTime = timeGetTime(); + DAT_GameState::instance.mapAndTime.gameOverTime = _currentTime - 6000; + DAT_GameState::instance.mapAndTime.playerIsAlive[DAT_GameSynchronyState::instance.currentPlayerSlotID] + = 1; + DAT_GameCore::instance.skipStoreSKMasters = 1; + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_WIN_DEFEAT_WINDOW, 1); + } + return; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index ed989c9a21..43f0d351cc 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -11081,7 +11081,7 @@ SHC_3BB0A8C1_0x00431A90 | 0.0% | Pending SHC_3BB0A8C1_0x00431B60 | 0.0% | Pending -SHC_3BB0A8C1_0x00433030 | 0.0% | Pending +SHC_3BB0A8C1_0x00433030 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00433200 | 100.0% | Reimplemented From f2fe69996c8a6731d1dfff7bb8df5fb625d352d7 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:47:56 +0100 Subject: [PATCH 02/58] reimplement: SHC_3BB0A8C1_0x00431A90 100.0% Reimplemented MenuView_BuildMenu_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-development-second-pass at 32939bbc1 (2026-10-25), where its status line reads 100.0%; that commit is also the last one to change the file. Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../BuildMenu/MenuView_BuildMenu_Prepare.cpp | 72 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp new file mode 100644 index 0000000000..e46389c263 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp @@ -0,0 +1,72 @@ +#include "../BuildMenu.func.hpp" + +#include "OpenSHC/Map/MapPropertiesState.func.hpp" +#include "OpenSHC/Text/UserTextHandler.func.hpp" +#include "OpenSHC/UI/DisplayElements.func.hpp" +#include "OpenSHC/Game/GameMode.hpp" +#include "OpenSHC/UI/Enums/BuildingsAndStatusMenuTabType.hpp" +#include "OpenSHC/UI/Enums/DisplayElementID.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_MapPropertiesState.hpp" +#include "OpenSHC/Globals/DAT_MouseState.hpp" +#include "OpenSHC/Globals/DAT_TileMapState.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" +#include "OpenSHC/Globals/DAT_UserTextHandlerState.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/INT_00b960f0.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using OpenSHC::Game::GameMode; + using OpenSHC::UI::Enums::BuildingsAndStatusMenuTabType; + using OpenSHC::UI::Enums::DisplayElementID; + + // FUNCTION: STRONGHOLDCRUSADER 0x00431A90 + void BuildMenu::MenuView_BuildMenu_Prepare() + { + int iVar1; + MACRO_CALL_MEMBER(OpenSHC::Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)(4); + if (DAT_GameCore::instance.activeMenuTab.tabType != OpenSHC::UI::Enums::BASMTT_SIEGETENT_BATTERINGRAM + && DAT_GameCore::instance.activeMenuTab.tabType != OpenSHC::UI::Enums::BASMTT_SIEGETENT_SHIELD + && DAT_GameCore::instance.menuTabToSwitchTo.tabType != OpenSHC::UI::Enums::BASMTT_SIEGETENT_BATTERINGRAM + && DAT_GameCore::instance.menuTabToSwitchTo.tabType != OpenSHC::UI::Enums::BASMTT_SIEGETENT_SHIELD) { + DAT_TileMapState::instance.shiftRelated0or3 = 0; + DAT_UnitsState::instance.unitCountOfSelection[DAT_GameSynchronyState::instance.currentPlayerSlotID] = 0; + } + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_KEEP_AND_GRANERY_PLACEMENT_INFO, 0); + DAT_WindowAndDirectDraw::instance.pendingMenuRedraw = 1; + iVar1 = MACRO_CALL_MEMBER(OpenSHC::Map::MapPropertiesState_Func::getEventIDForTimeUntilDefeatEventType, + DAT_MapPropertiesState::ptr)(); + if (0 <= iVar1) { + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_TIME_UNTIL_DEFEAT, 1); + } + if (DAT_GameSynchronyState::instance.currentGameMode != OpenSHC::Game::GM_SOLITARY) { + if (DAT_GameCore::instance.mapU4Int0 != 0) { + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_UNKNOWN_25, 1); + } + if (DAT_GameSynchronyState::instance.currentGameMode != OpenSHC::Game::GM_SOLITARY) { + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_PLAYER_INFO_ON_HOVER, 1); + if (DAT_GameSynchronyState::instance.currentGameMode != OpenSHC::Game::GM_SOLITARY + && DAT_GameSynchronyState::instance.currentGameMode != OpenSHC::Game::GM_SKIRMISH_SINGLE_PLAYER + && DAT_GameState::instance.mapAndTime.skirmishNoRushTicks != 0) { + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_NO_RUSH, 1); + } + } + } + DAT_MouseState::instance.waitCursorToggle = 0; + INT_00b960f0::instance = 0; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 43f0d351cc..4f4bd01d39 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -11077,7 +11077,7 @@ SHC_3BB0A8C1_0x0043198A | 0.0% | Pending SHC_3BB0A8C1_0x00431990 | 0.0% | Pending -SHC_3BB0A8C1_0x00431A90 | 0.0% | Pending +SHC_3BB0A8C1_0x00431A90 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00431B60 | 0.0% | Pending From 2f3ee0d8b4f14f3229467e4adcca273705082f01 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:47:56 +0100 Subject: [PATCH 03/58] reimplement: SHC_3BB0A8C1_0x004DD0C0 100.0% Reimplemented MenuView_CampaignUnk_DoInitial, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 83c1d8036 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004DD0C0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_CampaignUnk_DoInitial.cpp | 31 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/CampaignUnk/MenuView_CampaignUnk_DoInitial.cpp diff --git a/src/OpenSHC/UI/MenuViews/CampaignUnk/MenuView_CampaignUnk_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/CampaignUnk/MenuView_CampaignUnk_DoInitial.cpp new file mode 100644 index 0000000000..30be497505 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/CampaignUnk/MenuView_CampaignUnk_DoInitial.cpp @@ -0,0 +1,31 @@ +#include "../CampaignUnk.func.hpp" + +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004DD0C0 + void CampaignUnk::MenuView_CampaignUnk_DoInitial() + { + Menu* pMVar1; + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL(UI::Helpers_Func::ColorEntireScreen)(COL_BLACK::instance.shortValue); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 4f4bd01d39..76364ee147 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -36261,7 +36261,7 @@ SHC_3BB0A8C1_0x004DCC70 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DCC90 | 0.0% | Pending -SHC_3BB0A8C1_0x004DD0C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004DD0C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DD100 | 0.0% | Pending From 37185af6e17d4b9baf123c34d53a6119bd1dd161 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:47:57 +0100 Subject: [PATCH 04/58] reimplement: SHC_3BB0A8C1_0x004262B0 100.0% Reimplemented MenuView_Credits_DoInitial, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 08040dda1 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004262B0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../Credits/MenuView_Credits_DoInitial.cpp | 50 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoInitial.cpp diff --git a/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoInitial.cpp new file mode 100644 index 0000000000..ae46b9b7a9 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoInitial.cpp @@ -0,0 +1,50 @@ +#include "../Credits.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextEditorState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004262B0 + void Credits::MenuView_Credits_DoInitial() + { + Menu* pMVar1; + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + (ushort)(COL_BLACK::instance.shortValue)); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + MACRO_CALL_MEMBER( + UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + DAT_TextEditorState::instance.pendingCreditsFadeBorder = TRUE; + return; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 76364ee147..a4f6820ded 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6761,7 +6761,7 @@ SHC_3BB0A8C1_0x00426060 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004261E0 | 0.0% | Pending -SHC_3BB0A8C1_0x004262B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004262B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00426340 | 0.0% | Pending From 873aa7be8705ea126771d32be6760e5fc1c7a7f4 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:47:57 +0100 Subject: [PATCH 05/58] reimplement: SHC_3BB0A8C1_0x004E1F50 100.0% Reimplemented MenuView_CrusadeEndscreen_DoEveryFrame, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in fa5f9af72 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004E1F50 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...MenuView_CrusadeEndscreen_DoEveryFrame.cpp | 36 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoEveryFrame.cpp diff --git a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoEveryFrame.cpp new file mode 100644 index 0000000000..008e1a20d0 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoEveryFrame.cpp @@ -0,0 +1,36 @@ +#include "../CrusadeEndscreen.func.hpp" + +#include "OpenSHC/Audio/MSS/SoundSystem.func.hpp" +#include "OpenSHC/Rendering.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/DE/SHCDE/eMusicIDs.hpp" + +#include "OpenSHC/Globals/DAT_SoundSystemState.hpp" +#include "OpenSHC/Globals/DAT_UnknownBinkIndex.hpp" +#include "OpenSHC/Globals/INT_00ed27b8.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using DE::SHCDE::eMusicIDs; + + // FUNCTION: STRONGHOLDCRUSADER 0x004E1F50 + void CrusadeEndscreen::MenuView_CrusadeEndscreen_DoEveryFrame() + { + int iVar1 = MACRO_CALL(UI::Helpers_Func::TicksSinceCounterStart)(); + if (iVar1) { + MACRO_CALL(Rendering_Func::ProcessCreditsScriptCommands)(); + if ((0x3b <= (int)DAT_UnknownBinkIndex::instance) && (!INT_00ed27b8::instance)) { + MACRO_CALL_MEMBER(Audio::MSS::SoundSystem_Func::setSomeSoundTime, DAT_SoundSystemState::ptr)(); + MACRO_CALL_MEMBER(Audio::MSS::SoundSystem_Func::setupVolumeAndSoundID, DAT_SoundSystemState::ptr)( + DE::SHCDE::MUSIC_GERMAN_EGG); + INT_00ed27b8::instance = 1; + } + MACRO_CALL(Rendering_Func::RenderActiveCreditsElements)(); + } + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index a4f6820ded..40641c9556 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -36387,7 +36387,7 @@ SHC_3BB0A8C1_0x004E1E30 | 0.0% | Pending SHC_3BB0A8C1_0x004E1E70 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004E1F50 | 0.0% | Pending +SHC_3BB0A8C1_0x004E1F50 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004E1FA0 | 0.0% | Pending From 2203241eb3b5cbf154a2d03fc84abfd831540f13 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:47:57 +0100 Subject: [PATCH 06/58] reimplement: SHC_3BB0A8C1_0x004D91D0 100.0% Reimplemented MenuView_CrusadeEndscreen_DoInitial, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 3003347fb (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004D91D0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_CrusadeEndscreen_DoInitial.cpp | 36 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoInitial.cpp diff --git a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoInitial.cpp new file mode 100644 index 0000000000..982364eca2 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoInitial.cpp @@ -0,0 +1,36 @@ +#include "../CrusadeEndscreen.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/INT_00ed27b8.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004D91D0 + void CrusadeEndscreen::MenuView_CrusadeEndscreen_DoInitial() + { + Menu* pMVar1; + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + (ushort)(COL_BLACK::instance.shortValue)); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + INT_00ed27b8::instance = 0; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 40641c9556..903b49c34b 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -36015,7 +36015,7 @@ SHC_3BB0A8C1_0x004D8DF0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004D8EC0 | 0.0% | Pending -SHC_3BB0A8C1_0x004D91D0 | 0.0% | Pending +SHC_3BB0A8C1_0x004D91D0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004D9230 | 0.0% | Pending From b7c4069b4f44f93e74b1bfb79ebf10f47fc738f2 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:47:57 +0100 Subject: [PATCH 07/58] reimplement: SHC_3BB0A8C1_0x004DF2E0 100.0% Reimplemented MenuView_CrusadeEndscreen_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in d91816f0c (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004DF2E0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_CrusadeEndscreen_Prepare.cpp | 237 ++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 238 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp new file mode 100644 index 0000000000..2147f2cdb6 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp @@ -0,0 +1,237 @@ +#include "../CrusadeEndscreen.func.hpp" + +#include "OpenSHC/Rendering.func.hpp" +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Credits.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Audio/MSS/enums/SHC_SoundStream.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Game/TrailType.hpp" +#include "OpenSHC/Text/GameLanguage.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_NumberOfStoredMenuStrings.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using Audio::MSS::enums::SHC_SoundStream; + using DE::SHCDE::eTextSections; + using Game::TrailType; + using Text::GameLanguage; + + // FUNCTION: STRONGHOLDCRUSADER 0x004DF2E0 + void CrusadeEndscreen::MenuView_CrusadeEndscreen_Prepare() + { + undefined4 uVar2; + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "sktrail_win.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "endframe1.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "endframe2.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "endframe3.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "endframe4.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "endframe5.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "endframe6.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "endframe7.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "endframe8.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "jesterlast.tgx"); + MACRO_CALL(UI::Credits_Func::ResetCredits)(); + DAT_NumberOfStoredMenuStrings::instance = 0; + /* + added by script: "Congratulations!" + */ + MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( + MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( + DE::SHCDE::TEXT_SKTRAIL_WIN, 0)); + /* + added by script: "Many have set out..." + */ + MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( + MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( + DE::SHCDE::TEXT_SKTRAIL_WIN, 1)); + /* + added by script: "...but few will have survived this journey." + */ + MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( + MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( + DE::SHCDE::TEXT_SKTRAIL_WIN, 2)); + /* + added by script: "You have bested the Crusader Trail!" + */ + MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( + MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( + DE::SHCDE::TEXT_SKTRAIL_WIN, 3)); + /* + added by script: "You have bested the Crusader Extreme Trail!" + */ + MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( + MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( + DE::SHCDE::TEXT_SKTRAIL_WIN, 4)); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundEntry)(1, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsShowImageCommand)(0x29, 0, 0xe6, 0xcb, 0x150, 0xa8, 0, 1); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(0xf, 0, 0xf, 1, 0x192, 0xea, 0, 1); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(0xf, 0, 0xf, 0, 400, 0xe8, 0, 1); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 1, 0x6a, 0x35, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "rt_vict1.bik", 0x6a, 0x35, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( + "fx\\speech\\rt_anger_04.wav", 3, 0, 100); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 2, 0x14b, 0x18, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "sn_vict2.bik", 0x14b, 0x18, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( + "fx\\speech\\sn_add_player.wav", 3, 0, 100); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 3, 0x22d, 0x35, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "pg_taunt2.bik", 0x22d, 0x35, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( + "fx\\speech\\pg_add_player.wav", 3, 0, 100); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 4, 0x280, 0xdf, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "wf_anger1.bik", 0x280, 0xdf, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( + "fx\\speech\\wf_anger_04.wav", 3, 0, 100); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 5, 0x22d, 0x18a, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "saladin_angry.bik", 0x22d, 0x18a, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( + "fx\\speech\\sa_extra_01.wav", 3, 0, 100); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 6, 0x14c, 0x1b4, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "sultan_natural.bik", 0x14c, 0x1b4, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( + "fx\\speech\\su_congrats_01.wav", 3, 0, 100); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 7, 0x6a, 0x18a, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "richard_taunting.bik", 0x6a, 0x18a, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( + "fx\\speech\\ri_congrats_01.wav", 3, 0, 100); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 8, 0x23, 0xdf, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "bad_arab_taunt.bik", 0x23, 0xdf, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( + "fx\\speech\\ca_add_player_01.wav", 3, 0, 100); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); + uVar2 = 0x10; + if (DAT_TextManagerObject::instance.gameLanguage == Text::GL_ITALIAN) { + uVar2 = 0x11; + } + MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(0x10, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( + 0xf, 1, (undefined4)((int)(uVar2)), 1, 0x106, 0xee, 0x11a, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( + 0xf, 1, (undefined4)((int)(uVar2)), 0, 0x104, 0xec, 0x11a, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, Audio::MSS::enums::SND_STR_SFX_1Unk); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(1, ((SHC_SoundStream)0x5a)); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(0x10, 1); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, Audio::MSS::enums::SND_STR_SFX_1Unk); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( + 0xf, 2, (undefined4)((int)(uVar2)), 1, 0x106, 0xee, 0x11a, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( + 0xf, 2, (undefined4)((int)(uVar2)), 0, 0x104, 0xec, 0x11a, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, Audio::MSS::enums::SND_STR_SFX_2Unk); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(1, ((SHC_SoundStream)0x5a)); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(0x10, 2); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, Audio::MSS::enums::SND_STR_SFX_2Unk); + if (DAT_GameCore::instance.currentTrailType == Game::TT_EXTREME) { + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( + 0xf, 4, (undefined4)((int)(uVar2)), 1, 0x106, 0xee, 0x11a, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( + 0xf, 4, (undefined4)((int)(uVar2)), 0, 0x104, 0xec, 0x11a, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)( + 3, Audio::MSS::enums::SND_STR_SPEECH_2); + } else { + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( + 0xf, 3, (undefined4)((int)(uVar2)), 1, 0x106, 0xee, 0x11a, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( + 0xf, 3, (undefined4)((int)(uVar2)), 0, 0x104, 0xec, 0x11a, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)( + 3, Audio::MSS::enums::SND_STR_SPEECH_1); + } + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, Audio::MSS::enums::SND_STR_SFX_1Unk); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 0x6a, 0x35, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x6a, 0x35, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, Audio::MSS::enums::SND_STR_SFX_2Unk); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 0x14b, 0x18, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x14b, 0x18, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, Audio::MSS::enums::SND_STR_SPEECH_1); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 0x22d, 0x35, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x22d, 0x35, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, Audio::MSS::enums::SND_STR_SPEECH_2); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 0x280, 0xdf, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x280, 0xdf, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, + (Audio::MSS::enums::SHC_SoundStream)(Audio::MSS::enums::SND_STR_SPEECH_2 + | Audio::MSS::enums::SND_STR_SFX_1Unk)); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 0x22d, 0x18a, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x22d, 0x18a, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, + (Audio::MSS::enums::SHC_SoundStream)(Audio::MSS::enums::SND_STR_SPEECH_2 + | Audio::MSS::enums::SND_STR_SFX_2Unk)); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 0x14c, 0x1b4, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x14c, 0x1b4, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, + (Audio::MSS::enums::SHC_SoundStream)(Audio::MSS::enums::SND_STR_SPEECH_2 + | Audio::MSS::enums::SND_STR_SPEECH_1)); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 0x6a, 0x18a, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x6a, 0x18a, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, ((SHC_SoundStream)8)); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 0x23, 0xdf, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x23, 0xdf, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageEndCommand)(0x2a, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(0x10, 3); + MACRO_CALL(UI::Credits_Func::AppendCreditsSegmentEndCommand)(); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x6a, 0x35, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x14b, 0x18, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x22d, 0x35, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x280, 0xdf, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x22d, 0x18a, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x14c, 0x1b4, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x6a, 0x18a, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x23, 0xdf, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsClearImageCommand)(); + MACRO_CALL(Rendering_Func::TicksStartCounter)(); + MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 903b49c34b..31d9b68104 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -36275,7 +36275,7 @@ SHC_3BB0A8C1_0x004DD7B0 | 0.0% | Pending SHC_3BB0A8C1_0x004DE300 | 0.0% | Pending -SHC_3BB0A8C1_0x004DF2E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004DF2E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DFB90 | 0.0% | Pending From 2139f97e3065c6c20eeef35b8d03020b929ab490 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:47:58 +0100 Subject: [PATCH 08/58] reimplement: SHC_3BB0A8C1_0x00425FF0 100.0% Reimplemented MenuView_CustomScenarios_DoEveryFrame, gynt's version as it stands on his fork's archive/UI-MenuViews-development-second-pass at 32939bbc1 (2026-10-25), where its status line reads 100.0%; that commit is also the last one to change the file. Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_CustomScenarios_DoEveryFrame.cpp | 49 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp diff --git a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp new file mode 100644 index 0000000000..546c19b56c --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp @@ -0,0 +1,49 @@ +#include "../CustomScenarios.func.hpp" + +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/UI/MenuViews/CustomScenarios.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UnknownGFXIndex.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using OpenSHC::UI::Enums::MenuModalType; + using OpenSHC::UI::Enums::MenuViewType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00425FF0 + void CustomScenarios::MenuView_CustomScenarios_DoEveryFrame() + { + DAT_UnknownGFXIndex::instance + = (int)(DAT_MenuModalComposition1::instance.activeModalDialogID != OpenSHC::UI::Enums::MMT_NONE); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(DAT_UnknownGFXIndex::instance, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[DAT_UnknownGFXIndex::instance].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[DAT_UnknownGFXIndex::instance].height) + / 2); + if (DAT_MenuTextInputState::instance.dialogResult == 1) { + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_MAP_EDITOR_PROPERTIES, 0); + } + if (DAT_MenuTextInputState::instance.dialogResult == -1) { + MACRO_CALL(OpenSHC::UI::MenuViews::CustomScenarios_Func::MenuView_CustomScenarios_Prepare)(); + return; + } + return; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 31d9b68104..0ac588aec4 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6755,7 +6755,7 @@ SHC_3BB0A8C1_0x00425EA0 | 0.0% | Pending SHC_3BB0A8C1_0x00425F60 | 0.0% | Pending -SHC_3BB0A8C1_0x00425FF0 | 0.0% | Pending +SHC_3BB0A8C1_0x00425FF0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00426060 | 100.0% | Reimplemented From 6fa6b170e2c4a03c980e9be6ffe17001db47b77a Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:47:58 +0100 Subject: [PATCH 09/58] reimplement: SHC_3BB0A8C1_0x00425EA0 100.0% Reimplemented MenuView_CustomScenarios_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 459b8d979 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x00425EA0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_CustomScenarios_Prepare.cpp | 59 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp new file mode 100644 index 0000000000..ddce18ad27 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp @@ -0,0 +1,59 @@ +#include "../CustomScenarios.func.hpp" + +#include "OpenSHC/Game/GameStateStructures.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/UI/Enums/BuildingsAndStatusMenuTabType.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UIButtonDefinedData.hpp" +#include "OpenSHC/Globals/DAT_UnknownGFXIndex.hpp" +#include "OpenSHC/Globals/INT_00b95abc.hpp" +#include "OpenSHC/Globals/INT_00b960e4.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using Game::GameMode2; + using UI::Enums::BuildingsAndStatusMenuTabType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00425EA0 + void CustomScenarios::MenuView_CustomScenarios_Prepare() + { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("frontend_builder.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("frontend_builder2.tgx"); + MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); + DWORD DVar1 = timeGetTime(); + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x16c].stateTransitionTimeBaseUnk_0x18 + = DVar1 - 0x12c0; + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x16d].stateTransitionTimeBaseUnk_0x18 = DVar1 - 0xc80; + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x16e].stateTransitionTimeBaseUnk_0x18 = DVar1 - 0x640; + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x16f].stateTransitionTimeBaseUnk_0x18 = DVar1; + INT_00b95abc::instance = -1; + DAT_MenuTextInputState::instance.dialogResult = 0; + DAT_GameCore::instance.missionNumber1to20 = 0; + DAT_GameCore::instance.mapLoadedForEditor = 0; + DAT_GameCore::instance.gameMode_2 = Game::GM_EDITOR; + INT_00b960e4::instance = 0; + if (!DAT_GameSynchronyState::instance.currentPlayerSlotID) { + DAT_GameSynchronyState::instance.currentPlayerSlotID = 1; + } + DAT_GameSynchronyState::instance + .currentPlayerFullIDArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] = 1; + MACRO_CALL_MEMBER(Game::GameStateStructures_Func::resetTeams, DAT_GameState::ptr)(); + DAT_UnknownGFXIndex::instance = 0; + DAT_GameCore::instance.buildmenuMenuTabToSwitchTo.tabType = UI::Enums::BASMTT_HUNTERSHUT; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 0ac588aec4..36a4ba3459 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6751,7 +6751,7 @@ SHC_3BB0A8C1_0x00425E90 | 0.0% | Pending SHC_3BB0A8C1_0x00425E94 | 0.0% | Pending -SHC_3BB0A8C1_0x00425EA0 | 0.0% | Pending +SHC_3BB0A8C1_0x00425EA0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00425F60 | 0.0% | Pending From e2e3e49743a2b3e8dc8317ea12deebec16bdcbc8 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:47:58 +0100 Subject: [PATCH 10/58] reimplement: SHC_3BB0A8C1_0x004406F0 100.0% Reimplemented MenuView_GameStartEnterName_DoInitial, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 6ee93e3b2 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004406F0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_GameStartEnterName_DoInitial.cpp | 45 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/GameStartEnterName/MenuView_GameStartEnterName_DoInitial.cpp diff --git a/src/OpenSHC/UI/MenuViews/GameStartEnterName/MenuView_GameStartEnterName_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/GameStartEnterName/MenuView_GameStartEnterName_DoInitial.cpp new file mode 100644 index 0000000000..0e3e197eb9 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/GameStartEnterName/MenuView_GameStartEnterName_DoInitial.cpp @@ -0,0 +1,45 @@ +#include "../GameStartEnterName.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004406F0 + void GameStartEnterName::MenuView_GameStartEnterName_DoInitial() + { + Menu* pMVar1; + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + (ushort)(COL_BLACK::instance.shortValue)); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + MACRO_CALL_MEMBER( + UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + return; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 36a4ba3459..5c4aaf9619 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -13645,7 +13645,7 @@ SHC_3BB0A8C1_0x00440560 | 0.0% | Pending SHC_3BB0A8C1_0x00440600 | 0.0% | Pending -SHC_3BB0A8C1_0x004406F0 | 0.0% | Pending +SHC_3BB0A8C1_0x004406F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00440770 | 0.0% | Pending From 0a9124fc8d4a9010af14c83da18540badbc95315 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:47:59 +0100 Subject: [PATCH 11/58] reimplement: SHC_3BB0A8C1_0x004DB5C0 100.0% Reimplemented MenuView_General_DoInitial_BlackBorderAndGfx, gynt's version as it stands on his fork's archive/UI-MenuViews-development-second-pass at 32939bbc1 (2026-10-25), where its status line reads 100.0%; that commit is also the last one to change the file. Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...ew_General_DoInitial_BlackBorderAndGfx.cpp | 26 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBorderAndGfx.cpp diff --git a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBorderAndGfx.cpp b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBorderAndGfx.cpp new file mode 100644 index 0000000000..7bd65a7848 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBorderAndGfx.cpp @@ -0,0 +1,26 @@ +#include "../General.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004DB5C0 + void General::MenuView_General_DoInitial_BlackBorderAndGfx() + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, + 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + (ushort)(COL_BLACK::instance.shortValue)); + MACRO_CALL(OpenSHC::UI::Rendering_Func::DrawOuterMenuBorder)(); + MACRO_CALL(OpenSHC::UI::Rendering_Func::RenderGfxHelperUnk)(0, 0, 0); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 5c4aaf9619..c5948a69f8 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -36201,7 +36201,7 @@ SHC_3BB0A8C1_0x004DB490 | 100.0% | Reimplemented, mismatches in float constants SHC_3BB0A8C1_0x004DB4F0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004DB5C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004DB5C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DB600 | 0.0% | Pending From 13245717a92cf6d96631b29512b24ca7cf919127 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:47:59 +0100 Subject: [PATCH 12/58] reimplement: SHC_3BB0A8C1_0x00425F60 100.0% Reimplemented MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 3cb6e95d4 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x00425F60 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...nitial_BlackBoxDefaultBorderAndPicture.cpp | 46 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture.cpp diff --git a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture.cpp b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture.cpp new file mode 100644 index 0000000000..f6668ea769 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture.cpp @@ -0,0 +1,46 @@ +#include "../General.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UnknownGFXIndex.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00425F60 + void General::MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture() + { + Menu* pMVar1; + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + (ushort)(COL_BLACK::instance.shortValue)); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(DAT_UnknownGFXIndex::instance, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[DAT_UnknownGFXIndex::instance].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[DAT_UnknownGFXIndex::instance].height) + / 2); + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + return; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index c5948a69f8..fa2d79721d 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6753,7 +6753,7 @@ SHC_3BB0A8C1_0x00425E94 | 0.0% | Pending SHC_3BB0A8C1_0x00425EA0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00425F60 | 0.0% | Pending +SHC_3BB0A8C1_0x00425F60 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00425FF0 | 100.0% | Reimplemented From 6762fdfad8982c768946899789d15eba953ef372 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:47:59 +0100 Subject: [PATCH 13/58] reimplement: SHC_3BB0A8C1_0x004DD750 100.0% Reimplemented MenuView_General_DoInitial_CrusadeAndRankMenu, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 28a288b34 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004DD750 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...w_General_DoInitial_CrusadeAndRankMenu.cpp | 35 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_CrusadeAndRankMenu.cpp diff --git a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_CrusadeAndRankMenu.cpp b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_CrusadeAndRankMenu.cpp new file mode 100644 index 0000000000..8d4c02a460 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_CrusadeAndRankMenu.cpp @@ -0,0 +1,35 @@ +#include "../General.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004DD750 + void General::MenuView_General_DoInitial_CrusadeAndRankMenu() + { + Menu* pMVar1; + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + (ushort)(COL_BLACK::instance.shortValue)); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL(UI::Rendering_Func::RenderGfxHelperUnk)(0, 0, 0); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index fa2d79721d..f00875e7cb 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -36269,7 +36269,7 @@ SHC_3BB0A8C1_0x004DD300 | 0.0% | Pending SHC_3BB0A8C1_0x004DD350 | 0.0% | Pending -SHC_3BB0A8C1_0x004DD750 | 0.0% | Pending +SHC_3BB0A8C1_0x004DD750 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DD7B0 | 0.0% | Pending From 16cf013c7fc42628e4341f46b0d571e23ea6ffc7 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:00 +0100 Subject: [PATCH 14/58] reimplement: SHC_3BB0A8C1_0x004276F0 100.0% Reimplemented MenuView_General_DoInitial_DefaultMainMenuStructure, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 20a601e0d (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004276F0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...ral_DoInitial_DefaultMainMenuStructure.cpp | 34 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_DefaultMainMenuStructure.cpp diff --git a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_DefaultMainMenuStructure.cpp b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_DefaultMainMenuStructure.cpp new file mode 100644 index 0000000000..904f716cde --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_DefaultMainMenuStructure.cpp @@ -0,0 +1,34 @@ +#include "../General.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004276F0 + void General::MenuView_General_DoInitial_DefaultMainMenuStructure() + { + Menu* pMVar1; + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + (ushort)(COL_BLACK::instance.shortValue)); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index f00875e7cb..14db8d4958 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6815,7 +6815,7 @@ SHC_3BB0A8C1_0x00427320 | 0.0% | Pending SHC_3BB0A8C1_0x004274F0 | 0.0% | Pending -SHC_3BB0A8C1_0x004276F0 | 0.0% | Pending +SHC_3BB0A8C1_0x004276F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00427740 | 0.0% | Pending From d2b2e937bfb56443a97a21c101456f5457bc1db7 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:00 +0100 Subject: [PATCH 15/58] reimplement: SHC_3BB0A8C1_0x00430100 100.0% Reimplemented MenuView_General_DoInitial_ScreenToBlack, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 225b15f31 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x00430100 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...nuView_General_DoInitial_ScreenToBlack.cpp | 32 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_ScreenToBlack.cpp diff --git a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_ScreenToBlack.cpp b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_ScreenToBlack.cpp new file mode 100644 index 0000000000..c2e43b8b92 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_ScreenToBlack.cpp @@ -0,0 +1,32 @@ +#include "../General.func.hpp" + +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00430100 + void General::MenuView_General_DoInitial_ScreenToBlack() + { + Menu* pMVar1; + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + (ushort)(COL_BLACK::instance.shortValue)); + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 14db8d4958..849c7f3f2e 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -9625,7 +9625,7 @@ SHC_3BB0A8C1_0x004300F3 | 0.0% | Pending SHC_3BB0A8C1_0x004300F4 | 0.0% | Pending -SHC_3BB0A8C1_0x00430100 | 0.0% | Pending +SHC_3BB0A8C1_0x00430100 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00430150 | 100.0% | Reimplemented From bbc7f650ebea31dd5d9f9850de5e1507ac299b5c Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:00 +0100 Subject: [PATCH 16/58] reimplement: SHC_3BB0A8C1_0x004DBAF0 100.0% Reimplemented MenuView_HistoricCampaignIntro_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 7c3401670 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004DBAF0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...MenuView_HistoricCampaignIntro_Prepare.cpp | 67 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp b/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp new file mode 100644 index 0000000000..b360a1659b --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp @@ -0,0 +1,67 @@ +#include "../HistoricCampaignIntro.func.hpp" + +#include "OpenSHC/Rendering.func.hpp" +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" + +#include "OpenSHC/Globals/DAT_00eb0b20.hpp" +#include "OpenSHC/Globals/DAT_00ed2780.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_NumberOfStoredMenuStrings.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/FLOAT_00ec0834.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using DE::SHCDE::eTextSections; + + // FUNCTION: STRONGHOLDCRUSADER 0x004DBAF0 + void HistoricCampaignIntro::MenuView_HistoricCampaignIntro_Prepare() + { + char* pcVar1; + MACRO_CALL(UI::Helpers_Func::PrepareHistoryBook)(); + switch (DAT_GameCore::instance.historicCampaignNumber) { + case 1: + DAT_00eb0b20::instance = MACRO_CALL_MEMBER( + UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("c1pic.tgx"); + break; + case 2: + DAT_00eb0b20::instance = MACRO_CALL_MEMBER( + UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("c2pic.tgx"); + break; + case 3: + DAT_00eb0b20::instance = MACRO_CALL_MEMBER( + UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("c3pic.tgx"); + break; + case 4: + DAT_00eb0b20::instance = MACRO_CALL_MEMBER( + UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("c4pic.tgx"); + break; + } + DAT_NumberOfStoredMenuStrings::instance = 0; + pcVar1 + = MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( + DE::SHCDE::TEXT_CAMPAIGN_INFO, (int)(DAT_GameCore::instance.historicCampaignNumber * 6 + -5)); + MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)(pcVar1); + pcVar1 + = MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( + DE::SHCDE::TEXT_CAMPAIGN_INFO, (int)(DAT_GameCore::instance.historicCampaignNumber * 6 + -4)); + MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)(pcVar1); + MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); + FLOAT_00ec0834::instance = 0.0; + DAT_00ed2780::instance = 1; + MACRO_CALL(Rendering_Func::TicksStartCounter)(); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 849c7f3f2e..ecfb174fb9 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -36209,7 +36209,7 @@ SHC_3BB0A8C1_0x004DB7B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DB8B0 | 0.0% | Pending -SHC_3BB0A8C1_0x004DBAF0 | 0.0% | Pending +SHC_3BB0A8C1_0x004DBAF0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DBBA4 | 0.0% | Pending From 4af1fea4fdb2c167b63330f572c3a1295a51b86d Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:00 +0100 Subject: [PATCH 17/58] reimplement: SHC_3BB0A8C1_0x00425580 100.0% Reimplemented MenuView_HistoricCampaignSelect_DoEveryFrame, gynt's version as it stands on his fork's archive/UI-MenuViews-development-second-pass at 32939bbc1 (2026-10-25), where its status line reads 100.0%; that commit is also the last one to change the file. Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...ew_HistoricCampaignSelect_DoEveryFrame.cpp | 35 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_DoEveryFrame.cpp diff --git a/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_DoEveryFrame.cpp new file mode 100644 index 0000000000..0ea1602773 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_DoEveryFrame.cpp @@ -0,0 +1,35 @@ +#include "../HistoricCampaignSelect.func.hpp" + +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" + +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UnknownGFXIndex.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using OpenSHC::UI::Enums::MenuModalType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00425580 + void HistoricCampaignSelect::MenuView_HistoricCampaignSelect_DoEveryFrame() + { + DAT_UnknownGFXIndex::instance + = (int)(DAT_MenuModalComposition1::instance.activeModalDialogID != OpenSHC::UI::Enums::MMT_NONE); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(DAT_UnknownGFXIndex::instance, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[DAT_UnknownGFXIndex::instance].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[DAT_UnknownGFXIndex::instance].height) + / 2); + return; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index ecfb174fb9..09a9a901ec 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6709,7 +6709,7 @@ SHC_3BB0A8C1_0x004254F0 | 0.0% | Pending SHC_3BB0A8C1_0x00425500 | 0.0% | Pending -SHC_3BB0A8C1_0x00425580 | 0.0% | Pending +SHC_3BB0A8C1_0x00425580 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004255D0 | 0.0% | Pending From 54a16c9f750189882d146e95e13f218792a9bbbb Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:01 +0100 Subject: [PATCH 18/58] reimplement: SHC_3BB0A8C1_0x00425500 100.0% Reimplemented MenuView_HistoricCampaignSelect_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 8c72f92a4 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x00425500 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...enuView_HistoricCampaignSelect_Prepare.cpp | 45 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp new file mode 100644 index 0000000000..72dc007a0e --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp @@ -0,0 +1,45 @@ +#include "../HistoricCampaignSelect.func.hpp" + +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_MenuModalComposition3.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UIButtonDefinedData.hpp" +#include "OpenSHC/Globals/DAT_UnknownGFXIndex.hpp" +#include "OpenSHC/Globals/INT_00b95abc.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using UI::Enums::MenuModalType; + using WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00425500 + void HistoricCampaignSelect::MenuView_HistoricCampaignSelect_Prepare() + { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("frontend_combat.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("frontend_combat2.tgx"); + MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); + DWORD DVar1 = timeGetTime(); + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x163].stateTransitionTimeBaseUnk_0x18 + = DVar1 - 0x12c0; + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x164].stateTransitionTimeBaseUnk_0x18 = DVar1 - 0xc80; + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x165].stateTransitionTimeBaseUnk_0x18 = DVar1 - 0x640; + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x166].stateTransitionTimeBaseUnk_0x18 = DVar1; + INT_00b95abc::instance = -1; + DAT_UnknownGFXIndex::instance = 0; + MACRO_CALL_MEMBER(UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition3::ptr)(UI::Enums::MMT_NONE, FALSE); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 09a9a901ec..c1cd17d271 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6707,7 +6707,7 @@ SHC_3BB0A8C1_0x004254EC | 0.0% | Pending SHC_3BB0A8C1_0x004254F0 | 0.0% | Pending -SHC_3BB0A8C1_0x00425500 | 0.0% | Pending +SHC_3BB0A8C1_0x00425500 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00425580 | 100.0% | Reimplemented From 020903e75802c842594e39a32c229e4b13284eb5 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:01 +0100 Subject: [PATCH 19/58] reimplement: SHC_3BB0A8C1_0x00426830 100.0% Reimplemented MenuView_HistoricMissionSelect_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in f2a9ee612 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x00426830 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...MenuView_HistoricMissionSelect_Prepare.cpp | 46 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp new file mode 100644 index 0000000000..8e1bad1660 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp @@ -0,0 +1,46 @@ +#include "../HistoricMissionSelect.func.hpp" + +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_00b95b2c.hpp" +#include "OpenSHC/Globals/DAT_00b96100.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00426830 + void HistoricMissionSelect::MenuView_HistoricMissionSelect_Prepare() + { + DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("frontend_combat2.tgx"); + MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); + DAT_GameCore::instance.section1066 = 0; + DAT_MenuTextInputState::instance.lastListClickTime = 0; + DAT_MenuTextInputState::instance.lastClickedListIndex = 0xffffffff; + int iVar1; + if (DAT_GameCore::instance.missionNumber1to20 < 6) { + iVar1 = 0; + } else if (DAT_GameCore::instance.missionNumber1to20 < 0xb) { + iVar1 = 1; + } else if (DAT_GameCore::instance.missionNumber1to20 < 0x10) { + iVar1 = 2; + } else { + iVar1 = 3; + } + DAT_00b95b2c::instance = iVar1; + DAT_00b96100::instance = iVar1 * 5 + 1; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index c1cd17d271..518ad268d4 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6777,7 +6777,7 @@ SHC_3BB0A8C1_0x00426750 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004267F0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00426830 | 0.0% | Pending +SHC_3BB0A8C1_0x00426830 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004268C0 | 0.0% | Pending From 36a242a397ee078487c6aee955b348e7fea83acb Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:01 +0100 Subject: [PATCH 20/58] reimplement: SHC_3BB0A8C1_0x00424720 100.0% Reimplemented MenuView_IntroLogos_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in b7a43d120 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x00424720 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_IntroLogos_Prepare.cpp | 32 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_Prepare.cpp b/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_Prepare.cpp new file mode 100644 index 0000000000..dc0b674406 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_Prepare.cpp @@ -0,0 +1,32 @@ +#include "../IntroLogos.func.hpp" + +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_IntroBlendStrength.hpp" +#include "OpenSHC/Globals/DAT_IntroStep.hpp" +#include "OpenSHC/Globals/DAT_IntroTimestamp.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00424720 + void IntroLogos::MenuView_IntroLogos_Prepare() + { + if (!DAT_IntroStep::instance) { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("logo1.tgx"); + } else if (DAT_IntroStep::instance == 1) { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("logo2.tgx"); + } + DAT_IntroBlendStrength::instance = 0; + DAT_IntroTimestamp::instance = timeGetTime(); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 518ad268d4..b63af5d586 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6661,7 +6661,7 @@ SHC_3BB0A8C1_0x004246E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424700 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00424720 | 0.0% | Pending +SHC_3BB0A8C1_0x00424720 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424770 | 100.0% | Reimplemented From a7c8be24609080d2288e49ca92b66804613a2481 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:02 +0100 Subject: [PATCH 21/58] reimplement: SHC_3BB0A8C1_0x00424AD0 100.0% Reimplemented MenuView_IntroVideo_DoEveryFrame, gynt's version as it stands on his fork's archive/UI-MenuViews-development-second-pass at 32939bbc1 (2026-10-25), where its status line reads 100.0%; that commit is also the last one to change the file. Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_IntroVideo_DoEveryFrame.cpp | 38 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_DoEveryFrame.cpp diff --git a/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_DoEveryFrame.cpp new file mode 100644 index 0000000000..d1239578da --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_DoEveryFrame.cpp @@ -0,0 +1,38 @@ +#include "../IntroVideo.func.hpp" + +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/Rendering/Bink/BinkControlClass.func.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_BinkControlState.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_MouseState.hpp" +#include "OpenSHC/Globals/TIME_IntroVideo_Prepare.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using OpenSHC::UI::Enums::MenuViewType; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00424AD0 + void IntroVideo::MenuView_IntroVideo_DoEveryFrame() + { + DWORD DVar1 = timeGetTime(); + if (400 <= DVar1 - TIME_IntroVideo_Prepare::instance) { + if (DAT_MouseState::instance.draggingStopped != FALSE) { + MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::BinkControlClass_Func::stopBinkPlayback, + DAT_BinkControlState::ptr)(0); + } + if (DAT_BinkControlState::instance.binkObjPtrArray[0] == (HBINK)0x0) { + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_GAME_START_ENTER_NAME, 0); + } + } + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index b63af5d586..34acf73d88 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6671,7 +6671,7 @@ SHC_3BB0A8C1_0x00424990 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424A50 | 0.0% | Pending -SHC_3BB0A8C1_0x00424AD0 | 0.0% | Pending +SHC_3BB0A8C1_0x00424AD0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424B10 | 100.0% | Reimplemented From f2e23914639d25a7cc013ed9cf3dd003e0169800 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:02 +0100 Subject: [PATCH 22/58] reimplement: SHC_3BB0A8C1_0x00424A50 100.0% Reimplemented MenuView_IntroVideo_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in dfb6eacd7 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x00424A50 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_IntroVideo_Prepare.cpp | 38 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_Prepare.cpp b/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_Prepare.cpp new file mode 100644 index 0000000000..eba6627f9e --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_Prepare.cpp @@ -0,0 +1,38 @@ +#include "../IntroVideo.func.hpp" + +#include "OpenSHC/Rendering/Bink/BinkControlClass.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_BinkControlState.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/TIME_IntroVideo_Prepare.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00424A50 + void IntroVideo::MenuView_IntroVideo_Prepare() + { + Menu* pMVar1; + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, + 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + (ushort)((int)(COL_BLACK::instance.shortValue))); + MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::BinkControlClass_Func::playBINK, DAT_BinkControlState::ptr)(0, + "intro.bik", 0, 0, DAT_MenuHandlerState::instance.x + 0x50, DAT_MenuHandlerState::instance.y + 0x3c, 0); + TIME_IntroVideo_Prepare::instance = timeGetTime(); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 34acf73d88..833929540a 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6669,7 +6669,7 @@ SHC_3BB0A8C1_0x004247A0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424990 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00424A50 | 0.0% | Pending +SHC_3BB0A8C1_0x00424A50 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424AD0 | 100.0% | Reimplemented From 81e971633264a2b75239134365aeccf05906c79f Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:02 +0100 Subject: [PATCH 23/58] reimplement: SHC_3BB0A8C1_0x00427320 100.0% Reimplemented MenuView_LobbyMenu_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 8327b9cd5 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x00427320 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../LobbyMenu/MenuView_LobbyMenu_Prepare.cpp | 103 ++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp new file mode 100644 index 0000000000..cfecbedd12 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp @@ -0,0 +1,103 @@ +#include "../LobbyMenu.func.hpp" + +#include "OpenSHC/Text/UserTextHandler.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/Game/TrailType.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition3.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UserTextHandlerState.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/INT_00b95f6c.hpp" +#include "OpenSHC/Globals/INT_00b960f0.hpp" +#include "OpenSHC/Globals/INT_00b960fc.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using Game::GameMode2; + using Game::TrailType; + using UI::Enums::MenuModalType; + using WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00427320 + void LobbyMenu::MenuView_LobbyMenu_Prepare() + { + Menu* pMVar1; + MACRO_CALL_MEMBER(UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition3::ptr)(UI::Enums::MMT_NONE, FALSE); + DAT_GameCore::instance.gameMode_2 = Game::GM_SKIRMISH_AND_MULTIPLAYER; + DAT_GameCore::instance.currentTrailType = Game::TT_FIRST_EDITION; + DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; + DAT_GameSynchronyState::instance.field225_0x106ee4 = 0; + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("frontend_combat3.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("firefly-small.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("table.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("tslice1.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("tslice2.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("tslice3.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("tslice4.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("tslice5.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("tslice6.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("tslice7.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("tslice8.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("tslice1b.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("tslice2b.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("tslice3b.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("tslice4b.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("tslice5b.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("tslice6b.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("tslice7b.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("tslice8b.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("pick_opponent_normal.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("pick_opponent_large.tgx"); + MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + DAT_UserTextHandlerState::instance.allowUserTextInput = 0; + MACRO_CALL_MEMBER(Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)(4); + MACRO_CALL_MEMBER(Text::UserTextHandler_Func::clearTextAndCursor, DAT_UserTextHandlerState::ptr)(); + INT_00b960fc::instance = timeGetTime(); + INT_00b95f6c::instance = 0; + INT_00b960f0::instance = INT_00b960fc::instance; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 833929540a..934cbeb9f2 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6811,7 +6811,7 @@ SHC_3BB0A8C1_0x00427240 | 0.0% | Pending SHC_3BB0A8C1_0x004272C0 | 0.0% | Pending -SHC_3BB0A8C1_0x00427320 | 0.0% | Pending +SHC_3BB0A8C1_0x00427320 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004274F0 | 0.0% | Pending From 92007cea595504a789b2c7ad57cf3fdc3ab56614 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:02 +0100 Subject: [PATCH 24/58] reimplement: SHC_3BB0A8C1_0x00424CD0 100.0% Reimplemented MenuView_MainMenu_DoInitial, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 440a25ee5 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x00424CD0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MainMenu/MenuView_MainMenu_DoInitial.cpp | 56 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_DoInitial.cpp diff --git a/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_DoInitial.cpp new file mode 100644 index 0000000000..f6b9271871 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_DoInitial.cpp @@ -0,0 +1,56 @@ +#include "../MainMenu.func.hpp" + +#include "OpenSHC/Rendering/Bink/BinkControlClass.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_BinkControlState.hpp" +#include "OpenSHC/Globals/DAT_MainMenuSwingSwordBool.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UnknownGFXIndex.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/INT_00b95f68.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00424CD0 + void MainMenu::MenuView_MainMenu_DoInitial() + { + Menu* _menu; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, + 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + (ushort)((int)(COL_BLACK::instance.shortValue))); + MACRO_CALL(OpenSHC::UI::Rendering_Func::DrawOuterMenuBorder)(); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(DAT_UnknownGFXIndex::instance, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[DAT_UnknownGFXIndex::instance].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[DAT_UnknownGFXIndex::instance].height) + / 2); + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + _menu = DAT_MenuHandlerState::instance.currentMenu; + _menu->xPosition = borderWidth; + _menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + INT_00b95f68::instance = 0; + MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::BinkControlClass_Func::playBINK, DAT_BinkControlState::ptr)(0, + "richard_swordswing.bik", 0, 0, + (int)((int)(DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 508)), + (int)((int)(DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 22)), 0); + DAT_MainMenuSwingSwordBool::instance = 0; + return; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 934cbeb9f2..75b15706fe 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6681,7 +6681,7 @@ SHC_3BB0A8C1_0x00424BE0 | 0.0% | Pending SHC_3BB0A8C1_0x00424C40 | 0.0% | Pending -SHC_3BB0A8C1_0x00424CD0 | 0.0% | Pending +SHC_3BB0A8C1_0x00424CD0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424DA0 | 100.0% | Reimplemented From 66e3f8cb0bed040309819ddb5b305ed00b10be25 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:03 +0100 Subject: [PATCH 25/58] reimplement: SHC_3BB0A8C1_0x00424C40 100.0% Reimplemented MenuView_MainMenu_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-development-second-pass at 32939bbc1 (2026-10-25), where its status line reads 100.0%; that commit is also the last one to change the file. Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MainMenu/MenuView_MainMenu_Prepare.cpp | 54 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_Prepare.cpp new file mode 100644 index 0000000000..86d6ce8966 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_Prepare.cpp @@ -0,0 +1,54 @@ +#include "../MainMenu.func.hpp" + +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_MainMenuSwingSwordBool.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition2.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition3.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UnknownGFXIndex.hpp" +#include "OpenSHC/Globals/INT_00b95abc.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using OpenSHC::Game::GameMode2; + using OpenSHC::UI::Enums::MenuModalType; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00424C40 + void MainMenu::MenuView_MainMenu_Prepare() + { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("frontend_main.tgx"); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("frontend_main2.tgx"); + MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); + INT_00b95abc::instance = -1; + DAT_UnknownGFXIndex::instance = 0; + DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; + DAT_GameCore::instance.gameMode_2 = OpenSHC::Game::GM_CAMPAIGN_MISSION; + DAT_MainMenuSwingSwordBool::instance = 0; + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition1::ptr)(OpenSHC::UI::Enums::MMT_NONE, FALSE); + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition2::ptr)(OpenSHC::UI::Enums::MMT_NONE, FALSE); + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition3::ptr)(OpenSHC::UI::Enums::MMT_NONE, FALSE); + DAT_GameState::instance.mapAndTime.difficulty = 1; + DAT_GameCore::instance.missionDifficulty_3 = 1; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 75b15706fe..bfda9c6a33 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6679,7 +6679,7 @@ SHC_3BB0A8C1_0x00424BD0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424BE0 | 0.0% | Pending -SHC_3BB0A8C1_0x00424C40 | 0.0% | Pending +SHC_3BB0A8C1_0x00424C40 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424CD0 | 100.0% | Reimplemented From b95520c7546532a9c3e9e31c8f2f8d4bedf349cf Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:03 +0100 Subject: [PATCH 26/58] reimplement: SHC_3BB0A8C1_0x004313C0 100.0% Reimplemented MenuView_MapEditorLandscaping_DoEveryFrame, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in baf5a43ae (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004313C0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...View_MapEditorLandscaping_DoEveryFrame.cpp | 47 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp diff --git a/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp new file mode 100644 index 0000000000..aa0e49da80 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp @@ -0,0 +1,47 @@ +#include "../MapEditorLandscaping.func.hpp" + +#include "OpenSHC/UI/MinimapViewState.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eGM.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/UI/Enums/BuildingsAndStatusMenuTabType.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_MinimapViewState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using OpenSHC::DE::SHCDE::eGM; + using OpenSHC::Rendering::Enums::RenderTarget; + using OpenSHC::UI::Enums::BuildingsAndStatusMenuTabType; + + // FUNCTION: STRONGHOLDCRUSADER 0x004313C0 + void MapEditorLandscaping::MenuView_MapEditorLandscaping_DoEveryFrame() + { + if ((DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_SIEGETENT_SIEGETOWER) + || (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_SIEGETENT_SHIELD)) { + return; + } + if (!DAT_MinimapViewState::instance.field3_0xc) { + DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated = 2; + } else if (DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated != 2) + goto LAB_00431429; + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_PANELS, 3, + DAT_MenuHandlerState::instance.x, DAT_MenuHandlerState::instance.y + 0x1b2); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + LAB_00431429: + DAT_MinimapViewState::instance.needsRedraw = 1; + MACRO_CALL_MEMBER(OpenSHC::UI::MinimapViewState_Func::renderMinimapLandscaping, DAT_MinimapViewState::ptr)( + DAT_MenuHandlerState::instance.x + 0x298, DAT_MenuHandlerState::instance.y + 0x1d0, 0x80, 0x80); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index bfda9c6a33..dfa98edcd7 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -10539,7 +10539,7 @@ SHC_3BB0A8C1_0x00430CC0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00430CE0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004313C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004313C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00431460 | 100.0% | Reimplemented From ea96c7ca957e793f75b1c8c77fafadb5dd3ad01c Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:03 +0100 Subject: [PATCH 27/58] reimplement: SHC_3BB0A8C1_0x004268C0 100.0% Reimplemented MenuView_MissionSelect_DoEveryFrame, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 57e21acd4 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004268C0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_MissionSelect_DoEveryFrame.cpp | 62 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/MissionSelect/MenuView_MissionSelect_DoEveryFrame.cpp diff --git a/src/OpenSHC/UI/MenuViews/MissionSelect/MenuView_MissionSelect_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/MissionSelect/MenuView_MissionSelect_DoEveryFrame.cpp new file mode 100644 index 0000000000..4c055bcd72 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/MissionSelect/MenuView_MissionSelect_DoEveryFrame.cpp @@ -0,0 +1,62 @@ +#include "../MissionSelect.func.hpp" + +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" + +#include "OpenSHC/Globals/COL_VERY_SOFT_YELLOW.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using OpenSHC::Rendering::Enums::RenderTarget; + using OpenSHC::UI::Enums::MenuModalType; + + // FUNCTION: STRONGHOLDCRUSADER 0x004268C0 + void MissionSelect::MenuView_MissionSelect_DoEveryFrame() + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + if ((DAT_MenuTextInputState::instance.currentModalDialog == OpenSHC::UI::Enums::MMT_NO_MENU) + && (DAT_MenuModalComposition1::instance.activeModalDialogID == OpenSHC::UI::Enums::MMT_NONE)) { + int y1 = DAT_MenuHandlerState::instance.y + 0xbe; + int x2 = DAT_MenuHandlerState::instance.x + 0x23a; + int x1 = DAT_MenuHandlerState::instance.x + 0xe5; + int y2 = DAT_MenuHandlerState::instance.y + 0x121; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y1 - 1, x2, y1 - 1, (ushort)((int)(COL_VERY_SOFT_YELLOW::instance.shortValue))); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y2 + 1, x2, y2 + 1, (ushort)((int)(COL_VERY_SOFT_YELLOW::instance.shortValue))); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y1, x1, y2, (ushort)((int)(COL_VERY_SOFT_YELLOW::instance.shortValue))); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x2, y1, x2, y2, (ushort)((int)(COL_VERY_SOFT_YELLOW::instance.shortValue))); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + /* + added by script: "Mission" + */ + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, DAT_PencilRenderCore::ptr)(5, + 0xf, DAT_MenuHandlerState::instance.x + 0xb8, DAT_MenuHandlerState::instance.y + 100, 0x1b0, 0x32); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + return; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index dfa98edcd7..433774d3cb 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6779,7 +6779,7 @@ SHC_3BB0A8C1_0x004267F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00426830 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004268C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004268C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004269E0 | 0.0% | Pending From b84673929ad3d1e7d5000f4f9377e284f8dc7db0 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:04 +0100 Subject: [PATCH 28/58] reimplement: SHC_3BB0A8C1_0x00427110 100.0% Reimplemented MenuView_MpConnection_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 5f0385e45 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x00427110 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_MpConnection_Prepare.cpp | 47 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/MpConnection/MenuView_MpConnection_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/MpConnection/MenuView_MpConnection_Prepare.cpp b/src/OpenSHC/UI/MenuViews/MpConnection/MenuView_MpConnection_Prepare.cpp new file mode 100644 index 0000000000..13a89221ac --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/MpConnection/MenuView_MpConnection_Prepare.cpp @@ -0,0 +1,47 @@ +#include "../MpConnection.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00427110 + void MpConnection::MenuView_MpConnection_Prepare() + { + Menu* pMVar1; + DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("frontend_combat3.tgx"); + MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL_MEMBER( + Synchrony::GameSynchronyState_Func::initializeMultiplayerLobby, DAT_GameSynchronyState::ptr)(); + MACRO_CALL_MEMBER( + UI::MenuModalComposition_Func::activateModalDialog, DAT_MenuModalComposition1::ptr)( + (UI::Enums::MenuModalType)DAT_GameSynchronyState::instance.nextModalDialog, FALSE); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 433774d3cb..c18fc460f5 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6799,7 +6799,7 @@ SHC_3BB0A8C1_0x00426FB0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00427080 | 0.0% | Pending -SHC_3BB0A8C1_0x00427110 | 0.0% | Pending +SHC_3BB0A8C1_0x00427110 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00427180 | 100.0% | Reimplemented From 8d7c267758cae905f6ddae9257a7981c22ab49e9 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:04 +0100 Subject: [PATCH 29/58] reimplement: SHC_3BB0A8C1_0x004DD300 100.0% Reimplemented MenuView_ScenarioDescription_DoInitial, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in e76bc7ca2 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004DD300 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...MenuView_ScenarioDescription_DoInitial.cpp | 32 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/ScenarioDescription/MenuView_ScenarioDescription_DoInitial.cpp diff --git a/src/OpenSHC/UI/MenuViews/ScenarioDescription/MenuView_ScenarioDescription_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/ScenarioDescription/MenuView_ScenarioDescription_DoInitial.cpp new file mode 100644 index 0000000000..cd80d788e9 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/ScenarioDescription/MenuView_ScenarioDescription_DoInitial.cpp @@ -0,0 +1,32 @@ +#include "../ScenarioDescription.func.hpp" + +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004DD300 + void ScenarioDescription::MenuView_ScenarioDescription_DoInitial() + { + Menu* pMVar1; + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL(UI::Helpers_Func::ColorEntireScreen)(COL_BLACK::instance.shortValue); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + MACRO_CALL(UI::Rendering_Func::RenderGfxHelperUnk)(0, 0, 0); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index c18fc460f5..21ceb28b36 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -36265,7 +36265,7 @@ SHC_3BB0A8C1_0x004DD0C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DD100 | 0.0% | Pending -SHC_3BB0A8C1_0x004DD300 | 0.0% | Pending +SHC_3BB0A8C1_0x004DD300 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DD350 | 0.0% | Pending From da5576171050e58d691c91df9b871c1a7e6d66c7 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:04 +0100 Subject: [PATCH 30/58] reimplement: SHC_3BB0A8C1_0x0042BBF0 100.0% Reimplemented MenuView_SelectCrusade_DoEveryFrame, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in a4b029836 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x0042BBF0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_SelectCrusade_DoEveryFrame.cpp | 193 ++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 194 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoEveryFrame.cpp diff --git a/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoEveryFrame.cpp new file mode 100644 index 0000000000..d2828dc640 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoEveryFrame.cpp @@ -0,0 +1,193 @@ +#include "../SelectCrusade.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/BGR24.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_HighlightedSkirmishType.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using OpenSHC::DE::SHCDE::eTextSections; + using OpenSHC::Rendering::Colors::BGR24; + using OpenSHC::Rendering::Enums::RenderTarget; + using OpenSHC::Text::TextAlignment; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x0042BBF0 + void SelectCrusade::MenuView_SelectCrusade_DoEveryFrame() + { + int iVar1; + int iVar3; + TextAlignment TVar4; + BGR24 BVar5; + int iVar6; + BOOLEnum BVar7; + int iVar8; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBorderedBoxWithBlendedBackground, + DAT_PencilRenderCore::ptr)(DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 0x58, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 100, 0x270, 400); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderBanner, + DAT_PencilRenderCore::ptr)(DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 0x58, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 100, 0x270, 400); + iVar8 = 0; + BVar7 = FALSE; + iVar6 = 0x10; + BVar5 = 0xccfaff; + TVar4 = OpenSHC::Text::TTA_CENTER; + iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 0x82; + iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + /* + added by script: "Choose type of Crusader game" + */ + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE, 0), + iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); + if (DAT_HighlightedSkirmishType::instance == 1) { + iVar8 = 0; + BVar7 = FALSE; + iVar6 = 0x10; + BVar5 = 0xccfaff; + TVar4 = OpenSHC::Text::TTA_CENTER; + iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; + iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + /* + added by script: "Crusader 'First Edition' Trail" + */ + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE, 1), + iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); + iVar8 = 0; + BVar7 = FALSE; + iVar6 = 0x11; + BVar5 = 0xccfaff; + TVar4 = OpenSHC::Text::TTA_CENTER; + iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 0x1b8; + iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + /* + added by script: "Fight through 50 linked Crusader games" + */ + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE, 2), + iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); + } + if (DAT_HighlightedSkirmishType::instance == 2) { + iVar8 = 0; + BVar7 = FALSE; + iVar6 = 0x10; + BVar5 = 0xccfaff; + TVar4 = OpenSHC::Text::TTA_CENTER; + iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; + iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + /* + added by script: "Custom Game" + */ + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE, 3), + iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); + iVar8 = 0; + BVar7 = FALSE; + iVar6 = 0x11; + BVar5 = 0xccfaff; + TVar4 = OpenSHC::Text::TTA_CENTER; + iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 0x1b8; + iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + /* + added by script: "Customize your own Crusader game." + */ + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE, 4), + iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); + } + if (DAT_HighlightedSkirmishType::instance == 3) { + iVar8 = 0; + BVar7 = FALSE; + iVar6 = 0x10; + BVar5 = 0xccfaff; + TVar4 = OpenSHC::Text::TTA_CENTER; + iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; + iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + /* + added by script: "Crusader 'Warchest' Trail" + */ + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 0x15), + iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); + iVar8 = 0; + BVar7 = FALSE; + iVar6 = 0x11; + BVar5 = 0xccfaff; + TVar4 = OpenSHC::Text::TTA_CENTER; + iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 0x1b8; + iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + /* + added by script: "Fight through 30 linked Crusader games" + */ + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 0x16), + iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); + } + if (DAT_HighlightedSkirmishType::instance == 4) { + iVar8 = 0; + BVar7 = FALSE; + iVar6 = 0x10; + BVar5 = 0xccfaff; + TVar4 = OpenSHC::Text::TTA_CENTER; + iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; + iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + /* + added by script: "Crusader Extreme Trail" + */ + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 0x17), + iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); + iVar8 = 0; + BVar7 = FALSE; + iVar6 = 0x11; + BVar5 = 0xccfaff; + TVar4 = OpenSHC::Text::TTA_CENTER; + iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 0x1b8; + iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + /* + added by script: "Fight through 20 linked Extreme games" + */ + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 0x18), + iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); + } + return; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 21ceb28b36..a1c9cf874b 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -7447,7 +7447,7 @@ SHC_3BB0A8C1_0x0042BB70 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042BB90 | 0.0% | Pending -SHC_3BB0A8C1_0x0042BBF0 | 0.0% | Pending +SHC_3BB0A8C1_0x0042BBF0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042BF00 | 100.0% | Reimplemented From 94c6b24fdb660e640c2a4d6ca58457b796fcb0ae Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:04 +0100 Subject: [PATCH 31/58] reimplement: SHC_3BB0A8C1_0x0042BB90 100.0% Reimplemented MenuView_SelectCrusade_DoInitial, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in a7fb6a2b3 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x0042BB90 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_SelectCrusade_DoInitial.cpp | 36 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoInitial.cpp diff --git a/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoInitial.cpp new file mode 100644 index 0000000000..b77cce6ffa --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoInitial.cpp @@ -0,0 +1,36 @@ +#include "../SelectCrusade.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_HighlightedSkirmishType.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x0042BB90 + void SelectCrusade::MenuView_SelectCrusade_DoInitial() + { + Menu* pMVar1; + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + (ushort)(COL_BLACK::instance.shortValue)); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + DAT_HighlightedSkirmishType::instance = 0; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index a1c9cf874b..3c44b7c497 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -7445,7 +7445,7 @@ SHC_3BB0A8C1_0x0042BA50 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042BB70 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0042BB90 | 0.0% | Pending +SHC_3BB0A8C1_0x0042BB90 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042BBF0 | 100.0% | Reimplemented From e2fad7e3008d10dfe1a5ca0ff2bc2c86bca9dc04 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:05 +0100 Subject: [PATCH 32/58] reimplement: SHC_3BB0A8C1_0x00448D40 100.0% Reimplemented MenuView_SingleplayerMapChoice_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 0353c8c0e (2026-10-25, "reimplement: SHC_3BB0A8C1_0x00448D40 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...MenuView_SingleplayerMapChoice_Prepare.cpp | 96 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp b/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp new file mode 100644 index 0000000000..8492dcdc92 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp @@ -0,0 +1,96 @@ +#include "../SingleplayerMapChoice.func.hpp" + +#include "OpenSHC/Map/TileMapState.func.hpp" +#include "OpenSHC/OS.func.hpp" +#include "OpenSHC/Text/UserTextHandler.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuItems/SinglePlayerMapChoice.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Game/GameMode.hpp" +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_00b960dc.hpp" +#include "OpenSHC/Globals/DAT_ButtonBackgroundBlendStrength.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_MapMissionType.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" +#include "OpenSHC/Globals/DAT_MinimapViewState.hpp" +#include "OpenSHC/Globals/DAT_SH1_SiegeAdvancedMode.hpp" +#include "OpenSHC/Globals/DAT_SiegeRemainingPoints.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_TileMapState.hpp" +#include "OpenSHC/Globals/DAT_UserTextHandlerState.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/DWORD_00b95b1c.hpp" +#include "OpenSHC/Globals/INT_00b95b64.hpp" +#include "OpenSHC/Globals/Menu_SingleplayerMapChoice.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using Game::GameMode; + using Game::GameMode2; + using WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00448D40 + void SingleplayerMapChoice::MenuView_SingleplayerMapChoice_Prepare() + { + Menu* pMVar1; + char* tgxFileName; + Menu_SingleplayerMapChoice::instance.thousand = 0; + DAT_MenuTextInputState::instance.lastListClickTime = 0; + DAT_MenuTextInputState::instance.lastClickedListIndex = 0xffffffff; + DAT_GameSynchronyState::instance.currentGameMode = Game::GM_SOLITARY; + DAT_GameCore::instance.gameMode_2 = Game::GM_BUILDERUnk; + if (INT_00b95b64::instance != 0) { + DAT_MenuTextInputState::instance.fileListSortOrder = 0; + DAT_GameSynchronyState::instance.isHost = TRUE; + DAT_GameSynchronyState::instance.currentPlayerSlotID = 1; + DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; + DAT_GameSynchronyState::instance.skirmishRelated1 = -1; + DAT_GameSynchronyState::instance.DAT_MapSelectionRelativeSelected = -1; + DAT_GameSynchronyState::instance.mapName[0] = '\0'; + DAT_GameCore::instance.mapDescription[0] = '\0'; + MACRO_CALL(OS_Func::_memset)(DAT_MinimapViewState::instance.loadedMiniMap, 0, 80000); + DAT_GameSynchronyState::instance.reparseMaps = TRUE; + DAT_SH1_SiegeAdvancedMode::instance = 0; + DAT_SiegeRemainingPoints::instance = 0; + } else { + MACRO_CALL(UI::MenuItems::SinglePlayerMapChoice_Func:: + MenuItemActionHandler_SingleplayerMapChoice_MapTable)( + DAT_GameSynchronyState::instance.DAT_MapSelectionRelativeSelected); + DAT_GameSynchronyState::instance.skirmishRelated1 = 1; + } + DAT_ButtonBackgroundBlendStrength::instance = 0x20; + DAT_00b960dc::instance = 0xfffffffd; + DWORD_00b95b1c::instance = timeGetTime(); + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + if ((int)DAT_MapMissionType::instance < 2) { + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("frontend_economics2.tgx"); + } else { + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("frontend_combat2.tgx"); + } + MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL_MEMBER(Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)(4); + MACRO_CALL_MEMBER(Map::TileMapState_Func::setupAllMapSections, DAT_TileMapState::ptr)(); + INT_00b95b64::instance = 0; + DAT_GameCore::instance.activeMenuTab.tabType + = (UI::Enums::BuildingsAndStatusMenuTabTypeInt)(DAT_MapMissionType::instance != 0); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 3c44b7c497..f39c78a2a0 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -16379,7 +16379,7 @@ SHC_3BB0A8C1_0x004482F0 | 0.0% | Pending SHC_3BB0A8C1_0x004489F0 | 0.0% | Pending -SHC_3BB0A8C1_0x00448D40 | 0.0% | Pending +SHC_3BB0A8C1_0x00448D40 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00448E90 | 0.0% | Pending From 0a8f40df49155c6e7c67d49e205d64c7b7081352 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:05 +0100 Subject: [PATCH 33/58] reimplement: SHC_3BB0A8C1_0x004E1E30 100.0% Reimplemented MenuView_Unknown26_CampaignRelatedUnk_DoInitial, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 63b0ccc81 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004E1E30 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...Unknown26_CampaignRelatedUnk_DoInitial.cpp | 31 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/Unknown26/MenuView_Unknown26_CampaignRelatedUnk_DoInitial.cpp diff --git a/src/OpenSHC/UI/MenuViews/Unknown26/MenuView_Unknown26_CampaignRelatedUnk_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/Unknown26/MenuView_Unknown26_CampaignRelatedUnk_DoInitial.cpp new file mode 100644 index 0000000000..ee5e7d64f8 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/Unknown26/MenuView_Unknown26_CampaignRelatedUnk_DoInitial.cpp @@ -0,0 +1,31 @@ +#include "../Unknown26.func.hpp" + +#include "OpenSHC/Rendering.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004E1E30 + void Unknown26::MenuView_Unknown26_CampaignRelatedUnk_DoInitial() + { + Menu* pMVar1; + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL(UI::Helpers_Func::ColorEntireScreen)(COL_BLACK::instance.shortValue); + MACRO_CALL(Rendering_Func::RenderActiveCreditsElements)(); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index f39c78a2a0..5a37115d41 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -36383,7 +36383,7 @@ SHC_3BB0A8C1_0x004E1AA0 | 0.0% | Pending SHC_3BB0A8C1_0x004E1B30 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004E1E30 | 0.0% | Pending +SHC_3BB0A8C1_0x004E1E30 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004E1E70 | 100.0% | Reimplemented From e6330e45c19258c9dc3ed3e38f691d24c71e04a3 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:05 +0100 Subject: [PATCH 34/58] reimplement: SHC_3BB0A8C1_0x0042C090 100.0% Reimplemented MenuView_Unknown33_DoEveryFrame, gynt's version as it stands on his fork's archive/UI-MenuViews-development-second-pass at 32939bbc1 (2026-10-25), where its status line reads 100.0%; that commit is also the last one to change the file. Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_Unknown33_DoEveryFrame.cpp | 76 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/Unknown33/MenuView_Unknown33_DoEveryFrame.cpp diff --git a/src/OpenSHC/UI/MenuViews/Unknown33/MenuView_Unknown33_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/Unknown33/MenuView_Unknown33_DoEveryFrame.cpp new file mode 100644 index 0000000000..5c4d78f3f2 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/Unknown33/MenuView_Unknown33_DoEveryFrame.cpp @@ -0,0 +1,76 @@ +#include "../Unknown33.func.hpp" + +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/Game/GameStateStructures.func.hpp" +#include "OpenSHC/Synchrony.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandType.hpp" +#include "OpenSHC/UI/Enums/BuildingsAndStatusMenuTabType.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_00b960f8.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_UIDragDropDefinedData.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/INT_00b960f0.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using OpenSHC::Commands::GameCommandType; + using OpenSHC::UI::Enums::BuildingsAndStatusMenuTabType; + using OpenSHC::UI::Enums::MenuViewType; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x0042C090 + void Unknown33::MenuView_Unknown33_DoEveryFrame() + { + int iVar1; + iVar1 = MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::checkAllPlayersReadyAndCleanupSlots, + DAT_GameSynchronyState::ptr)(); + if (iVar1 != 0) { + if (DAT_GameSynchronyState::instance.isHost != FALSE) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, + DAT_GameSynchronyState::ptr)(OpenSHC::Commands::GCT_HOST_SHARE_LOBBY_STATE); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, + DAT_GameSynchronyState::ptr)(OpenSHC::Commands::GCT_TRIGGER_LOBBY_PLAYER_INFORMATION_REFRESH); + } + for (int iVar1 = 1; iVar1 < 9; iVar1 = iVar1 + 1) { + if (DAT_GameSynchronyState::instance.currentPlayerFullIDArray[iVar1] == -1 + && (DAT_GameCore::instance.mapU4Int0 == 0 + || (iVar1 != DAT_GameState::instance.mapAndTime.somePlayerID)) + && DAT_GameSynchronyState::instance.currentAIArray[iVar1] == 0) { + MACRO_CALL_MEMBER(OpenSHC::Game::GameStateStructures_Func::destroyPlayerCompletely, + DAT_GameState::ptr)(iVar1); + } + } + MACRO_CALL(OpenSHC::Synchrony_Func::SetAIPlayerNickNames)(); + DAT_GameSynchronyState::instance.timeSkirmishGameStart = timeGetTime(); + DAT_GameCore::instance.buildmenuMenuTabToSwitchTo.tabType = OpenSHC::UI::Enums::BASMTT_HUNTERSHUT; + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_BUILD_MENU, 0); + DAT_GameSynchronyState::instance.DAT_TwoIfNotHost = 0; + DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[0] = 0; + DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[1] = 0; + DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[2] = 0; + DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[3] = 0; + DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[4] = 0; + DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[5] = 0; + DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[6] = 0; + DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[7] = 0; + DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[8] = 0; + DAT_00b960f8::instance = 0; + INT_00b960f0::instance = 0; + DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; + DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated = 1; + } + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 5a37115d41..9843373c01 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -7455,7 +7455,7 @@ SHC_3BB0A8C1_0x0042BFC0 | 0.0% | Pending SHC_3BB0A8C1_0x0042C060 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0042C090 | 0.0% | Pending +SHC_3BB0A8C1_0x0042C090 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042C190 | 0.0% | Pending From 4d91d82a716e417eaab592b2ebba236e811ca9bb Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:06 +0100 Subject: [PATCH 35/58] reimplement: SHC_3BB0A8C1_0x004272C0 100.0% Reimplemented MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 944b6fa64 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004272C0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...61ReturnToSkrimishMenuUnk_DoEveryFrame.cpp | 36 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame.cpp diff --git a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame.cpp new file mode 100644 index 0000000000..3f27acaa4a --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame.cpp @@ -0,0 +1,36 @@ +#include "../Unknown61ReturnToSkrimishMenuUnk.func.hpp" + +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004272C0 + void Unknown61ReturnToSkrimishMenuUnk::MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame() + { + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* _menuPtr = DAT_MenuHandlerState::instance.currentMenu; + _menuPtr->yPosition = borderHeight; + _menuPtr->xPosition = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + return; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 9843373c01..1877fe0be2 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6809,7 +6809,7 @@ SHC_3BB0A8C1_0x00427210 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00427240 | 0.0% | Pending -SHC_3BB0A8C1_0x004272C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004272C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00427320 | 100.0% | Reimplemented From 3dd1338c26bdd773d2b6d85f104ed2b45119c17c Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:06 +0100 Subject: [PATCH 36/58] reimplement: SHC_3BB0A8C1_0x00427240 100.0% Reimplemented MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in b8ebe4f22 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x00427240 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...own61ReturnToSkrimishMenuUnk_DoInitial.cpp | 45 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial.cpp diff --git a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial.cpp new file mode 100644 index 0000000000..c9a3c2b1e8 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial.cpp @@ -0,0 +1,45 @@ +#include "../Unknown61ReturnToSkrimishMenuUnk.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00427240 + void Unknown61ReturnToSkrimishMenuUnk::MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial() + { + Menu* pMVar1; + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + (ushort)(COL_BLACK::instance.shortValue)); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL_MEMBER( + UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + return; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 1877fe0be2..8415c5dc2a 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6807,7 +6807,7 @@ SHC_3BB0A8C1_0x004271E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00427210 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00427240 | 0.0% | Pending +SHC_3BB0A8C1_0x00427240 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004272C0 | 100.0% | Reimplemented From b5ba399978461fec961abf776d759396f8bd2e97 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:06 +0100 Subject: [PATCH 37/58] reimplement: SHC_3BB0A8C1_0x004409C0 100.0% Reimplemented MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 25f39549f (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004409C0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...known61ReturnToSkrimishMenuUnk_Prepare.cpp | 50 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare.cpp b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare.cpp new file mode 100644 index 0000000000..621fee2678 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare.cpp @@ -0,0 +1,50 @@ +#include "../Unknown61ReturnToSkrimishMenuUnk.func.hpp" + +#include "OpenSHC/Game/Skirmish/SkirmishLobbySetupStructure.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuItems/SelectCrusade.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/SEC_SkirmishLobbySetupStructure.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004409C0 + void Unknown61ReturnToSkrimishMenuUnk::MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare() + { + Menu* pMVar1; + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("frontend_combat3.tgx"); + MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + MACRO_CALL(UI::MenuItems::SelectCrusade_Func::MenuItemActionHandler_SelectCrusade_Main)(2); + MACRO_CALL_MEMBER(Game::Skirmish::SkirmishLobbySetupStructure_Func::restoreSkirmishLobbySetup, + SEC_SkirmishLobbySetupStructure::ptr)(); + return; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 8415c5dc2a..39df72ceba 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -13659,7 +13659,7 @@ SHC_3BB0A8C1_0x004409B0 | 0.0% | Pending SHC_3BB0A8C1_0x004409B4 | 0.0% | Pending -SHC_3BB0A8C1_0x004409C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004409C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00440A50 | 0.0% | Pending From 78482a22f12ae04470eb5173088126c8d275ed6b Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:06 +0100 Subject: [PATCH 38/58] reimplement: SHC_3BB0A8C1_0x00430690 100.0% Reimplemented MenuView_UnusedCreateSiege_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-development-second-pass at 32939bbc1 (2026-10-25), where its status line reads 100.0%; that commit is also the last one to change the file. Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_UnusedCreateSiege_Prepare.cpp | 33 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/UnusedCreateSiege/MenuView_UnusedCreateSiege_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/UnusedCreateSiege/MenuView_UnusedCreateSiege_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedCreateSiege/MenuView_UnusedCreateSiege_Prepare.cpp new file mode 100644 index 0000000000..85792a47d4 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedCreateSiege/MenuView_UnusedCreateSiege_Prepare.cpp @@ -0,0 +1,33 @@ +#include "../UnusedCreateSiege.func.hpp" + +#include "OpenSHC/Text/UserTextHandler.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UserTextHandlerState.hpp" +#include "OpenSHC/Globals/INT_00b960e4.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00430690 + void UnusedCreateSiege::MenuView_UnusedCreateSiege_Prepare() + { + DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; + MACRO_CALL_MEMBER(OpenSHC::Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)(9); + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("frontend_builder2.tgx"); + MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); + INT_00b960e4::instance = 0; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 39df72ceba..a23e305dd6 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -10115,7 +10115,7 @@ SHC_3BB0A8C1_0x00430685 | 0.0% | Pending SHC_3BB0A8C1_0x00430686 | 0.0% | Pending -SHC_3BB0A8C1_0x00430690 | 0.0% | Pending +SHC_3BB0A8C1_0x00430690 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004306D0 | 0.0% | Pending From 4b5ab8f03f0425e42c765d9e1dafdb55d3c300fe Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:07 +0100 Subject: [PATCH 39/58] reimplement: SHC_3BB0A8C1_0x00426570 100.0% Reimplemented MenuView_UnusedDemoBuyItScreen_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-development-second-pass at 32939bbc1 (2026-10-25), where its status line reads 100.0%; that commit is also the last one to change the file. Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...MenuView_UnusedDemoBuyItScreen_Prepare.cpp | 47 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_Prepare.cpp new file mode 100644 index 0000000000..4080ff0a80 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_Prepare.cpp @@ -0,0 +1,47 @@ +#include "../UnusedDemoBuyItScreen.func.hpp" + +#include "OpenSHC/Audio/MSS/SoundSystem.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Rendering/ScreenResolutionEnum.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_SoundSystemState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/INT_00b95b34.hpp" +#include "OpenSHC/Globals/INT_00b960e0.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using OpenSHC::Rendering::ScreenResolutionEnum; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00426570 + void UnusedDemoBuyItScreen::MenuView_UnusedDemoBuyItScreen_Prepare() + { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("demo buy it screen.tgx"); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, + 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + (ushort)(COL_BLACK::instance.shortValue)); + INT_00b95b34::instance = timeGetTime(); + INT_00b960e0::instance = 0; + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_800x600) { + INT_00b960e0::instance = 0x18; + } + MACRO_CALL_MEMBER(OpenSHC::Audio::MSS::SoundSystem_Func::shutdownSoundSystem, DAT_SoundSystemState::ptr)(); + if (DAT_GameSynchronyState::instance.openOnClose != FALSE) { + DAT_WindowAndDirectDraw::instance.postWindowCloseMessage = 1; + } + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index a23e305dd6..71f8fad168 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6765,7 +6765,7 @@ SHC_3BB0A8C1_0x004262B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00426340 | 0.0% | Pending -SHC_3BB0A8C1_0x00426570 | 0.0% | Pending +SHC_3BB0A8C1_0x00426570 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00426600 | 0.0% | Pending From 9c46aed70d57b2622d95ea63022d49b1fdc87e2b Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:07 +0100 Subject: [PATCH 40/58] reimplement: SHC_3BB0A8C1_0x00425A40 100.0% Reimplemented MenuView_UnusedEconomicGametypeSelect_DoInitial, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in e48e9c8ce (2026-10-25, "reimplement: SHC_3BB0A8C1_0x00425A40 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...UnusedEconomicGametypeSelect_DoInitial.cpp | 47 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_DoInitial.cpp diff --git a/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_DoInitial.cpp new file mode 100644 index 0000000000..30fac3e13a --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_DoInitial.cpp @@ -0,0 +1,47 @@ +#include "../UnusedEconomicGametypeSelect.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/INT_00b95f68.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00425A40 + void UnusedEconomicGametypeSelect::MenuView_UnusedEconomicGametypeSelect_DoInitial() + { + Menu* pMVar1; + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + (ushort)(COL_BLACK::instance.shortValue)); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + MACRO_CALL_MEMBER( + UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + INT_00b95f68::instance = 0; + return; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 71f8fad168..bba1cc5518 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6727,7 +6727,7 @@ SHC_3BB0A8C1_0x004259CC | 0.0% | Pending SHC_3BB0A8C1_0x004259D0 | 0.0% | Pending -SHC_3BB0A8C1_0x00425A40 | 0.0% | Pending +SHC_3BB0A8C1_0x00425A40 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00425AD0 | 100.0% | Reimplemented From ab148deda22cd66e3bb60fcd17cd6bcdbda826ff Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:07 +0100 Subject: [PATCH 41/58] reimplement: SHC_3BB0A8C1_0x004259D0 100.0% Reimplemented MenuView_UnusedEconomicGametypeSelect_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-development-second-pass at 32939bbc1 (2026-10-25), where its status line reads 100.0%; that commit is also the last one to change the file. Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...w_UnusedEconomicGametypeSelect_Prepare.cpp | 37 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp new file mode 100644 index 0000000000..bc7c4740bd --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp @@ -0,0 +1,37 @@ +#include "../UnusedEconomicGametypeSelect.func.hpp" + +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UIButtonDefinedData.hpp" +#include "OpenSHC/Globals/INT_00b95abc.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004259D0 + void UnusedEconomicGametypeSelect::MenuView_UnusedEconomicGametypeSelect_Prepare() + { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("frontend_economics.tgx"); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("frontend_economics2.tgx"); + MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); + DWORD _currentTime = timeGetTime(); + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x168].stateTransitionTimeBaseUnk_0x18 + = _currentTime - 0x12c0; + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x169].stateTransitionTimeBaseUnk_0x18 + = _currentTime - 0xc80; + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x16a].stateTransitionTimeBaseUnk_0x18 + = _currentTime - 0x640; + INT_00b95abc::instance = -1; + DAT_GameCore::instance.isTimeHalted2 = 0; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index bba1cc5518..91d7352e33 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6725,7 +6725,7 @@ SHC_3BB0A8C1_0x004259C8 | 0.0% | Pending SHC_3BB0A8C1_0x004259CC | 0.0% | Pending -SHC_3BB0A8C1_0x004259D0 | 0.0% | Pending +SHC_3BB0A8C1_0x004259D0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00425A40 | 100.0% | Reimplemented From f9dfbd236999f0937d99bf91862a6206b114a78f Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:08 +0100 Subject: [PATCH 42/58] reimplement: SHC_3BB0A8C1_0x00426C50 100.0% Reimplemented MenuView_UnusedEconomicMissionSelect_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-development-second-pass at 32939bbc1 (2026-10-25), where its status line reads 100.0%; that commit is also the last one to change the file. Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...ew_UnusedEconomicMissionSelect_Prepare.cpp | 33 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp new file mode 100644 index 0000000000..c16d170294 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp @@ -0,0 +1,33 @@ +#include "../UnusedEconomicMissionSelect.func.hpp" + +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00426C50 + void UnusedEconomicMissionSelect::MenuView_UnusedEconomicMissionSelect_Prepare() + { + DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("frontend_economics2.tgx"); + MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); + DAT_GameCore::instance.section1066 = 0; + DAT_MenuTextInputState::instance.lastListClickTime = 0; + DAT_GameCore::instance.missionNumber1to20 = 0x21; + DAT_MenuTextInputState::instance.lastClickedListIndex = 0xffffffff; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 91d7352e33..7f24d32ae3 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6785,7 +6785,7 @@ SHC_3BB0A8C1_0x004269E0 | 0.0% | Pending SHC_3BB0A8C1_0x00426B80 | 0.0% | Pending -SHC_3BB0A8C1_0x00426C50 | 0.0% | Pending +SHC_3BB0A8C1_0x00426C50 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00426CA0 | 100.0% | Reimplemented From 9498372ee309a57c5f4336eb4328e6dabb5205e2 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:08 +0100 Subject: [PATCH 43/58] reimplement: SHC_3BB0A8C1_0x004E1AA0 100.0% Reimplemented MenuView_UnusedExtremeAd_DoEveryFrame, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in d7a942522 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004E1AA0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_UnusedExtremeAd_DoEveryFrame.cpp | 49 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoEveryFrame.cpp diff --git a/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoEveryFrame.cpp new file mode 100644 index 0000000000..2a658ec167 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoEveryFrame.cpp @@ -0,0 +1,49 @@ +#include "../UnusedExtremeAd.func.hpp" + +#include "OpenSHC/Rendering.func.hpp" +#include "OpenSHC/UI/Credits.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" + +#include "OpenSHC/Globals/DAT_00ed278c.hpp" +#include "OpenSHC/Globals/DAT_MouseState.hpp" +#include "OpenSHC/Globals/DAT_UnknownBinkCount.hpp" +#include "OpenSHC/Globals/DAT_UnknownBinkIndex.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/INT_00ed3140.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004E1AA0 + void UnusedExtremeAd::MenuView_UnusedExtremeAd_DoEveryFrame() + { + int iVar1 = MACRO_CALL(UI::Helpers_Func::TicksSinceCounterStart)(); + if (iVar1) { + if (DAT_MouseState::instance.rightClickStop) { + MACRO_CALL(UI::Credits_Func::StopCreditsPlaybackAndSounds)(); + } + if (DAT_MouseState::instance.leftClickStart) { + iVar1 = MACRO_CALL(UI::Helpers_Func::FindCampaignMapHotspotAtMouse)(); + if (iVar1 == 1) { + MACRO_CALL(UI::Credits_Func::EndCreditsSegmentAndAdvanceToNext)(); + DAT_00ed278c::instance = DAT_00ed278c::instance + 1; + if (DAT_00ed278c::instance == 3) { + DAT_WindowAndDirectDraw::instance.postWindowCloseMessage = 1; + } + } + } + MACRO_CALL(Rendering_Func::ProcessCreditsScriptCommands)(); + if ((int)DAT_UnknownBinkIndex::instance < (int)DAT_UnknownBinkCount::instance) { + MACRO_CALL(Rendering_Func::RenderActiveCreditsElements)(); + } + INT_00ed3140::instance = INT_00ed3140::instance + 1; + if ((int)DAT_UnknownBinkIndex::instance >= (int)DAT_UnknownBinkCount::instance) { + DAT_WindowAndDirectDraw::instance.postWindowCloseMessage = 1; + } + } + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 7f24d32ae3..f19b4f89d7 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -36379,7 +36379,7 @@ SHC_3BB0A8C1_0x004E1A20 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004E1A50 | 0.0% | Pending -SHC_3BB0A8C1_0x004E1AA0 | 0.0% | Pending +SHC_3BB0A8C1_0x004E1AA0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004E1B30 | 100.0% | Reimplemented From 00bea6d2c90b7bfdbc30bde0e31c7dcd65a666e4 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:08 +0100 Subject: [PATCH 44/58] reimplement: SHC_3BB0A8C1_0x004E1A50 100.0% Reimplemented MenuView_UnusedExtremeAd_DoInitial, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 6417d7b17 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x004E1A50 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_UnusedExtremeAd_DoInitial.cpp | 34 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoInitial.cpp diff --git a/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoInitial.cpp new file mode 100644 index 0000000000..c813a1b402 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoInitial.cpp @@ -0,0 +1,34 @@ +#include "../UnusedExtremeAd.func.hpp" + +#include "OpenSHC/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004E1A50 + void UnusedExtremeAd::MenuView_UnusedExtremeAd_DoInitial() + { + Menu* pMVar1; + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + (ushort)(COL_BLACK::instance.shortValue)); + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL(Rendering_Func::RenderActiveCreditsElements)(); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index f19b4f89d7..b5439774e7 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -36377,7 +36377,7 @@ SHC_3BB0A8C1_0x004E1810 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004E1A20 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004E1A50 | 0.0% | Pending +SHC_3BB0A8C1_0x004E1A50 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004E1AA0 | 100.0% | Reimplemented From 4496c1f944a73061bc0426367183da27bfd3d837 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:08 +0100 Subject: [PATCH 45/58] reimplement: SHC_3BB0A8C1_0x0042DD00 100.0% Reimplemented MenuView_UnusedOldTitleMenu_DoInitial, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in df53f89d3 (2026-10-25, "reimplement: SHC_3BB0A8C1_0x0042DD00 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_UnusedOldTitleMenu_DoInitial.cpp | 59 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp diff --git a/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp new file mode 100644 index 0000000000..aea38aa913 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp @@ -0,0 +1,59 @@ +#include "../UnusedOldTitleMenu.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/COL_WHITE.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using Text::TextAlignment; + using WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x0042DD00 + void UnusedOldTitleMenu::MenuView_UnusedOldTitleMenu_DoInitial() + { + Menu* pMVar1; + int left; + int top; + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + (ushort)(COL_BLACK::instance.shortValue)); + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + pMVar1->xPosition = borderWidth; + pMVar1->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL_MEMBER( + UI::Rendering::PencilRenderCore_Func::drawPixelPattern4x4OverWholeScreen, DAT_PencilRenderCore::ptr)(); + top = (DAT_WindowAndDirectDraw::instance.resolutionY + -400) / 2; + left = (DAT_WindowAndDirectDraw::instance.resolutionX + -600) / 2; + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)( + left, top, left + 600, top + 400, (ushort)(COL_WHITE::instance.shortValue)); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 0, DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 100, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 100); + MACRO_CALL_MEMBER(Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)("FireFly\'s", + DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 0xd2, Text::TTA_LEFT, 0x80ff, 0xf, FALSE, 0); + MACRO_CALL_MEMBER(Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)("Crusader", + DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 0xf8, Text::TTA_LEFT, 0, 0x11, FALSE, 0); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index b5439774e7..9f11b08334 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -8257,7 +8257,7 @@ SHC_3BB0A8C1_0x0042DC60 | 0.0% | Pending SHC_3BB0A8C1_0x0042DCB0 | 0.0% | Pending -SHC_3BB0A8C1_0x0042DD00 | 0.0% | Pending +SHC_3BB0A8C1_0x0042DD00 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042DE20 | 100.0% | Reimplemented From faed421d81069c2a165c12f390794192aee2066c Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:09 +0100 Subject: [PATCH 46/58] reimplement: SHC_3BB0A8C1_0x0042DCB0 100.0% Reimplemented MenuView_UnusedOldTitleMenu_Prepare, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 2ff2116cb (2026-10-25, "reimplement: SHC_3BB0A8C1_0x0042DCB0 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- .../MenuView_UnusedOldTitleMenu_Prepare.cpp | 35 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_Prepare.cpp new file mode 100644 index 0000000000..31c4bbf398 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_Prepare.cpp @@ -0,0 +1,35 @@ +#include "../UnusedOldTitleMenu.func.hpp" + +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x0042DCB0 + void UnusedOldTitleMenu::MenuView_UnusedOldTitleMenu_Prepare() + { + int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; + pMVar1->yPosition = borderHeight; + pMVar1->xPosition = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("gm_fly.tgx"); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 9f11b08334..027f697e9c 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -8255,7 +8255,7 @@ SHC_3BB0A8C1_0x0042DBB0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042DC60 | 0.0% | Pending -SHC_3BB0A8C1_0x0042DCB0 | 0.0% | Pending +SHC_3BB0A8C1_0x0042DCB0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042DD00 | 100.0% | Reimplemented From edf29ef74a04daee0c353068523676fcd3ecf811 Mon Sep 17 00:00:00 2001 From: Gynt Date: Mon, 9 Nov 2026 10:48:09 +0100 Subject: [PATCH 47/58] reimplement: SHC_3BB0A8C1_0x0042B960 100.0% Reimplemented MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame, gynt's version as it stands on his fork's archive/UI-MenuViews-merged-full at 2755710f9 (2026-10-25), where its status line reads 100.0%; the file was last changed in 9a09c921f (2026-10-25, "reimplement: SHC_3BB0A8C1_0x0042B960 100.00% Reimplemented"). Taken unchanged; what main needs on top follows in our own commits. Co-Authored-By: Claude Opus 5.5 --- ...lectRandomNumberOfEnemies_DoEveryFrame.cpp | 85 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/UnusedSelectRandomNumberOfEnemies/MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame.cpp diff --git a/src/OpenSHC/UI/MenuViews/UnusedSelectRandomNumberOfEnemies/MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/UnusedSelectRandomNumberOfEnemies/MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame.cpp new file mode 100644 index 0000000000..028eabc4f0 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedSelectRandomNumberOfEnemies/MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame.cpp @@ -0,0 +1,85 @@ +#include "../UnusedSelectRandomNumberOfEnemies.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/BGR24.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + using OpenSHC::DE::SHCDE::eTextSections; + using OpenSHC::Rendering::Colors::BGR24; + using OpenSHC::Rendering::Enums::RenderTarget; + using OpenSHC::Text::TextAlignment; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x0042B960 + void UnusedSelectRandomNumberOfEnemies::MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame() + { + int iVar1; + int iVar3; + TextAlignment alignment; + BGR24 color; + int iVar4; + uint color_00; + BOOLEnum keepOffsetX; + int iVar5; + int blendStrength; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBorderedBoxWithBlendedBackground, + DAT_PencilRenderCore::ptr)(DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 100, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 100, 600, 400); + iVar5 = 0; + keepOffsetX = FALSE; + iVar4 = 0x11; + color = 0xccfaff; + alignment = OpenSHC::Text::TTA_CENTER; + iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 200; + iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + /* + added by script: "How many opponents can you handle!" + */ + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_NEW_TEXT, 1), + iVar3, iVar1, alignment, color, iVar4, keepOffsetX, iVar5); + blendStrength = 0; + iVar5 = 0x12; + color_00 = 0xccfaff; + iVar4 = 400; + iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; + iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 200; + /* + added by script: "This will create some random opponents for you. You can still change opponent types + afterwards." + */ + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderMultilineText5Unk, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_NEW_TEXT, 2), + iVar3, iVar1, iVar4, color_00, iVar5, blendStrength); + return; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 027f697e9c..72e0709061 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -7439,7 +7439,7 @@ SHC_3BB0A8C1_0x0042B8E0 | 0.0% | Pending SHC_3BB0A8C1_0x0042B8F0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0042B960 | 0.0% | Pending +SHC_3BB0A8C1_0x0042B960 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042BA50 | 100.0% | Reimplemented From 3425504ae18c5631c50aec538e93d94770dad25d Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Mon, 9 Nov 2026 11:16:01 +0100 Subject: [PATCH 48/58] MenuViews backlog: main's names for three fields gynt's branch called otherwise Main renamed these since gynt's base, which kept three of the 47 files from compiling: MinimapViewState's field3_0xc is field_0xc (MenuView_BuildMenu_DoEveryFrame, MenuView_MapEditorLandscaping_DoEveryFrame) and GameSynchronyState's field225_0x106ee4 is field_0x106ee4 (MenuView_LobbyMenu_Prepare). MenuView_BuildMenu_DoEveryFrame also compared activeMenuTab.buildMenuTab with (BuildMenuTabTypeShort)0x3e, a type his branch has and main doesn't; main's buildMenuTab is a BuildMenuTabTypeInt and BuildMenuTabType has no 62, so it compares with the number. With this, all 47 build on main 95283505f and measure reccmp 100.0. Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- .../MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp | 4 ++-- .../UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp | 2 +- .../MenuView_MapEditorLandscaping_DoEveryFrame.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp index 3e437054cc..da520d1ec6 100644 --- a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp @@ -40,8 +40,8 @@ namespace UI { { if ((DAT_GameCore::instance.activeMenuTab.buildMenuTab != OpenSHC::UI::Enums::BMTT_MENU_HIDDEN) && (DAT_GameCore::instance.activeMenuTab.buildMenuTab - != (OpenSHC::UI::Enums::BuildMenuTabTypeShort)0x3e)) { - if (DAT_MinimapViewState::instance.field3_0xc == 0) { + != 62)) { + if (DAT_MinimapViewState::instance.field_0xc == 0) { DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated = 2; } if (DAT_MenuHandlerState::instance.isBuildMenuTransitioning_0x18 != FALSE) { diff --git a/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp index cfecbedd12..37c196c664 100644 --- a/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp @@ -38,7 +38,7 @@ namespace UI { DAT_GameCore::instance.gameMode_2 = Game::GM_SKIRMISH_AND_MULTIPLAYER; DAT_GameCore::instance.currentTrailType = Game::TT_FIRST_EDITION; DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; - DAT_GameSynchronyState::instance.field225_0x106ee4 = 0; + DAT_GameSynchronyState::instance.field_0x106ee4 = 0; DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)("frontend_combat3.tgx"); diff --git a/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp index aa0e49da80..d2e71bac8a 100644 --- a/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp @@ -27,7 +27,7 @@ namespace UI { || (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_SIEGETENT_SHIELD)) { return; } - if (!DAT_MinimapViewState::instance.field3_0xc) { + if (!DAT_MinimapViewState::instance.field_0xc) { DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated = 2; } else if (DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated != 2) goto LAB_00431429; From 454e556cc1c06c4dec7aad22f541f9017c3a6826 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Mon, 9 Nov 2026 11:16:01 +0100 Subject: [PATCH 49/58] MenuViews backlog: the style fixer's pass openshc-pr-fix.py over the 29 of gynt's 47 files it had something for: hex numbers that aren't masks or colours written in decimal (246), usings nothing uses dropped (57), "+ -N" written "- N" (4), compound assignments (2) and BOOL comparisons as truth tests (4). Mechanical; the code is the same. Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- .../MenuView_BuildMenu_DoEveryFrame.cpp | 31 ++- .../BuildMenu/MenuView_BuildMenu_Prepare.cpp | 4 - .../Credits/MenuView_Credits_DoInitial.cpp | 2 - ...MenuView_CrusadeEndscreen_DoEveryFrame.cpp | 4 +- .../MenuView_CrusadeEndscreen_Prepare.cpp | 177 +++++++++--------- .../MenuView_CustomScenarios_DoEveryFrame.cpp | 3 - .../MenuView_CustomScenarios_Prepare.cpp | 20 +- ...MenuView_HistoricCampaignIntro_Prepare.cpp | 18 +- ...ew_HistoricCampaignSelect_DoEveryFrame.cpp | 2 - ...enuView_HistoricCampaignSelect_Prepare.cpp | 24 +-- ...MenuView_HistoricMissionSelect_Prepare.cpp | 10 +- .../MenuView_IntroVideo_DoEveryFrame.cpp | 7 +- .../MenuView_IntroVideo_Prepare.cpp | 2 +- .../LobbyMenu/MenuView_LobbyMenu_Prepare.cpp | 93 +++++---- .../MainMenu/MenuView_MainMenu_Prepare.cpp | 4 - ...View_MapEditorLandscaping_DoEveryFrame.cpp | 8 +- .../MenuView_MissionSelect_DoEveryFrame.cpp | 15 +- .../MenuView_MpConnection_Prepare.cpp | 9 +- .../MenuView_SelectCrusade_DoEveryFrame.cpp | 46 +++-- ...MenuView_SingleplayerMapChoice_Prepare.cpp | 18 +- .../MenuView_Unknown33_DoEveryFrame.cpp | 17 +- .../MenuView_UnusedCreateSiege_Prepare.cpp | 2 - ...MenuView_UnusedDemoBuyItScreen_Prepare.cpp | 7 +- ...w_UnusedEconomicGametypeSelect_Prepare.cpp | 12 +- ...ew_UnusedEconomicMissionSelect_Prepare.cpp | 4 +- .../MenuView_UnusedExtremeAd_DoEveryFrame.cpp | 4 +- .../MenuView_UnusedOldTitleMenu_DoInitial.cpp | 11 +- .../MenuView_UnusedOldTitleMenu_Prepare.cpp | 6 +- ...lectRandomNumberOfEnemies_DoEveryFrame.cpp | 6 +- 29 files changed, 238 insertions(+), 328 deletions(-) diff --git a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp index da520d1ec6..1c6d55daaa 100644 --- a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp @@ -27,24 +27,15 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using OpenSHC::DE::SHCDE::eGM; - using OpenSHC::IO::Graphics::GmID; - using OpenSHC::Rendering::ScreenResolutionEnum; - using OpenSHC::Rendering::Enums::RenderTarget; - using OpenSHC::UI::Enums::BuildMenuTabType; - using OpenSHC::UI::Enums::DisplayElementID; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - // FUNCTION: STRONGHOLDCRUSADER 0x00433030 void BuildMenu::MenuView_BuildMenu_DoEveryFrame() { if ((DAT_GameCore::instance.activeMenuTab.buildMenuTab != OpenSHC::UI::Enums::BMTT_MENU_HIDDEN) - && (DAT_GameCore::instance.activeMenuTab.buildMenuTab - != 62)) { + && (DAT_GameCore::instance.activeMenuTab.buildMenuTab != 62)) { if (DAT_MinimapViewState::instance.field_0xc == 0) { DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated = 2; } - if (DAT_MenuHandlerState::instance.isBuildMenuTransitioning_0x18 != FALSE) { + if (DAT_MenuHandlerState::instance.isBuildMenuTransitioning_0x18) { MACRO_CALL_MEMBER(OpenSHC::UI::MenuHandlerState_Func::computeBuildMenuTransitionShift, DAT_MenuHandlerState::ptr)(); } @@ -58,26 +49,26 @@ namespace UI { } else { MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(DAT_MenuHandlerState::instance.x, - DAT_MenuHandlerState::instance.y + 0x196, DAT_MenuHandlerState::instance.x + 799, - DAT_MenuHandlerState::instance.y + 0x1d7, (ushort)(COL_MAGENTA::instance.shortValue)); + DAT_MenuHandlerState::instance.y + 406, DAT_MenuHandlerState::instance.x + 799, + DAT_MenuHandlerState::instance.y + 471, (ushort)(COL_MAGENTA::instance.shortValue)); if (DAT_GameCore::instance.activeMenuTab.buildMenuTab == OpenSHC::UI::Enums::BMTT_SOLDIERS) { MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_PANELS, 5, - DAT_MenuHandlerState::instance.x, DAT_MenuHandlerState::instance.y + 0x1bd); + DAT_MenuHandlerState::instance.x, DAT_MenuHandlerState::instance.y + 445); } else { MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_PANELS, 1, - DAT_MenuHandlerState::instance.x, DAT_MenuHandlerState::instance.y + 0x1c2); + DAT_MenuHandlerState::instance.x, DAT_MenuHandlerState::instance.y + 450); MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::setRenderingRect, - DAT_TextureRenderCoreObject::ptr)(DAT_MenuHandlerState::instance.x + 0x11, - DAT_MenuHandlerState::instance.y + 0x1d9, DAT_MenuHandlerState::instance.x + 0x201, - DAT_MenuHandlerState::instance.y + 0x240); + DAT_TextureRenderCoreObject::ptr)(DAT_MenuHandlerState::instance.x + 17, + DAT_MenuHandlerState::instance.y + 473, DAT_MenuHandlerState::instance.x + 513, + DAT_MenuHandlerState::instance.y + 576); MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawTgxGmOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(OpenSHC::IO::Graphics::GID_INTERFACE_BUTTONS, 7, (DAT_MenuHandlerState::instance.x - DAT_MenuHandlerState::instance.buildMenuBackgroundLeftShift_0x24) - + 0x11, - DAT_MenuHandlerState::instance.y + 0x1d9); + + 17, + DAT_MenuHandlerState::instance.y + 473); MACRO_CALL_MEMBER( OpenSHC::UI::Rendering::TextureRenderCore_Func::setRenderingRectToGameResolution, DAT_TextureRenderCoreObject::ptr)(); diff --git a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp index e46389c263..053bdd30dd 100644 --- a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp @@ -22,10 +22,6 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using OpenSHC::Game::GameMode; - using OpenSHC::UI::Enums::BuildingsAndStatusMenuTabType; - using OpenSHC::UI::Enums::DisplayElementID; - // FUNCTION: STRONGHOLDCRUSADER 0x00431A90 void BuildMenu::MenuView_BuildMenu_Prepare() { diff --git a/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoInitial.cpp index ae46b9b7a9..0ef01a0186 100644 --- a/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoInitial.cpp @@ -16,8 +16,6 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using WindowsHelper::Enums::BOOLEnum; - // FUNCTION: STRONGHOLDCRUSADER 0x004262B0 void Credits::MenuView_Credits_DoInitial() { diff --git a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoEveryFrame.cpp index 008e1a20d0..6d078bf58f 100644 --- a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoEveryFrame.cpp @@ -13,15 +13,13 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using DE::SHCDE::eMusicIDs; - // FUNCTION: STRONGHOLDCRUSADER 0x004E1F50 void CrusadeEndscreen::MenuView_CrusadeEndscreen_DoEveryFrame() { int iVar1 = MACRO_CALL(UI::Helpers_Func::TicksSinceCounterStart)(); if (iVar1) { MACRO_CALL(Rendering_Func::ProcessCreditsScriptCommands)(); - if ((0x3b <= (int)DAT_UnknownBinkIndex::instance) && (!INT_00ed27b8::instance)) { + if ((59 <= (int)DAT_UnknownBinkIndex::instance) && (!INT_00ed27b8::instance)) { MACRO_CALL_MEMBER(Audio::MSS::SoundSystem_Func::setSomeSoundTime, DAT_SoundSystemState::ptr)(); MACRO_CALL_MEMBER(Audio::MSS::SoundSystem_Func::setupVolumeAndSoundID, DAT_SoundSystemState::ptr)( DE::SHCDE::MUSIC_GERMAN_EGG); diff --git a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp index 2147f2cdb6..00788ca9eb 100644 --- a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp @@ -20,9 +20,6 @@ namespace UI { namespace MenuViews { using Audio::MSS::enums::SHC_SoundStream; - using DE::SHCDE::eTextSections; - using Game::TrailType; - using Text::GameLanguage; // FUNCTION: STRONGHOLDCRUSADER 0x004DF2E0 void CrusadeEndscreen::MenuView_CrusadeEndscreen_Prepare() @@ -82,151 +79,149 @@ namespace UI { MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( DE::SHCDE::TEXT_SKTRAIL_WIN, 4)); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundEntry)(1, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsShowImageCommand)(0x29, 0, 0xe6, 0xcb, 0x150, 0xa8, 0, 1); - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(0xf, 0, 0xf, 1, 0x192, 0xea, 0, 1); - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(0xf, 0, 0xf, 0, 400, 0xe8, 0, 1); - MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 1, 0x6a, 0x35, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "rt_vict1.bik", 0x6a, 0x35, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsShowImageCommand)(41, 0, 230, 203, 336, 168, 0, 1); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(0xf, 0, 0xf, 1, 402, 234, 0, 1); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(0xf, 0, 0xf, 0, 400, 232, 0, 1); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 1, 106, 53, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "rt_vict1.bik", 106, 53, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( "fx\\speech\\rt_anger_04.wav", 3, 0, 100); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); - MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 2, 0x14b, 0x18, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "sn_vict2.bik", 0x14b, 0x18, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 2, 331, 24, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "sn_vict2.bik", 331, 24, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( "fx\\speech\\sn_add_player.wav", 3, 0, 100); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); - MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 3, 0x22d, 0x35, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "pg_taunt2.bik", 0x22d, 0x35, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 3, 557, 53, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "pg_taunt2.bik", 557, 53, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( "fx\\speech\\pg_add_player.wav", 3, 0, 100); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); - MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 4, 0x280, 0xdf, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "wf_anger1.bik", 0x280, 0xdf, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 4, 640, 223, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "wf_anger1.bik", 640, 223, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( "fx\\speech\\wf_anger_04.wav", 3, 0, 100); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); - MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 5, 0x22d, 0x18a, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "saladin_angry.bik", 0x22d, 0x18a, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 5, 557, 394, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "saladin_angry.bik", 557, 394, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( "fx\\speech\\sa_extra_01.wav", 3, 0, 100); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); - MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 6, 0x14c, 0x1b4, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "sultan_natural.bik", 0x14c, 0x1b4, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 6, 332, 436, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "sultan_natural.bik", 332, 436, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( "fx\\speech\\su_congrats_01.wav", 3, 0, 100); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); - MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 7, 0x6a, 0x18a, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "richard_taunting.bik", 0x6a, 0x18a, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 7, 106, 394, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "richard_taunting.bik", 106, 394, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( "fx\\speech\\ri_congrats_01.wav", 3, 0, 100); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); - MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 8, 0x23, 0xdf, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "bad_arab_taunt.bik", 0x23, 0xdf, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 8, 35, 223, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "bad_arab_taunt.bik", 35, 223, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( "fx\\speech\\ca_add_player_01.wav", 3, 0, 100); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); - uVar2 = 0x10; + uVar2 = 16; if (DAT_TextManagerObject::instance.gameLanguage == Text::GL_ITALIAN) { - uVar2 = 0x11; + uVar2 = 17; } - MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(0x10, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(16, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( - 0xf, 1, (undefined4)((int)(uVar2)), 1, 0x106, 0xee, 0x11a, 0); + 0xf, 1, (undefined4)((int)(uVar2)), 1, 262, 238, 282, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( - 0xf, 1, (undefined4)((int)(uVar2)), 0, 0x104, 0xec, 0x11a, 0); + 0xf, 1, (undefined4)((int)(uVar2)), 0, 260, 236, 282, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, Audio::MSS::enums::SND_STR_SFX_1Unk); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(1, ((SHC_SoundStream)0x5a)); - MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(0x10, 1); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(1, ((SHC_SoundStream)90)); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(16, 1); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, Audio::MSS::enums::SND_STR_SFX_1Unk); MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( - 0xf, 2, (undefined4)((int)(uVar2)), 1, 0x106, 0xee, 0x11a, 0); + 0xf, 2, (undefined4)((int)(uVar2)), 1, 262, 238, 282, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( - 0xf, 2, (undefined4)((int)(uVar2)), 0, 0x104, 0xec, 0x11a, 0); + 0xf, 2, (undefined4)((int)(uVar2)), 0, 260, 236, 282, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, Audio::MSS::enums::SND_STR_SFX_2Unk); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(1, ((SHC_SoundStream)0x5a)); - MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(0x10, 2); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(1, ((SHC_SoundStream)90)); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(16, 2); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, Audio::MSS::enums::SND_STR_SFX_2Unk); if (DAT_GameCore::instance.currentTrailType == Game::TT_EXTREME) { MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( - 0xf, 4, (undefined4)((int)(uVar2)), 1, 0x106, 0xee, 0x11a, 0); + 0xf, 4, (undefined4)((int)(uVar2)), 1, 262, 238, 282, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( - 0xf, 4, (undefined4)((int)(uVar2)), 0, 0x104, 0xec, 0x11a, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)( - 3, Audio::MSS::enums::SND_STR_SPEECH_2); + 0xf, 4, (undefined4)((int)(uVar2)), 0, 260, 236, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, Audio::MSS::enums::SND_STR_SPEECH_2); } else { MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( - 0xf, 3, (undefined4)((int)(uVar2)), 1, 0x106, 0xee, 0x11a, 0); + 0xf, 3, (undefined4)((int)(uVar2)), 1, 262, 238, 282, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( - 0xf, 3, (undefined4)((int)(uVar2)), 0, 0x104, 0xec, 0x11a, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)( - 3, Audio::MSS::enums::SND_STR_SPEECH_1); + 0xf, 3, (undefined4)((int)(uVar2)), 0, 260, 236, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, Audio::MSS::enums::SND_STR_SPEECH_1); } MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, Audio::MSS::enums::SND_STR_SFX_1Unk); - MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 0x6a, 0x35, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x6a, 0x35, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 106, 53, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 106, 53, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, Audio::MSS::enums::SND_STR_SFX_2Unk); - MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 0x14b, 0x18, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x14b, 0x18, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 331, 24, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 331, 24, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, Audio::MSS::enums::SND_STR_SPEECH_1); - MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 0x22d, 0x35, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x22d, 0x35, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 557, 53, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 557, 53, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, Audio::MSS::enums::SND_STR_SPEECH_2); - MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 0x280, 0xdf, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x280, 0xdf, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 640, 223, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 640, 223, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, (Audio::MSS::enums::SHC_SoundStream)(Audio::MSS::enums::SND_STR_SPEECH_2 | Audio::MSS::enums::SND_STR_SFX_1Unk)); - MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 0x22d, 0x18a, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x22d, 0x18a, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 557, 394, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 557, 394, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, (Audio::MSS::enums::SHC_SoundStream)(Audio::MSS::enums::SND_STR_SPEECH_2 | Audio::MSS::enums::SND_STR_SFX_2Unk)); - MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 0x14c, 0x1b4, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x14c, 0x1b4, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 332, 436, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 332, 436, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, (Audio::MSS::enums::SHC_SoundStream)(Audio::MSS::enums::SND_STR_SPEECH_2 | Audio::MSS::enums::SND_STR_SPEECH_1)); - MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 0x6a, 0x18a, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x6a, 0x18a, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 106, 394, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 106, 394, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, ((SHC_SoundStream)8)); - MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 0x23, 0xdf, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x23, 0xdf, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsImageEndCommand)(0x2a, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(0x10, 3); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 35, 223, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 35, 223, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageEndCommand)(42, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(16, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsSegmentEndCommand)(); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x6a, 0x35, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x14b, 0x18, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x22d, 0x35, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x280, 0xdf, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x22d, 0x18a, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x14c, 0x1b4, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x6a, 0x18a, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(0xc, "action_jester.bik", 0x23, 0xdf, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(0x18, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 106, 53, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 331, 24, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 557, 53, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 640, 223, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 557, 394, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 332, 436, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 106, 394, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 35, 223, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsClearImageCommand)(); MACRO_CALL(Rendering_Func::TicksStartCounter)(); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); diff --git a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp index 546c19b56c..5a67145778 100644 --- a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp @@ -17,9 +17,6 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using OpenSHC::UI::Enums::MenuModalType; - using OpenSHC::UI::Enums::MenuViewType; - // FUNCTION: STRONGHOLDCRUSADER 0x00425FF0 void CustomScenarios::MenuView_CustomScenarios_DoEveryFrame() { diff --git a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp index ddce18ad27..5a21fc4a6a 100644 --- a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp @@ -20,24 +20,20 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using Game::GameMode2; - using UI::Enums::BuildingsAndStatusMenuTabType; - // FUNCTION: STRONGHOLDCRUSADER 0x00425EA0 void CustomScenarios::MenuView_CustomScenarios_Prepare() { DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("frontend_builder.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("frontend_builder2.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "frontend_builder.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "frontend_builder2.tgx"); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); DWORD DVar1 = timeGetTime(); - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x16c].stateTransitionTimeBaseUnk_0x18 - = DVar1 - 0x12c0; - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x16d].stateTransitionTimeBaseUnk_0x18 = DVar1 - 0xc80; - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x16e].stateTransitionTimeBaseUnk_0x18 = DVar1 - 0x640; - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x16f].stateTransitionTimeBaseUnk_0x18 = DVar1; + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[364].stateTransitionTimeBaseUnk_0x18 = DVar1 - 4800; + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[365].stateTransitionTimeBaseUnk_0x18 = DVar1 - 3200; + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[366].stateTransitionTimeBaseUnk_0x18 = DVar1 - 1600; + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[367].stateTransitionTimeBaseUnk_0x18 = DVar1; INT_00b95abc::instance = -1; DAT_MenuTextInputState::instance.dialogResult = 0; DAT_GameCore::instance.missionNumber1to20 = 0; diff --git a/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp b/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp index b360a1659b..c224fac5db 100644 --- a/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp @@ -18,8 +18,6 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using DE::SHCDE::eTextSections; - // FUNCTION: STRONGHOLDCRUSADER 0x004DBAF0 void HistoricCampaignIntro::MenuView_HistoricCampaignIntro_Prepare() { @@ -28,33 +26,29 @@ namespace UI { switch (DAT_GameCore::instance.historicCampaignNumber) { case 1: DAT_00eb0b20::instance = MACRO_CALL_MEMBER( - UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("c1pic.tgx"); + UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)("c1pic.tgx"); break; case 2: DAT_00eb0b20::instance = MACRO_CALL_MEMBER( - UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("c2pic.tgx"); + UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)("c2pic.tgx"); break; case 3: DAT_00eb0b20::instance = MACRO_CALL_MEMBER( - UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("c3pic.tgx"); + UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)("c3pic.tgx"); break; case 4: DAT_00eb0b20::instance = MACRO_CALL_MEMBER( - UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("c4pic.tgx"); + UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)("c4pic.tgx"); break; } DAT_NumberOfStoredMenuStrings::instance = 0; pcVar1 = MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( - DE::SHCDE::TEXT_CAMPAIGN_INFO, (int)(DAT_GameCore::instance.historicCampaignNumber * 6 + -5)); + DE::SHCDE::TEXT_CAMPAIGN_INFO, (int)(DAT_GameCore::instance.historicCampaignNumber * 6 - 5)); MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)(pcVar1); pcVar1 = MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( - DE::SHCDE::TEXT_CAMPAIGN_INFO, (int)(DAT_GameCore::instance.historicCampaignNumber * 6 + -4)); + DE::SHCDE::TEXT_CAMPAIGN_INFO, (int)(DAT_GameCore::instance.historicCampaignNumber * 6 - 4)); MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)(pcVar1); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); FLOAT_00ec0834::instance = 0.0; diff --git a/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_DoEveryFrame.cpp index 0ea1602773..d5d2044a4d 100644 --- a/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_DoEveryFrame.cpp @@ -12,8 +12,6 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using OpenSHC::UI::Enums::MenuModalType; - // FUNCTION: STRONGHOLDCRUSADER 0x00425580 void HistoricCampaignSelect::MenuView_HistoricCampaignSelect_DoEveryFrame() { diff --git a/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp index 72dc007a0e..114b96270d 100644 --- a/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp @@ -16,28 +16,24 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using UI::Enums::MenuModalType; - using WindowsHelper::Enums::BOOLEnum; - // FUNCTION: STRONGHOLDCRUSADER 0x00425500 void HistoricCampaignSelect::MenuView_HistoricCampaignSelect_Prepare() { DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("frontend_combat.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("frontend_combat2.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "frontend_combat.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "frontend_combat2.tgx"); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); DWORD DVar1 = timeGetTime(); - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x163].stateTransitionTimeBaseUnk_0x18 - = DVar1 - 0x12c0; - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x164].stateTransitionTimeBaseUnk_0x18 = DVar1 - 0xc80; - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x165].stateTransitionTimeBaseUnk_0x18 = DVar1 - 0x640; - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x166].stateTransitionTimeBaseUnk_0x18 = DVar1; + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[355].stateTransitionTimeBaseUnk_0x18 = DVar1 - 4800; + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[356].stateTransitionTimeBaseUnk_0x18 = DVar1 - 3200; + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[357].stateTransitionTimeBaseUnk_0x18 = DVar1 - 1600; + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[358].stateTransitionTimeBaseUnk_0x18 = DVar1; INT_00b95abc::instance = -1; DAT_UnknownGFXIndex::instance = 0; - MACRO_CALL_MEMBER(UI::MenuModalComposition_Func::activateModalDialog, - DAT_MenuModalComposition3::ptr)(UI::Enums::MMT_NONE, FALSE); + MACRO_CALL_MEMBER(UI::MenuModalComposition_Func::activateModalDialog, DAT_MenuModalComposition3::ptr)( + UI::Enums::MMT_NONE, FALSE); } } diff --git a/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp index 8e1bad1660..6dc1fe6cdc 100644 --- a/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp @@ -14,15 +14,13 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using WindowsHelper::Enums::BOOLEnum; - // FUNCTION: STRONGHOLDCRUSADER 0x00426830 void HistoricMissionSelect::MenuView_HistoricMissionSelect_Prepare() { DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("frontend_combat2.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "frontend_combat2.tgx"); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); DAT_GameCore::instance.section1066 = 0; DAT_MenuTextInputState::instance.lastListClickTime = 0; @@ -30,9 +28,9 @@ namespace UI { int iVar1; if (DAT_GameCore::instance.missionNumber1to20 < 6) { iVar1 = 0; - } else if (DAT_GameCore::instance.missionNumber1to20 < 0xb) { + } else if (DAT_GameCore::instance.missionNumber1to20 < 11) { iVar1 = 1; - } else if (DAT_GameCore::instance.missionNumber1to20 < 0x10) { + } else if (DAT_GameCore::instance.missionNumber1to20 < 16) { iVar1 = 2; } else { iVar1 = 3; diff --git a/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_DoEveryFrame.cpp index d1239578da..9458706528 100644 --- a/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_DoEveryFrame.cpp @@ -14,19 +14,16 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using OpenSHC::UI::Enums::MenuViewType; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - // FUNCTION: STRONGHOLDCRUSADER 0x00424AD0 void IntroVideo::MenuView_IntroVideo_DoEveryFrame() { DWORD DVar1 = timeGetTime(); if (400 <= DVar1 - TIME_IntroVideo_Prepare::instance) { - if (DAT_MouseState::instance.draggingStopped != FALSE) { + if (DAT_MouseState::instance.draggingStopped) { MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::BinkControlClass_Func::stopBinkPlayback, DAT_BinkControlState::ptr)(0); } - if (DAT_BinkControlState::instance.binkObjPtrArray[0] == (HBINK)0x0) { + if (DAT_BinkControlState::instance.binkObjPtrArray[0] == (HBINK)0) { MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( OpenSHC::UI::Enums::MVT_GAME_START_ENTER_NAME, 0); } diff --git a/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_Prepare.cpp b/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_Prepare.cpp index eba6627f9e..3599b70d73 100644 --- a/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_Prepare.cpp @@ -29,7 +29,7 @@ namespace UI { 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, (ushort)((int)(COL_BLACK::instance.shortValue))); MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::BinkControlClass_Func::playBINK, DAT_BinkControlState::ptr)(0, - "intro.bik", 0, 0, DAT_MenuHandlerState::instance.x + 0x50, DAT_MenuHandlerState::instance.y + 0x3c, 0); + "intro.bik", 0, 0, DAT_MenuHandlerState::instance.x + 80, DAT_MenuHandlerState::instance.y + 0x3c, 0); TIME_IntroVideo_Prepare::instance = timeGetTime(); } diff --git a/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp index 37c196c664..ab24bdc3da 100644 --- a/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp @@ -24,64 +24,59 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using Game::GameMode2; - using Game::TrailType; - using UI::Enums::MenuModalType; - using WindowsHelper::Enums::BOOLEnum; - // FUNCTION: STRONGHOLDCRUSADER 0x00427320 void LobbyMenu::MenuView_LobbyMenu_Prepare() { Menu* pMVar1; - MACRO_CALL_MEMBER(UI::MenuModalComposition_Func::activateModalDialog, - DAT_MenuModalComposition3::ptr)(UI::Enums::MMT_NONE, FALSE); + MACRO_CALL_MEMBER(UI::MenuModalComposition_Func::activateModalDialog, DAT_MenuModalComposition3::ptr)( + UI::Enums::MMT_NONE, FALSE); DAT_GameCore::instance.gameMode_2 = Game::GM_SKIRMISH_AND_MULTIPLAYER; DAT_GameCore::instance.currentTrailType = Game::TT_FIRST_EDITION; DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; DAT_GameSynchronyState::instance.field_0x106ee4 = 0; DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("frontend_combat3.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("firefly-small.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("table.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("tslice1.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("tslice2.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("tslice3.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("tslice4.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("tslice5.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("tslice6.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("tslice7.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("tslice8.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("tslice1b.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("tslice2b.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("tslice3b.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("tslice4b.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("tslice5b.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("tslice6b.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("tslice7b.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("tslice8b.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("pick_opponent_normal.tgx"); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("pick_opponent_large.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "frontend_combat3.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "firefly-small.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "table.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "tslice1.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "tslice2.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "tslice3.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "tslice4.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "tslice5.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "tslice6.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "tslice7.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "tslice8.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "tslice1b.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "tslice2b.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "tslice3b.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "tslice4b.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "tslice5b.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "tslice6b.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "tslice7b.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "tslice8b.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "pick_opponent_normal.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "pick_opponent_large.tgx"); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; diff --git a/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_Prepare.cpp index 86d6ce8966..3aa0828e48 100644 --- a/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_Prepare.cpp @@ -21,10 +21,6 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using OpenSHC::Game::GameMode2; - using OpenSHC::UI::Enums::MenuModalType; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - // FUNCTION: STRONGHOLDCRUSADER 0x00424C40 void MainMenu::MenuView_MainMenu_Prepare() { diff --git a/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp index d2e71bac8a..0462dedb22 100644 --- a/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp @@ -16,10 +16,6 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using OpenSHC::DE::SHCDE::eGM; - using OpenSHC::Rendering::Enums::RenderTarget; - using OpenSHC::UI::Enums::BuildingsAndStatusMenuTabType; - // FUNCTION: STRONGHOLDCRUSADER 0x004313C0 void MapEditorLandscaping::MenuView_MapEditorLandscaping_DoEveryFrame() { @@ -34,12 +30,12 @@ namespace UI { DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_PANELS, 3, - DAT_MenuHandlerState::instance.x, DAT_MenuHandlerState::instance.y + 0x1b2); + DAT_MenuHandlerState::instance.x, DAT_MenuHandlerState::instance.y + 434); DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; LAB_00431429: DAT_MinimapViewState::instance.needsRedraw = 1; MACRO_CALL_MEMBER(OpenSHC::UI::MinimapViewState_Func::renderMinimapLandscaping, DAT_MinimapViewState::ptr)( - DAT_MenuHandlerState::instance.x + 0x298, DAT_MenuHandlerState::instance.y + 0x1d0, 0x80, 0x80); + DAT_MenuHandlerState::instance.x + 664, DAT_MenuHandlerState::instance.y + 464, 128, 128); } } diff --git a/src/OpenSHC/UI/MenuViews/MissionSelect/MenuView_MissionSelect_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/MissionSelect/MenuView_MissionSelect_DoEveryFrame.cpp index 4c055bcd72..01cf9049f8 100644 --- a/src/OpenSHC/UI/MenuViews/MissionSelect/MenuView_MissionSelect_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/MissionSelect/MenuView_MissionSelect_DoEveryFrame.cpp @@ -17,9 +17,6 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using OpenSHC::Rendering::Enums::RenderTarget; - using OpenSHC::UI::Enums::MenuModalType; - // FUNCTION: STRONGHOLDCRUSADER 0x004268C0 void MissionSelect::MenuView_MissionSelect_DoEveryFrame() { @@ -33,10 +30,10 @@ namespace UI { / 2); if ((DAT_MenuTextInputState::instance.currentModalDialog == OpenSHC::UI::Enums::MMT_NO_MENU) && (DAT_MenuModalComposition1::instance.activeModalDialogID == OpenSHC::UI::Enums::MMT_NONE)) { - int y1 = DAT_MenuHandlerState::instance.y + 0xbe; - int x2 = DAT_MenuHandlerState::instance.x + 0x23a; - int x1 = DAT_MenuHandlerState::instance.x + 0xe5; - int y2 = DAT_MenuHandlerState::instance.y + 0x121; + int y1 = DAT_MenuHandlerState::instance.y + 190; + int x2 = DAT_MenuHandlerState::instance.x + 570; + int x1 = DAT_MenuHandlerState::instance.x + 229; + int y2 = DAT_MenuHandlerState::instance.y + 289; MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( x1, y1 - 1, x2, y1 - 1, (ushort)((int)(COL_VERY_SOFT_YELLOW::instance.shortValue))); MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( @@ -50,8 +47,8 @@ namespace UI { added by script: "Mission" */ MACRO_CALL_MEMBER( - OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, DAT_PencilRenderCore::ptr)(5, - 0xf, DAT_MenuHandlerState::instance.x + 0xb8, DAT_MenuHandlerState::instance.y + 100, 0x1b0, 0x32); + OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, DAT_PencilRenderCore::ptr)( + 5, 0xf, DAT_MenuHandlerState::instance.x + 184, DAT_MenuHandlerState::instance.y + 100, 432, 50); DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; } return; diff --git a/src/OpenSHC/UI/MenuViews/MpConnection/MenuView_MpConnection_Prepare.cpp b/src/OpenSHC/UI/MenuViews/MpConnection/MenuView_MpConnection_Prepare.cpp index 13a89221ac..1c4697e25c 100644 --- a/src/OpenSHC/UI/MenuViews/MpConnection/MenuView_MpConnection_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/MpConnection/MenuView_MpConnection_Prepare.cpp @@ -17,16 +17,14 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using WindowsHelper::Enums::BOOLEnum; - // FUNCTION: STRONGHOLDCRUSADER 0x00427110 void MpConnection::MenuView_MpConnection_Prepare() { Menu* pMVar1; DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("frontend_combat3.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "frontend_combat3.tgx"); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; @@ -37,8 +35,7 @@ namespace UI { DAT_MenuHandlerState::instance.y = borderHeight; MACRO_CALL_MEMBER( Synchrony::GameSynchronyState_Func::initializeMultiplayerLobby, DAT_GameSynchronyState::ptr)(); - MACRO_CALL_MEMBER( - UI::MenuModalComposition_Func::activateModalDialog, DAT_MenuModalComposition1::ptr)( + MACRO_CALL_MEMBER(UI::MenuModalComposition_Func::activateModalDialog, DAT_MenuModalComposition1::ptr)( (UI::Enums::MenuModalType)DAT_GameSynchronyState::instance.nextModalDialog, FALSE); } diff --git a/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoEveryFrame.cpp index d2828dc640..d1416248d5 100644 --- a/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoEveryFrame.cpp @@ -19,9 +19,7 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using OpenSHC::DE::SHCDE::eTextSections; using OpenSHC::Rendering::Colors::BGR24; - using OpenSHC::Rendering::Enums::RenderTarget; using OpenSHC::Text::TextAlignment; using OpenSHC::WindowsHelper::Enums::BOOLEnum; @@ -45,17 +43,17 @@ namespace UI { / 2); DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBorderedBoxWithBlendedBackground, - DAT_PencilRenderCore::ptr)(DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 0x58, - DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 100, 0x270, 400); + DAT_PencilRenderCore::ptr)(DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 88, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 100, 624, 400); MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderBanner, - DAT_PencilRenderCore::ptr)(DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 0x58, - DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 100, 0x270, 400); + DAT_PencilRenderCore::ptr)(DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 88, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 100, 624, 400); iVar8 = 0; BVar7 = FALSE; - iVar6 = 0x10; + iVar6 = 16; BVar5 = 0xccfaff; TVar4 = OpenSHC::Text::TTA_CENTER; - iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 0x82; + iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 130; iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; /* @@ -68,7 +66,7 @@ namespace UI { if (DAT_HighlightedSkirmishType::instance == 1) { iVar8 = 0; BVar7 = FALSE; - iVar6 = 0x10; + iVar6 = 16; BVar5 = 0xccfaff; TVar4 = OpenSHC::Text::TTA_CENTER; iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; @@ -82,10 +80,10 @@ namespace UI { iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); iVar8 = 0; BVar7 = FALSE; - iVar6 = 0x11; + iVar6 = 17; BVar5 = 0xccfaff; TVar4 = OpenSHC::Text::TTA_CENTER; - iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 0x1b8; + iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 440; iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; /* added by script: "Fight through 50 linked Crusader games" @@ -98,7 +96,7 @@ namespace UI { if (DAT_HighlightedSkirmishType::instance == 2) { iVar8 = 0; BVar7 = FALSE; - iVar6 = 0x10; + iVar6 = 16; BVar5 = 0xccfaff; TVar4 = OpenSHC::Text::TTA_CENTER; iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; @@ -112,10 +110,10 @@ namespace UI { iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); iVar8 = 0; BVar7 = FALSE; - iVar6 = 0x11; + iVar6 = 17; BVar5 = 0xccfaff; TVar4 = OpenSHC::Text::TTA_CENTER; - iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 0x1b8; + iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 440; iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; /* added by script: "Customize your own Crusader game." @@ -128,7 +126,7 @@ namespace UI { if (DAT_HighlightedSkirmishType::instance == 3) { iVar8 = 0; BVar7 = FALSE; - iVar6 = 0x10; + iVar6 = 16; BVar5 = 0xccfaff; TVar4 = OpenSHC::Text::TTA_CENTER; iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; @@ -138,27 +136,27 @@ namespace UI { */ MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, - DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 0x15), + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 21), iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); iVar8 = 0; BVar7 = FALSE; - iVar6 = 0x11; + iVar6 = 17; BVar5 = 0xccfaff; TVar4 = OpenSHC::Text::TTA_CENTER; - iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 0x1b8; + iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 440; iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; /* added by script: "Fight through 30 linked Crusader games" */ MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, - DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 0x16), + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 22), iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); } if (DAT_HighlightedSkirmishType::instance == 4) { iVar8 = 0; BVar7 = FALSE; - iVar6 = 0x10; + iVar6 = 16; BVar5 = 0xccfaff; TVar4 = OpenSHC::Text::TTA_CENTER; iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; @@ -168,21 +166,21 @@ namespace UI { */ MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, - DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 0x17), + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 23), iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); iVar8 = 0; BVar7 = FALSE; - iVar6 = 0x11; + iVar6 = 17; BVar5 = 0xccfaff; TVar4 = OpenSHC::Text::TTA_CENTER; - iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 0x1b8; + iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 440; iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; /* added by script: "Fight through 20 linked Extreme games" */ MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, - DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 0x18), + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 24), iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); } return; diff --git a/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp b/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp index 8492dcdc92..78db335c6b 100644 --- a/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp @@ -32,10 +32,6 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using Game::GameMode; - using Game::GameMode2; - using WindowsHelper::Enums::BOOLEnum; - // FUNCTION: STRONGHOLDCRUSADER 0x00448D40 void SingleplayerMapChoice::MenuView_SingleplayerMapChoice_Prepare() { @@ -60,21 +56,21 @@ namespace UI { DAT_SH1_SiegeAdvancedMode::instance = 0; DAT_SiegeRemainingPoints::instance = 0; } else { - MACRO_CALL(UI::MenuItems::SinglePlayerMapChoice_Func:: - MenuItemActionHandler_SingleplayerMapChoice_MapTable)( + MACRO_CALL( + UI::MenuItems::SinglePlayerMapChoice_Func::MenuItemActionHandler_SingleplayerMapChoice_MapTable)( DAT_GameSynchronyState::instance.DAT_MapSelectionRelativeSelected); DAT_GameSynchronyState::instance.skirmishRelated1 = 1; } - DAT_ButtonBackgroundBlendStrength::instance = 0x20; + DAT_ButtonBackgroundBlendStrength::instance = 32; DAT_00b960dc::instance = 0xfffffffd; DWORD_00b95b1c::instance = timeGetTime(); DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; if ((int)DAT_MapMissionType::instance < 2) { - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("frontend_economics2.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "frontend_economics2.tgx"); } else { - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("frontend_combat2.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "frontend_combat2.tgx"); } MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; diff --git a/src/OpenSHC/UI/MenuViews/Unknown33/MenuView_Unknown33_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/Unknown33/MenuView_Unknown33_DoEveryFrame.cpp index 5c4d78f3f2..065303fbbc 100644 --- a/src/OpenSHC/UI/MenuViews/Unknown33/MenuView_Unknown33_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/Unknown33/MenuView_Unknown33_DoEveryFrame.cpp @@ -21,11 +21,6 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using OpenSHC::Commands::GameCommandType; - using OpenSHC::UI::Enums::BuildingsAndStatusMenuTabType; - using OpenSHC::UI::Enums::MenuViewType; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - // FUNCTION: STRONGHOLDCRUSADER 0x0042C090 void Unknown33::MenuView_Unknown33_DoEveryFrame() { @@ -33,7 +28,7 @@ namespace UI { iVar1 = MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::checkAllPlayersReadyAndCleanupSlots, DAT_GameSynchronyState::ptr)(); if (iVar1 != 0) { - if (DAT_GameSynchronyState::instance.isHost != FALSE) { + if (DAT_GameSynchronyState::instance.isHost) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)(OpenSHC::Commands::GCT_HOST_SHARE_LOBBY_STATE); DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 0; @@ -42,11 +37,11 @@ namespace UI { } for (int iVar1 = 1; iVar1 < 9; iVar1 = iVar1 + 1) { if (DAT_GameSynchronyState::instance.currentPlayerFullIDArray[iVar1] == -1 - && (DAT_GameCore::instance.mapU4Int0 == 0 - || (iVar1 != DAT_GameState::instance.mapAndTime.somePlayerID)) - && DAT_GameSynchronyState::instance.currentAIArray[iVar1] == 0) { - MACRO_CALL_MEMBER(OpenSHC::Game::GameStateStructures_Func::destroyPlayerCompletely, - DAT_GameState::ptr)(iVar1); + && (DAT_GameCore::instance.mapU4Int0 == 0 + || (iVar1 != DAT_GameState::instance.mapAndTime.somePlayerID)) + && DAT_GameSynchronyState::instance.currentAIArray[iVar1] == 0) { + MACRO_CALL_MEMBER(OpenSHC::Game::GameStateStructures_Func::destroyPlayerCompletely, + DAT_GameState::ptr)(iVar1); } } MACRO_CALL(OpenSHC::Synchrony_Func::SetAIPlayerNickNames)(); diff --git a/src/OpenSHC/UI/MenuViews/UnusedCreateSiege/MenuView_UnusedCreateSiege_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedCreateSiege/MenuView_UnusedCreateSiege_Prepare.cpp index 85792a47d4..c7aeb5a24b 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedCreateSiege/MenuView_UnusedCreateSiege_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedCreateSiege/MenuView_UnusedCreateSiege_Prepare.cpp @@ -14,8 +14,6 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - // FUNCTION: STRONGHOLDCRUSADER 0x00430690 void UnusedCreateSiege::MenuView_UnusedCreateSiege_Prepare() { diff --git a/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_Prepare.cpp index 4080ff0a80..98259677ea 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_Prepare.cpp @@ -19,9 +19,6 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using OpenSHC::Rendering::ScreenResolutionEnum; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - // FUNCTION: STRONGHOLDCRUSADER 0x00426570 void UnusedDemoBuyItScreen::MenuView_UnusedDemoBuyItScreen_Prepare() { @@ -34,10 +31,10 @@ namespace UI { INT_00b95b34::instance = timeGetTime(); INT_00b960e0::instance = 0; if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_800x600) { - INT_00b960e0::instance = 0x18; + INT_00b960e0::instance = 24; } MACRO_CALL_MEMBER(OpenSHC::Audio::MSS::SoundSystem_Func::shutdownSoundSystem, DAT_SoundSystemState::ptr)(); - if (DAT_GameSynchronyState::instance.openOnClose != FALSE) { + if (DAT_GameSynchronyState::instance.openOnClose) { DAT_WindowAndDirectDraw::instance.postWindowCloseMessage = 1; } } diff --git a/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp index bc7c4740bd..774c96d283 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp @@ -22,12 +22,12 @@ namespace UI { DAT_TextureRenderCoreObject::ptr)("frontend_economics2.tgx"); MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); DWORD _currentTime = timeGetTime(); - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x168].stateTransitionTimeBaseUnk_0x18 - = _currentTime - 0x12c0; - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x169].stateTransitionTimeBaseUnk_0x18 - = _currentTime - 0xc80; - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[0x16a].stateTransitionTimeBaseUnk_0x18 - = _currentTime - 0x640; + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[360].stateTransitionTimeBaseUnk_0x18 + = _currentTime - 4800; + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[361].stateTransitionTimeBaseUnk_0x18 + = _currentTime - 3200; + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[362].stateTransitionTimeBaseUnk_0x18 + = _currentTime - 1600; INT_00b95abc::instance = -1; DAT_GameCore::instance.isTimeHalted2 = 0; } diff --git a/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp index c16d170294..5dbd1ec216 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp @@ -12,8 +12,6 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - // FUNCTION: STRONGHOLDCRUSADER 0x00426C50 void UnusedEconomicMissionSelect::MenuView_UnusedEconomicMissionSelect_Prepare() { @@ -24,7 +22,7 @@ namespace UI { MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); DAT_GameCore::instance.section1066 = 0; DAT_MenuTextInputState::instance.lastListClickTime = 0; - DAT_GameCore::instance.missionNumber1to20 = 0x21; + DAT_GameCore::instance.missionNumber1to20 = 33; DAT_MenuTextInputState::instance.lastClickedListIndex = 0xffffffff; } diff --git a/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoEveryFrame.cpp index 2a658ec167..309accbae6 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoEveryFrame.cpp @@ -27,7 +27,7 @@ namespace UI { iVar1 = MACRO_CALL(UI::Helpers_Func::FindCampaignMapHotspotAtMouse)(); if (iVar1 == 1) { MACRO_CALL(UI::Credits_Func::EndCreditsSegmentAndAdvanceToNext)(); - DAT_00ed278c::instance = DAT_00ed278c::instance + 1; + ++DAT_00ed278c::instance; if (DAT_00ed278c::instance == 3) { DAT_WindowAndDirectDraw::instance.postWindowCloseMessage = 1; } @@ -37,7 +37,7 @@ namespace UI { if ((int)DAT_UnknownBinkIndex::instance < (int)DAT_UnknownBinkCount::instance) { MACRO_CALL(Rendering_Func::RenderActiveCreditsElements)(); } - INT_00ed3140::instance = INT_00ed3140::instance + 1; + ++INT_00ed3140::instance; if ((int)DAT_UnknownBinkIndex::instance >= (int)DAT_UnknownBinkCount::instance) { DAT_WindowAndDirectDraw::instance.postWindowCloseMessage = 1; } diff --git a/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp index aea38aa913..1a5d7b81c7 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp @@ -18,9 +18,6 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using Text::TextAlignment; - using WindowsHelper::Enums::BOOLEnum; - // FUNCTION: STRONGHOLDCRUSADER 0x0042DD00 void UnusedOldTitleMenu::MenuView_UnusedOldTitleMenu_DoInitial() { @@ -39,8 +36,8 @@ namespace UI { DAT_MenuHandlerState::instance.y = borderHeight; MACRO_CALL_MEMBER( UI::Rendering::PencilRenderCore_Func::drawPixelPattern4x4OverWholeScreen, DAT_PencilRenderCore::ptr)(); - top = (DAT_WindowAndDirectDraw::instance.resolutionY + -400) / 2; - left = (DAT_WindowAndDirectDraw::instance.resolutionX + -600) / 2; + top = (DAT_WindowAndDirectDraw::instance.resolutionY - 400) / 2; + left = (DAT_WindowAndDirectDraw::instance.resolutionX - 600) / 2; MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)( left, top, left + 600, top + 400, (ushort)(COL_WHITE::instance.shortValue)); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( @@ -48,10 +45,10 @@ namespace UI { DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 100); MACRO_CALL_MEMBER(Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)("FireFly\'s", DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400, - DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 0xd2, Text::TTA_LEFT, 0x80ff, 0xf, FALSE, 0); + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 210, Text::TTA_LEFT, 33023, 0xf, FALSE, 0); MACRO_CALL_MEMBER(Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)("Crusader", DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400, - DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 0xf8, Text::TTA_LEFT, 0, 0x11, FALSE, 0); + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 0xf8, Text::TTA_LEFT, 0, 17, FALSE, 0); } } diff --git a/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_Prepare.cpp index 31c4bbf398..0cc7327bdb 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_Prepare.cpp @@ -12,8 +12,6 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using WindowsHelper::Enums::BOOLEnum; - // FUNCTION: STRONGHOLDCRUSADER 0x0042DCB0 void UnusedOldTitleMenu::MenuView_UnusedOldTitleMenu_Prepare() { @@ -26,8 +24,8 @@ namespace UI { DAT_MenuHandlerState::instance.y = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("gm_fly.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "gm_fly.tgx"); } } diff --git a/src/OpenSHC/UI/MenuViews/UnusedSelectRandomNumberOfEnemies/MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/UnusedSelectRandomNumberOfEnemies/MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame.cpp index 028eabc4f0..b4c597232d 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedSelectRandomNumberOfEnemies/MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedSelectRandomNumberOfEnemies/MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame.cpp @@ -18,9 +18,7 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using OpenSHC::DE::SHCDE::eTextSections; using OpenSHC::Rendering::Colors::BGR24; - using OpenSHC::Rendering::Enums::RenderTarget; using OpenSHC::Text::TextAlignment; using OpenSHC::WindowsHelper::Enums::BOOLEnum; @@ -50,7 +48,7 @@ namespace UI { DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 100, 600, 400); iVar5 = 0; keepOffsetX = FALSE; - iVar4 = 0x11; + iVar4 = 17; color = 0xccfaff; alignment = OpenSHC::Text::TTA_CENTER; iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 200; @@ -64,7 +62,7 @@ namespace UI { DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_NEW_TEXT, 1), iVar3, iVar1, alignment, color, iVar4, keepOffsetX, iVar5); blendStrength = 0; - iVar5 = 0x12; + iVar5 = 18; color_00 = 0xccfaff; iVar4 = 400; iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; From 374504afb8e9236498aedcc155649e3ed6dd022d Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Mon, 9 Nov 2026 11:16:02 +0100 Subject: [PATCH 50/58] MenuView_SelectCrusade_DoEveryFrame: style pass on gynt's version The decompiler's argument locals (iVar1 to iVar8, TVar4, BVar5, BVar7) become named positions declared where they are set, the other arguments are written in the calls, the colour is COL_CCFAFF, the "added by script" block comments are // "text" lines, and the trailing return goes. quick_diff identical before and after (0.9519, the listing's ret). Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- .../MenuView_SelectCrusade_DoEveryFrame.cpp | 154 +++++------------- 1 file changed, 41 insertions(+), 113 deletions(-) diff --git a/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoEveryFrame.cpp index d1416248d5..7017507970 100644 --- a/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoEveryFrame.cpp @@ -4,10 +4,9 @@ #include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/DE/SHCDE/eTextSections.hpp" -#include "OpenSHC/Rendering/Colors/BGR24.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" #include "OpenSHC/Rendering/Enums/RenderTarget.hpp" #include "OpenSHC/Text/TextAlignment.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_HighlightedSkirmishType.hpp" #include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" @@ -19,20 +18,9 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using OpenSHC::Rendering::Colors::BGR24; - using OpenSHC::Text::TextAlignment; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - // FUNCTION: STRONGHOLDCRUSADER 0x0042BBF0 void SelectCrusade::MenuView_SelectCrusade_DoEveryFrame() { - int iVar1; - int iVar3; - TextAlignment TVar4; - BGR24 BVar5; - int iVar6; - BOOLEnum BVar7; - int iVar8; MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(0, (DAT_WindowAndDirectDraw::instance.resolutionX @@ -48,142 +36,82 @@ namespace UI { MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderBanner, DAT_PencilRenderCore::ptr)(DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 88, DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 100, 624, 400); - iVar8 = 0; - BVar7 = FALSE; - iVar6 = 16; - BVar5 = 0xccfaff; - TVar4 = OpenSHC::Text::TTA_CENTER; - iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 130; - iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + int const titleY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 130; + int const titleX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; - /* - added by script: "Choose type of Crusader game" - */ + // "Choose type of Crusader game" MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE, 0), - iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); + titleX, titleY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 16, FALSE, 0); if (DAT_HighlightedSkirmishType::instance == 1) { - iVar8 = 0; - BVar7 = FALSE; - iVar6 = 16; - BVar5 = 0xccfaff; - TVar4 = OpenSHC::Text::TTA_CENTER; - iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; - iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; - /* - added by script: "Crusader 'First Edition' Trail" - */ + int const nameY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; + int const nameX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + // "Crusader 'First Edition' Trail" MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE, 1), - iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); - iVar8 = 0; - BVar7 = FALSE; - iVar6 = 17; - BVar5 = 0xccfaff; - TVar4 = OpenSHC::Text::TTA_CENTER; - iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 440; - iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; - /* - added by script: "Fight through 50 linked Crusader games" - */ + nameX, nameY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 16, FALSE, 0); + int const descriptionY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 440; + int const descriptionX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + // "Fight through 50 linked Crusader games" MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE, 2), - iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); + descriptionX, descriptionY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 17, + FALSE, 0); } if (DAT_HighlightedSkirmishType::instance == 2) { - iVar8 = 0; - BVar7 = FALSE; - iVar6 = 16; - BVar5 = 0xccfaff; - TVar4 = OpenSHC::Text::TTA_CENTER; - iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; - iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; - /* - added by script: "Custom Game" - */ + int const nameY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; + int const nameX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + // "Custom Game" MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE, 3), - iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); - iVar8 = 0; - BVar7 = FALSE; - iVar6 = 17; - BVar5 = 0xccfaff; - TVar4 = OpenSHC::Text::TTA_CENTER; - iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 440; - iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; - /* - added by script: "Customize your own Crusader game." - */ + nameX, nameY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 16, FALSE, 0); + int const descriptionY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 440; + int const descriptionX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + // "Customize your own Crusader game." MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE, 4), - iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); + descriptionX, descriptionY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 17, + FALSE, 0); } if (DAT_HighlightedSkirmishType::instance == 3) { - iVar8 = 0; - BVar7 = FALSE; - iVar6 = 16; - BVar5 = 0xccfaff; - TVar4 = OpenSHC::Text::TTA_CENTER; - iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; - iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; - /* - added by script: "Crusader 'Warchest' Trail" - */ + int const nameY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; + int const nameX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + // "Crusader 'Warchest' Trail" MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 21), - iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); - iVar8 = 0; - BVar7 = FALSE; - iVar6 = 17; - BVar5 = 0xccfaff; - TVar4 = OpenSHC::Text::TTA_CENTER; - iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 440; - iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; - /* - added by script: "Fight through 30 linked Crusader games" - */ + nameX, nameY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 16, FALSE, 0); + int const descriptionY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 440; + int const descriptionX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + // "Fight through 30 linked Crusader games" MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 22), - iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); + descriptionX, descriptionY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 17, + FALSE, 0); } if (DAT_HighlightedSkirmishType::instance == 4) { - iVar8 = 0; - BVar7 = FALSE; - iVar6 = 16; - BVar5 = 0xccfaff; - TVar4 = OpenSHC::Text::TTA_CENTER; - iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; - iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; - /* - added by script: "Crusader Extreme Trail" - */ + int const nameY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; + int const nameX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + // "Crusader Extreme Trail" MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 23), - iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); - iVar8 = 0; - BVar7 = FALSE; - iVar6 = 17; - BVar5 = 0xccfaff; - TVar4 = OpenSHC::Text::TTA_CENTER; - iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 440; - iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; - /* - added by script: "Fight through 20 linked Extreme games" - */ + nameX, nameY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 16, FALSE, 0); + int const descriptionY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 440; + int const descriptionX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + // "Fight through 20 linked Extreme games" MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 24), - iVar3, iVar1, TVar4, BVar5, iVar6, BVar7, iVar8); + descriptionX, descriptionY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 17, + FALSE, 0); } - return; } } From 8d9e7b3ef9fc0775caee89f0da60187d60194ce6 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Mon, 9 Nov 2026 11:16:02 +0100 Subject: [PATCH 51/58] MenuViews backlog: string pointers from string-literals.hpp in place of literals The 19 files of gynt's that wrote file names and texts as literals use main's s_ pointers instead (style guide 12), each for the address the original pushes where a text is stored more than once, and include string-literals.hpp. MenuView_CrusadeEndscreen_Prepare passes them to AppendCreditsBinkVideoCommand and AppendCreditsBinkVideoWithAudioCommand through (char*), as main does where a header takes a char*. quick_diff identical for every file. Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- .../MenuView_CrusadeEndscreen_Prepare.cpp | 109 +++++++++++------- .../MenuView_CustomScenarios_Prepare.cpp | 5 +- ...MenuView_HistoricCampaignIntro_Prepare.cpp | 17 +-- ...enuView_HistoricCampaignSelect_Prepare.cpp | 5 +- ...MenuView_HistoricMissionSelect_Prepare.cpp | 3 +- .../MenuView_IntroLogos_Prepare.cpp | 9 +- .../MenuView_IntroVideo_Prepare.cpp | 4 +- .../LobbyMenu/MenuView_LobbyMenu_Prepare.cpp | 43 +++---- .../MainMenu/MenuView_MainMenu_DoInitial.cpp | 3 +- .../MainMenu/MenuView_MainMenu_Prepare.cpp | 5 +- .../MenuView_MpConnection_Prepare.cpp | 3 +- ...MenuView_SingleplayerMapChoice_Prepare.cpp | 5 +- ...known61ReturnToSkrimishMenuUnk_Prepare.cpp | 9 +- .../MenuView_UnusedCreateSiege_Prepare.cpp | 3 +- ...MenuView_UnusedDemoBuyItScreen_Prepare.cpp | 3 +- ...w_UnusedEconomicGametypeSelect_Prepare.cpp | 5 +- ...ew_UnusedEconomicMissionSelect_Prepare.cpp | 3 +- .../MenuView_UnusedOldTitleMenu_DoInitial.cpp | 9 +- .../MenuView_UnusedOldTitleMenu_Prepare.cpp | 3 +- 19 files changed, 145 insertions(+), 101 deletions(-) diff --git a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp index 00788ca9eb..b04d34a588 100644 --- a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp @@ -9,6 +9,7 @@ #include "OpenSHC/DE/SHCDE/eTextSections.hpp" #include "OpenSHC/Game/TrailType.hpp" #include "OpenSHC/Text/GameLanguage.hpp" +#include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" #include "OpenSHC/Globals/DAT_NumberOfStoredMenuStrings.hpp" @@ -27,25 +28,25 @@ namespace UI { undefined4 uVar2; DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "sktrail_win.tgx"); + s_sktrail_win_tgx_005ab768); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "endframe1.tgx"); + s_endframe1_tgx_005ab758); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "endframe2.tgx"); + s_endframe2_tgx_005ab748); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "endframe3.tgx"); + s_endframe3_tgx_005ab738); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "endframe4.tgx"); + s_endframe4_tgx_005ab728); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "endframe5.tgx"); + s_endframe5_tgx_005ab718); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "endframe6.tgx"); + s_endframe6_tgx_005ab708); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "endframe7.tgx"); + s_endframe7_tgx_005ab6f8); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "endframe8.tgx"); + s_endframe8_tgx_005ab6e8); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "jesterlast.tgx"); + s_jesterlast_tgx_005ab6d8); MACRO_CALL(UI::Credits_Func::ResetCredits)(); DAT_NumberOfStoredMenuStrings::instance = 0; /* @@ -83,51 +84,59 @@ namespace UI { MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(0xf, 0, 0xf, 1, 402, 234, 0, 1); MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(0xf, 0, 0xf, 0, 400, 232, 0, 1); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 1, 106, 53, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "rt_vict1.bik", 106, 53, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_rt_vict1_bik_005a78fc, 106, 53, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( - "fx\\speech\\rt_anger_04.wav", 3, 0, 100); + (char*)s_fx_speech_rt_anger_04_wav_005ab6bc, 3, 0, 100); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 2, 331, 24, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "sn_vict2.bik", 331, 24, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_sn_vict2_bik_005a78ec, 331, 24, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( - "fx\\speech\\sn_add_player.wav", 3, 0, 100); + (char*)s_fx_speech_sn_add_player_wav_005ab6a0, 3, 0, 100); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 3, 557, 53, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "pg_taunt2.bik", 557, 53, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_pg_taunt2_bik_005a7c44, 557, 53, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( - "fx\\speech\\pg_add_player.wav", 3, 0, 100); + (char*)s_fx_speech_pg_add_player_wav_005ab684, 3, 0, 100); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 4, 640, 223, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "wf_anger1.bik", 640, 223, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_wf_anger1_bik_005a7b20, 640, 223, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( - "fx\\speech\\wf_anger_04.wav", 3, 0, 100); + (char*)s_fx_speech_wf_anger_04_wav_005ab668, 3, 0, 100); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 5, 557, 394, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "saladin_angry.bik", 557, 394, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_saladin_angry_bik_005a7b0c, 557, 394, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( - "fx\\speech\\sa_extra_01.wav", 3, 0, 100); + (char*)s_fx_speech_sa_extra_01_wav_005ab64c, 3, 0, 100); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 6, 332, 436, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "sultan_natural.bik", 332, 436, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_sultan_natural_bik_005a78a4, 332, 436, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( - "fx\\speech\\su_congrats_01.wav", 3, 0, 100); + (char*)s_fx_speech_su_congrats_01_wav_005ab62c, 3, 0, 100); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 7, 106, 394, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "richard_taunting.bik", 106, 394, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_richard_taunting_bik_005a7d00, 106, 394, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( - "fx\\speech\\ri_congrats_01.wav", 3, 0, 100); + (char*)s_fx_speech_ri_congrats_01_wav_005ab60c, 3, 0, 100); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 8, 35, 223, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "bad_arab_taunt.bik", 35, 223, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_bad_arab_taunt_bik_005a7d2c, 35, 223, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( - "fx\\speech\\ca_add_player_01.wav", 3, 0, 100); + (char*)s_fx_speech_ca_add_player_01_wav_005ab5ec, 3, 0, 100); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); uVar2 = 16; @@ -167,60 +176,76 @@ namespace UI { } MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, Audio::MSS::enums::SND_STR_SFX_1Unk); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 106, 53, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 106, 53, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 106, 53, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, Audio::MSS::enums::SND_STR_SFX_2Unk); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 331, 24, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 331, 24, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 331, 24, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, Audio::MSS::enums::SND_STR_SPEECH_1); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 557, 53, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 557, 53, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 557, 53, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, Audio::MSS::enums::SND_STR_SPEECH_2); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 640, 223, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 640, 223, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 640, 223, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, (Audio::MSS::enums::SHC_SoundStream)(Audio::MSS::enums::SND_STR_SPEECH_2 | Audio::MSS::enums::SND_STR_SFX_1Unk)); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 557, 394, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 557, 394, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 557, 394, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, (Audio::MSS::enums::SHC_SoundStream)(Audio::MSS::enums::SND_STR_SPEECH_2 | Audio::MSS::enums::SND_STR_SFX_2Unk)); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 332, 436, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 332, 436, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 332, 436, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, (Audio::MSS::enums::SHC_SoundStream)(Audio::MSS::enums::SND_STR_SPEECH_2 | Audio::MSS::enums::SND_STR_SPEECH_1)); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 106, 394, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 106, 394, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 106, 394, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, ((SHC_SoundStream)8)); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 35, 223, 4); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 35, 223, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 35, 223, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsImageEndCommand)(42, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(16, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsSegmentEndCommand)(); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 106, 53, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 106, 53, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 331, 24, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 331, 24, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 557, 53, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 557, 53, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 640, 223, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 640, 223, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 557, 394, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 557, 394, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 332, 436, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 332, 436, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 106, 394, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 106, 394, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)(12, "action_jester.bik", 35, 223, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 35, 223, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); MACRO_CALL(UI::Credits_Func::AppendCreditsClearImageCommand)(); MACRO_CALL(Rendering_Func::TicksStartCounter)(); diff --git a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp index 5a21fc4a6a..d6e406d413 100644 --- a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp @@ -5,6 +5,7 @@ #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/Game/GameMode2.hpp" #include "OpenSHC/UI/Enums/BuildingsAndStatusMenuTabType.hpp" +#include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" #include "OpenSHC/Globals/DAT_GameState.hpp" @@ -25,9 +26,9 @@ namespace UI { { DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "frontend_builder.tgx"); + s_frontend_builder_tgx_005a2084); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "frontend_builder2.tgx"); + s_frontend_builder2_tgx_005a206c); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); DWORD DVar1 = timeGetTime(); DAT_UIButtonDefinedData::instance.ButtonGmDataArray[364].stateTransitionTimeBaseUnk_0x18 = DVar1 - 4800; diff --git a/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp b/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp index c224fac5db..d1f9591207 100644 --- a/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp @@ -5,6 +5,7 @@ #include "OpenSHC/UI/Helpers.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_00eb0b20.hpp" #include "OpenSHC/Globals/DAT_00ed2780.hpp" @@ -25,20 +26,20 @@ namespace UI { MACRO_CALL(UI::Helpers_Func::PrepareHistoryBook)(); switch (DAT_GameCore::instance.historicCampaignNumber) { case 1: - DAT_00eb0b20::instance = MACRO_CALL_MEMBER( - UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)("c1pic.tgx"); + DAT_00eb0b20::instance = MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_c1pic_tgx_005ab0ec); break; case 2: - DAT_00eb0b20::instance = MACRO_CALL_MEMBER( - UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)("c2pic.tgx"); + DAT_00eb0b20::instance = MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_c2pic_tgx_005ab0e0); break; case 3: - DAT_00eb0b20::instance = MACRO_CALL_MEMBER( - UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)("c3pic.tgx"); + DAT_00eb0b20::instance = MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_c3pic_tgx_005ab0d4); break; case 4: - DAT_00eb0b20::instance = MACRO_CALL_MEMBER( - UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)("c4pic.tgx"); + DAT_00eb0b20::instance = MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_c4pic_tgx_005ab0c8); break; } DAT_NumberOfStoredMenuStrings::instance = 0; diff --git a/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp index 114b96270d..f082edda1b 100644 --- a/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp @@ -5,6 +5,7 @@ #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/UI/Enums/MenuModalType.hpp" #include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" +#include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_MenuModalComposition3.hpp" #include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" @@ -21,9 +22,9 @@ namespace UI { { DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "frontend_combat.tgx"); + s_frontend_combat_tgx_005a2028); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "frontend_combat2.tgx"); + s_frontend_combat2_tgx_005a2010); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); DWORD DVar1 = timeGetTime(); DAT_UIButtonDefinedData::instance.ButtonGmDataArray[355].stateTransitionTimeBaseUnk_0x18 = DVar1 - 4800; diff --git a/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp index 6dc1fe6cdc..924ab79703 100644 --- a/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp @@ -3,6 +3,7 @@ #include "OpenSHC/UI/Helpers.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" +#include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_00b95b2c.hpp" #include "OpenSHC/Globals/DAT_00b96100.hpp" @@ -20,7 +21,7 @@ namespace UI { DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "frontend_combat2.tgx"); + s_frontend_combat2_tgx_005a2010); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); DAT_GameCore::instance.section1066 = 0; DAT_MenuTextInputState::instance.lastListClickTime = 0; diff --git a/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_Prepare.cpp b/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_Prepare.cpp index dc0b674406..2e2c2de3a2 100644 --- a/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_Prepare.cpp @@ -1,6 +1,7 @@ #include "../IntroLogos.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_IntroBlendStrength.hpp" #include "OpenSHC/Globals/DAT_IntroStep.hpp" @@ -16,12 +17,12 @@ namespace UI { { if (!DAT_IntroStep::instance) { DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("logo1.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_logo1_tgx_005a1f74); } else if (DAT_IntroStep::instance == 1) { DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("logo2.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_logo2_tgx_005a1f68); } DAT_IntroBlendStrength::instance = 0; DAT_IntroTimestamp::instance = timeGetTime(); diff --git a/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_Prepare.cpp b/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_Prepare.cpp index 3599b70d73..68ddd131ab 100644 --- a/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_Prepare.cpp @@ -2,6 +2,7 @@ #include "OpenSHC/Rendering/Bink/BinkControlClass.func.hpp" #include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/COL_BLACK.hpp" #include "OpenSHC/Globals/DAT_BinkControlState.hpp" @@ -29,7 +30,8 @@ namespace UI { 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, (ushort)((int)(COL_BLACK::instance.shortValue))); MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::BinkControlClass_Func::playBINK, DAT_BinkControlState::ptr)(0, - "intro.bik", 0, 0, DAT_MenuHandlerState::instance.x + 80, DAT_MenuHandlerState::instance.y + 0x3c, 0); + s_intro_bik_005a1f80, 0, 0, DAT_MenuHandlerState::instance.x + 80, + DAT_MenuHandlerState::instance.y + 0x3c, 0); TIME_IntroVideo_Prepare::instance = timeGetTime(); } diff --git a/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp index ab24bdc3da..2810734e53 100644 --- a/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp @@ -8,6 +8,7 @@ #include "OpenSHC/Game/TrailType.hpp" #include "OpenSHC/UI/Enums/MenuModalType.hpp" #include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" +#include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" @@ -36,47 +37,47 @@ namespace UI { DAT_GameSynchronyState::instance.field_0x106ee4 = 0; DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "frontend_combat3.tgx"); + s_frontend_combat3_tgx_005a2134); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "firefly-small.tgx"); + s_firefly_small_tgx_005a226c); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "table.tgx"); + s_table_tgx_005a2260); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "tslice1.tgx"); + s_tslice1_tgx_005a2254); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "tslice2.tgx"); + s_tslice2_tgx_005a2248); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "tslice3.tgx"); + s_tslice3_tgx_005a223c); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "tslice4.tgx"); + s_tslice4_tgx_005a2230); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "tslice5.tgx"); + s_tslice5_tgx_005a2224); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "tslice6.tgx"); + s_tslice6_tgx_005a2218); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "tslice7.tgx"); + s_tslice7_tgx_005a220c); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "tslice8.tgx"); + s_tslice8_tgx_005a2200); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "tslice1b.tgx"); + s_tslice1b_tgx_005a21f0); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "tslice2b.tgx"); + s_tslice2b_tgx_005a21e0); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "tslice3b.tgx"); + s_tslice3b_tgx_005a21d0); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "tslice4b.tgx"); + s_tslice4b_tgx_005a21c0); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "tslice5b.tgx"); + s_tslice5b_tgx_005a21b0); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "tslice6b.tgx"); + s_tslice6b_tgx_005a21a0); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "tslice7b.tgx"); + s_tslice7b_tgx_005a2190); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "tslice8b.tgx"); + s_tslice8b_tgx_005a2180); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "pick_opponent_normal.tgx"); + s_pick_opponent_normal_tgx_005a2164); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "pick_opponent_large.tgx"); + s_pick_opponent_large_tgx_005a214c); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; diff --git a/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_DoInitial.cpp index f6b9271871..985ab4e80b 100644 --- a/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_DoInitial.cpp @@ -4,6 +4,7 @@ #include "OpenSHC/UI/Rendering.func.hpp" #include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/COL_BLACK.hpp" #include "OpenSHC/Globals/DAT_BinkControlState.hpp" @@ -44,7 +45,7 @@ namespace UI { DAT_MenuHandlerState::instance.y = borderHeight; INT_00b95f68::instance = 0; MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::BinkControlClass_Func::playBINK, DAT_BinkControlState::ptr)(0, - "richard_swordswing.bik", 0, 0, + s_richard_swordswing_bik_005a1fc4, 0, 0, (int)((int)(DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 508)), (int)((int)(DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 22)), 0); DAT_MainMenuSwingSwordBool::instance = 0; diff --git a/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_Prepare.cpp index 3aa0828e48..b508ff1fea 100644 --- a/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_Prepare.cpp @@ -6,6 +6,7 @@ #include "OpenSHC/Game/GameMode2.hpp" #include "OpenSHC/UI/Enums/MenuModalType.hpp" #include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" +#include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" #include "OpenSHC/Globals/DAT_GameState.hpp" @@ -26,9 +27,9 @@ namespace UI { { DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("frontend_main.tgx"); + DAT_TextureRenderCoreObject::ptr)(s_frontend_main_tgx_005a1fb0); MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("frontend_main2.tgx"); + DAT_TextureRenderCoreObject::ptr)(s_frontend_main2_tgx_005a1f9c); MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); INT_00b95abc::instance = -1; DAT_UnknownGFXIndex::instance = 0; diff --git a/src/OpenSHC/UI/MenuViews/MpConnection/MenuView_MpConnection_Prepare.cpp b/src/OpenSHC/UI/MenuViews/MpConnection/MenuView_MpConnection_Prepare.cpp index 1c4697e25c..93aa97709f 100644 --- a/src/OpenSHC/UI/MenuViews/MpConnection/MenuView_MpConnection_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/MpConnection/MenuView_MpConnection_Prepare.cpp @@ -5,6 +5,7 @@ #include "OpenSHC/UI/MenuModalComposition.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" +#include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" @@ -24,7 +25,7 @@ namespace UI { DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "frontend_combat3.tgx"); + s_frontend_combat3_tgx_005a2134); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; diff --git a/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp b/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp index 78db335c6b..efcb85e3c7 100644 --- a/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp @@ -9,6 +9,7 @@ #include "OpenSHC/Game/GameMode.hpp" #include "OpenSHC/Game/GameMode2.hpp" #include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" +#include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_00b960dc.hpp" #include "OpenSHC/Globals/DAT_ButtonBackgroundBlendStrength.hpp" @@ -67,10 +68,10 @@ namespace UI { DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; if ((int)DAT_MapMissionType::instance < 2) { MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "frontend_economics2.tgx"); + s_frontend_economics2_tgx_005a203c); } else { MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "frontend_combat2.tgx"); + s_frontend_combat2_tgx_005a2010); } MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; diff --git a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare.cpp b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare.cpp index 621fee2678..24acc09e2e 100644 --- a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare.cpp @@ -5,6 +5,7 @@ #include "OpenSHC/UI/MenuItems/SelectCrusade.func.hpp" #include "OpenSHC/UI/Rendering.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" #include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" @@ -20,8 +21,8 @@ namespace UI { { Menu* pMVar1; DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("frontend_combat3.tgx"); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_frontend_combat3_tgx_005a2134); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; @@ -31,8 +32,8 @@ namespace UI { DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, - DAT_TextureRenderCoreObject::ptr)(0, + MACRO_CALL_MEMBER( + UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(0, (DAT_WindowAndDirectDraw::instance.resolutionX - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) / 2, diff --git a/src/OpenSHC/UI/MenuViews/UnusedCreateSiege/MenuView_UnusedCreateSiege_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedCreateSiege/MenuView_UnusedCreateSiege_Prepare.cpp index c7aeb5a24b..1597a07443 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedCreateSiege/MenuView_UnusedCreateSiege_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedCreateSiege/MenuView_UnusedCreateSiege_Prepare.cpp @@ -4,6 +4,7 @@ #include "OpenSHC/UI/Helpers.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" +#include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" #include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" @@ -21,7 +22,7 @@ namespace UI { MACRO_CALL_MEMBER(OpenSHC::Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)(9); DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("frontend_builder2.tgx"); + DAT_TextureRenderCoreObject::ptr)(s_frontend_builder2_tgx_005a206c); MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); INT_00b960e4::instance = 0; } diff --git a/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_Prepare.cpp index 98259677ea..2a5f56f68e 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_Prepare.cpp @@ -5,6 +5,7 @@ #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/Rendering/ScreenResolutionEnum.hpp" #include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" +#include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/COL_BLACK.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" @@ -24,7 +25,7 @@ namespace UI { { DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("demo buy it screen.tgx"); + DAT_TextureRenderCoreObject::ptr)(s_demo_buy_it_screen_tgx_005a20f8); MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, (ushort)(COL_BLACK::instance.shortValue)); diff --git a/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp index 774c96d283..b30b6f1627 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp @@ -2,6 +2,7 @@ #include "OpenSHC/UI/Helpers.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" #include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" @@ -17,9 +18,9 @@ namespace UI { { DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("frontend_economics.tgx"); + DAT_TextureRenderCoreObject::ptr)(s_frontend_economics_tgx_005a2054); MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("frontend_economics2.tgx"); + DAT_TextureRenderCoreObject::ptr)(s_frontend_economics2_tgx_005a203c); MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); DWORD _currentTime = timeGetTime(); DAT_UIButtonDefinedData::instance.ButtonGmDataArray[360].stateTransitionTimeBaseUnk_0x18 diff --git a/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp index 5dbd1ec216..a21d9f5a53 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp @@ -3,6 +3,7 @@ #include "OpenSHC/UI/Helpers.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" +#include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" #include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" @@ -18,7 +19,7 @@ namespace UI { DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, - DAT_TextureRenderCoreObject::ptr)("frontend_economics2.tgx"); + DAT_TextureRenderCoreObject::ptr)(s_frontend_economics2_tgx_005a203c); MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); DAT_GameCore::instance.section1066 = 0; DAT_MenuTextInputState::instance.lastListClickTime = 0; diff --git a/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp index 1a5d7b81c7..acce519ca6 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp @@ -5,6 +5,7 @@ #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/Text/TextAlignment.hpp" #include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" +#include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/COL_BLACK.hpp" #include "OpenSHC/Globals/COL_WHITE.hpp" @@ -43,11 +44,11 @@ namespace UI { MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( 0, DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 100, DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 100); - MACRO_CALL_MEMBER(Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)("FireFly\'s", - DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400, + MACRO_CALL_MEMBER(Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + s_FireFly_s_005a22c4, DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400, DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 210, Text::TTA_LEFT, 33023, 0xf, FALSE, 0); - MACRO_CALL_MEMBER(Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)("Crusader", - DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400, + MACRO_CALL_MEMBER(Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + s_Crusader_005a22b8, DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400, DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 0xf8, Text::TTA_LEFT, 0, 17, FALSE, 0); } diff --git a/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_Prepare.cpp index 0cc7327bdb..9d21fd574a 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_Prepare.cpp @@ -2,6 +2,7 @@ #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" +#include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" #include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" @@ -25,7 +26,7 @@ namespace UI { DAT_MenuHandlerState::instance.x = borderWidth; DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( - "gm_fly.tgx"); + s_gm_fly_tgx_005a2110); } } From 11859ee1445bb58bd5dbfb8904aac6c374728a60 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Mon, 9 Nov 2026 11:16:02 +0100 Subject: [PATCH 52/58] MenuViews backlog: no trailing returns, text comments as // lines The decompiler's trailing return; goes from the 13 void functions that ended with one (style guide 1), and the "added by script" block comments with a text in them become // "the text" lines above the call (style guide 19). quick_diff identical for every file. Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- .../MenuView_BuildMenu_DoEveryFrame.cpp | 1 - .../Credits/MenuView_Credits_DoInitial.cpp | 1 - .../MenuView_CrusadeEndscreen_Prepare.cpp | 20 +++++-------------- .../MenuView_CustomScenarios_DoEveryFrame.cpp | 1 - .../MenuView_GameStartEnterName_DoInitial.cpp | 1 - ...nitial_BlackBoxDefaultBorderAndPicture.cpp | 1 - ...ew_HistoricCampaignSelect_DoEveryFrame.cpp | 1 - .../MainMenu/MenuView_MainMenu_DoInitial.cpp | 1 - .../MenuView_MissionSelect_DoEveryFrame.cpp | 5 +---- ...61ReturnToSkrimishMenuUnk_DoEveryFrame.cpp | 5 ++--- ...own61ReturnToSkrimishMenuUnk_DoInitial.cpp | 1 - ...known61ReturnToSkrimishMenuUnk_Prepare.cpp | 1 - ...UnusedEconomicGametypeSelect_DoInitial.cpp | 1 - ...lectRandomNumberOfEnemies_DoEveryFrame.cpp | 10 ++-------- 14 files changed, 10 insertions(+), 40 deletions(-) diff --git a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp index 1c6d55daaa..0e6ca0f94a 100644 --- a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp @@ -94,7 +94,6 @@ namespace UI { MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( OpenSHC::UI::Enums::DEID_WIN_DEFEAT_WINDOW, 1); } - return; } } diff --git a/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoInitial.cpp index 0ef01a0186..ca7ae8b81f 100644 --- a/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoInitial.cpp @@ -40,7 +40,6 @@ namespace UI { DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; DAT_TextEditorState::instance.pendingCreditsFadeBorder = TRUE; - return; } } diff --git a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp index b04d34a588..9dc4ecee5e 100644 --- a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp @@ -49,33 +49,23 @@ namespace UI { s_jesterlast_tgx_005ab6d8); MACRO_CALL(UI::Credits_Func::ResetCredits)(); DAT_NumberOfStoredMenuStrings::instance = 0; - /* - added by script: "Congratulations!" - */ + // "Congratulations!" MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( DE::SHCDE::TEXT_SKTRAIL_WIN, 0)); - /* - added by script: "Many have set out..." - */ + // "Many have set out..." MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( DE::SHCDE::TEXT_SKTRAIL_WIN, 1)); - /* - added by script: "...but few will have survived this journey." - */ + // "...but few will have survived this journey." MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( DE::SHCDE::TEXT_SKTRAIL_WIN, 2)); - /* - added by script: "You have bested the Crusader Trail!" - */ + // "You have bested the Crusader Trail!" MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( DE::SHCDE::TEXT_SKTRAIL_WIN, 3)); - /* - added by script: "You have bested the Crusader Extreme Trail!" - */ + // "You have bested the Crusader Extreme Trail!" MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( DE::SHCDE::TEXT_SKTRAIL_WIN, 4)); diff --git a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp index 5a67145778..1f19d544b5 100644 --- a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp @@ -38,7 +38,6 @@ namespace UI { MACRO_CALL(OpenSHC::UI::MenuViews::CustomScenarios_Func::MenuView_CustomScenarios_Prepare)(); return; } - return; } } diff --git a/src/OpenSHC/UI/MenuViews/GameStartEnterName/MenuView_GameStartEnterName_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/GameStartEnterName/MenuView_GameStartEnterName_DoInitial.cpp index 0e3e197eb9..3409044ca0 100644 --- a/src/OpenSHC/UI/MenuViews/GameStartEnterName/MenuView_GameStartEnterName_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/GameStartEnterName/MenuView_GameStartEnterName_DoInitial.cpp @@ -37,7 +37,6 @@ namespace UI { pMVar1->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; - return; } } diff --git a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture.cpp b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture.cpp index f6668ea769..b2d230f821 100644 --- a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture.cpp +++ b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture.cpp @@ -38,7 +38,6 @@ namespace UI { pMVar1->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; - return; } } diff --git a/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_DoEveryFrame.cpp index d5d2044a4d..495f32a5b0 100644 --- a/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_DoEveryFrame.cpp @@ -25,7 +25,6 @@ namespace UI { (DAT_WindowAndDirectDraw::instance.resolutionY - DAT_TextureRenderCoreObject::instance.loadedGfxArray[DAT_UnknownGFXIndex::instance].height) / 2); - return; } } diff --git a/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_DoInitial.cpp index 985ab4e80b..df1c5993ec 100644 --- a/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_DoInitial.cpp @@ -49,7 +49,6 @@ namespace UI { (int)((int)(DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 508)), (int)((int)(DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 22)), 0); DAT_MainMenuSwingSwordBool::instance = 0; - return; } } diff --git a/src/OpenSHC/UI/MenuViews/MissionSelect/MenuView_MissionSelect_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/MissionSelect/MenuView_MissionSelect_DoEveryFrame.cpp index 01cf9049f8..f8f408dbfd 100644 --- a/src/OpenSHC/UI/MenuViews/MissionSelect/MenuView_MissionSelect_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/MissionSelect/MenuView_MissionSelect_DoEveryFrame.cpp @@ -43,15 +43,12 @@ namespace UI { MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( x2, y1, x2, y2, (ushort)((int)(COL_VERY_SOFT_YELLOW::instance.shortValue))); DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; - /* - added by script: "Mission" - */ + // "Mission" MACRO_CALL_MEMBER( OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, DAT_PencilRenderCore::ptr)( 5, 0xf, DAT_MenuHandlerState::instance.x + 184, DAT_MenuHandlerState::instance.y + 100, 432, 50); DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; } - return; } } diff --git a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame.cpp index 3f27acaa4a..86dffc5d73 100644 --- a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame.cpp @@ -20,15 +20,14 @@ namespace UI { _menuPtr->xPosition = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; - MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, - DAT_TextureRenderCoreObject::ptr)(0, + MACRO_CALL_MEMBER( + UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(0, (DAT_WindowAndDirectDraw::instance.resolutionX - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) / 2, (DAT_WindowAndDirectDraw::instance.resolutionY - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) / 2); - return; } } diff --git a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial.cpp index c9a3c2b1e8..ca1ebcc70e 100644 --- a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial.cpp @@ -37,7 +37,6 @@ namespace UI { (DAT_WindowAndDirectDraw::instance.resolutionY - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) / 2); - return; } } diff --git a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare.cpp b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare.cpp index 24acc09e2e..b825bb5459 100644 --- a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare.cpp @@ -43,7 +43,6 @@ namespace UI { MACRO_CALL(UI::MenuItems::SelectCrusade_Func::MenuItemActionHandler_SelectCrusade_Main)(2); MACRO_CALL_MEMBER(Game::Skirmish::SkirmishLobbySetupStructure_Func::restoreSkirmishLobbySetup, SEC_SkirmishLobbySetupStructure::ptr)(); - return; } } diff --git a/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_DoInitial.cpp index 30fac3e13a..c7d566e0ed 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_DoInitial.cpp @@ -39,7 +39,6 @@ namespace UI { DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; INT_00b95f68::instance = 0; - return; } } diff --git a/src/OpenSHC/UI/MenuViews/UnusedSelectRandomNumberOfEnemies/MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/UnusedSelectRandomNumberOfEnemies/MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame.cpp index b4c597232d..5eb77d363d 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedSelectRandomNumberOfEnemies/MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedSelectRandomNumberOfEnemies/MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame.cpp @@ -54,9 +54,7 @@ namespace UI { iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 200; iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; - /* - added by script: "How many opponents can you handle!" - */ + // "How many opponents can you handle!" MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_NEW_TEXT, 1), @@ -67,15 +65,11 @@ namespace UI { iVar4 = 400; iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 200; - /* - added by script: "This will create some random opponents for you. You can still change opponent types - afterwards." - */ + // "This will create some random opponents for you. You can still change opponent types afterwards." MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderMultilineText5Unk, DAT_TextManagerObject::ptr)( MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_NEW_TEXT, 2), iVar3, iVar1, iVar4, color_00, iVar5, blendStrength); - return; } } From eaddcc9409a870368fab038d8bfc510261dd6da2 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Mon, 9 Nov 2026 11:16:02 +0100 Subject: [PATCH 53/58] MenuViews backlog: loops for the repeated stores, named locals in three more files The button timings in MenuView_CustomScenarios_Prepare, MenuView_HistoricCampaignSelect_Prepare and MenuView_UnusedEconomicGametypeSelect_Prepare (each button's animation starts 1600 ms after the previous one) and MenuView_Unknown33_DoEveryFrame's nine cleared DAT_PlayerSlotArraySomeValue entries are for-loops; MSVC unrolls them back into the same stores (a memset in Unknown33: quick_diff 0.9643 -> 0.7965). Unknown33's player loop counts playerID up to countof(currentPlayerFullIDArray) and tests the ready check directly. MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame and MenuView_CrusadeEndscreen_Prepare get named positions in place of the decompiler's argument locals. CrusadeEndscreen's AppendCreditsSoundStreamCommand values are plain numbers, as its int parameter takes them: gynt's SHC_SoundStream names there were Ghidra's guess. The (8, n) calls count n from 1 to 8 over the first jester run's eight blocks (SFX_1Unk, SFX_2Unk, SPEECH_1 and SPEECH_2, then three OR-ed constants for 5, 6 and 7, then a cast 8), and the (24, MUSIC), (4, SPEECH_1), (3, ...) and (1, 0x5a) calls are plain numbers too. The text size it picks for Italian is fontSize. quick_diff identical for every file; reccmp 100.0 for each of them in the full build at the branch head. Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- .../MenuView_CrusadeEndscreen_Prepare.cpp | 141 ++++++++---------- .../MenuView_CustomScenarios_Prepare.cpp | 10 +- ...enuView_HistoricCampaignSelect_Prepare.cpp | 10 +- .../MenuView_Unknown33_DoEveryFrame.cpp | 29 ++-- ...w_UnusedEconomicGametypeSelect_Prepare.cpp | 12 +- ...lectRandomNumberOfEnemies_DoEveryFrame.cpp | 37 +---- 6 files changed, 95 insertions(+), 144 deletions(-) diff --git a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp index 9dc4ecee5e..ebda71ea8e 100644 --- a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp @@ -5,7 +5,6 @@ #include "OpenSHC/UI/Credits.func.hpp" #include "OpenSHC/UI/Helpers.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" -#include "OpenSHC/Audio/MSS/enums/SHC_SoundStream.hpp" #include "OpenSHC/DE/SHCDE/eTextSections.hpp" #include "OpenSHC/Game/TrailType.hpp" #include "OpenSHC/Text/GameLanguage.hpp" @@ -20,12 +19,9 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using Audio::MSS::enums::SHC_SoundStream; - // FUNCTION: STRONGHOLDCRUSADER 0x004DF2E0 void CrusadeEndscreen::MenuView_CrusadeEndscreen_Prepare() { - undefined4 uVar2; DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_sktrail_win_tgx_005ab768); @@ -71,172 +67,159 @@ namespace UI { DE::SHCDE::TEXT_SKTRAIL_WIN, 4)); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundEntry)(1, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsShowImageCommand)(41, 0, 230, 203, 336, 168, 0, 1); - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(0xf, 0, 0xf, 1, 402, 234, 0, 1); - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(0xf, 0, 0xf, 0, 400, 232, 0, 1); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 0, 15, 1, 402, 234, 0, 1); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 0, 15, 0, 400, 232, 0, 1); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 1, 106, 53, 4); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_rt_vict1_bik_005a78fc, 106, 53, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( (char*)s_fx_speech_rt_anger_04_wav_005ab6bc, 3, 0, 100); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 2, 331, 24, 4); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_sn_vict2_bik_005a78ec, 331, 24, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( (char*)s_fx_speech_sn_add_player_wav_005ab6a0, 3, 0, 100); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 3, 557, 53, 4); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_pg_taunt2_bik_005a7c44, 557, 53, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( (char*)s_fx_speech_pg_add_player_wav_005ab684, 3, 0, 100); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 4, 640, 223, 4); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_wf_anger1_bik_005a7b20, 640, 223, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( (char*)s_fx_speech_wf_anger_04_wav_005ab668, 3, 0, 100); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 5, 557, 394, 4); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_saladin_angry_bik_005a7b0c, 557, 394, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( (char*)s_fx_speech_sa_extra_01_wav_005ab64c, 3, 0, 100); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 6, 332, 436, 4); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_sultan_natural_bik_005a78a4, 332, 436, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( (char*)s_fx_speech_su_congrats_01_wav_005ab62c, 3, 0, 100); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 7, 106, 394, 4); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_richard_taunting_bik_005a7d00, 106, 394, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( (char*)s_fx_speech_ri_congrats_01_wav_005ab60c, 3, 0, 100); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 8, 35, 223, 4); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_bad_arab_taunt_bik_005a7d2c, 35, 223, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( (char*)s_fx_speech_ca_add_player_01_wav_005ab5ec, 3, 0, 100); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, Audio::MSS::enums::SND_STR_SPEECH_1); - uVar2 = 16; + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); + // the texts are a size larger in Italian + int fontSize = 16; if (DAT_TextManagerObject::instance.gameLanguage == Text::GL_ITALIAN) { - uVar2 = 17; + fontSize = 17; } MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(16, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( - 0xf, 1, (undefined4)((int)(uVar2)), 1, 262, 238, 282, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( - 0xf, 1, (undefined4)((int)(uVar2)), 0, 260, 236, 282, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, Audio::MSS::enums::SND_STR_SFX_1Unk); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(1, ((SHC_SoundStream)90)); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 1, fontSize, 1, 262, 238, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 1, fontSize, 0, 260, 236, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 1); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(1, 90); MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(16, 1); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, Audio::MSS::enums::SND_STR_SFX_1Unk); - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( - 0xf, 2, (undefined4)((int)(uVar2)), 1, 262, 238, 282, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( - 0xf, 2, (undefined4)((int)(uVar2)), 0, 260, 236, 282, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, Audio::MSS::enums::SND_STR_SFX_2Unk); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(1, ((SHC_SoundStream)90)); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 1); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 2, fontSize, 1, 262, 238, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 2, fontSize, 0, 260, 236, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 2); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(1, 90); MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(16, 2); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, Audio::MSS::enums::SND_STR_SFX_2Unk); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 2); if (DAT_GameCore::instance.currentTrailType == Game::TT_EXTREME) { - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( - 0xf, 4, (undefined4)((int)(uVar2)), 1, 262, 238, 282, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( - 0xf, 4, (undefined4)((int)(uVar2)), 0, 260, 236, 282, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, Audio::MSS::enums::SND_STR_SPEECH_2); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 4, fontSize, 1, 262, 238, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 4, fontSize, 0, 260, 236, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 4); } else { - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( - 0xf, 3, (undefined4)((int)(uVar2)), 1, 262, 238, 282, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)( - 0xf, 3, (undefined4)((int)(uVar2)), 0, 260, 236, 282, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, Audio::MSS::enums::SND_STR_SPEECH_1); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 3, fontSize, 1, 262, 238, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 3, fontSize, 0, 260, 236, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 3); } - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, Audio::MSS::enums::SND_STR_SFX_1Unk); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 1); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 106, 53, 4); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 106, 53, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, Audio::MSS::enums::SND_STR_SFX_2Unk); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 2); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 331, 24, 4); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 331, 24, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, Audio::MSS::enums::SND_STR_SPEECH_1); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 557, 53, 4); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 557, 53, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, Audio::MSS::enums::SND_STR_SPEECH_2); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 4); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 640, 223, 4); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 640, 223, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, - (Audio::MSS::enums::SHC_SoundStream)(Audio::MSS::enums::SND_STR_SPEECH_2 - | Audio::MSS::enums::SND_STR_SFX_1Unk)); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 5); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 557, 394, 4); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 557, 394, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, - (Audio::MSS::enums::SHC_SoundStream)(Audio::MSS::enums::SND_STR_SPEECH_2 - | Audio::MSS::enums::SND_STR_SFX_2Unk)); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 6); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 332, 436, 4); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 332, 436, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, - (Audio::MSS::enums::SHC_SoundStream)(Audio::MSS::enums::SND_STR_SPEECH_2 - | Audio::MSS::enums::SND_STR_SPEECH_1)); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 7); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 106, 394, 4); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 106, 394, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, ((SHC_SoundStream)8)); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 8); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 35, 223, 4); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 35, 223, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsImageEndCommand)(42, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(16, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsSegmentEndCommand)(); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 106, 53, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 331, 24, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 557, 53, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 640, 223, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 557, 394, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 332, 436, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 106, 394, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 35, 223, 0, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, Audio::MSS::enums::SND_STR_MUSIC); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsClearImageCommand)(); MACRO_CALL(Rendering_Func::TicksStartCounter)(); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); diff --git a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp index d6e406d413..f140bb8c3a 100644 --- a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp @@ -30,11 +30,11 @@ namespace UI { MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_frontend_builder2_tgx_005a206c); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); - DWORD DVar1 = timeGetTime(); - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[364].stateTransitionTimeBaseUnk_0x18 = DVar1 - 4800; - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[365].stateTransitionTimeBaseUnk_0x18 = DVar1 - 3200; - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[366].stateTransitionTimeBaseUnk_0x18 = DVar1 - 1600; - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[367].stateTransitionTimeBaseUnk_0x18 = DVar1; + DWORD const now = timeGetTime(); + for (int i = 0; i < 4; ++i) { + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[364 + i].stateTransitionTimeBaseUnk_0x18 + = now - (3 - i) * 1600; + } INT_00b95abc::instance = -1; DAT_MenuTextInputState::instance.dialogResult = 0; DAT_GameCore::instance.missionNumber1to20 = 0; diff --git a/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp index f082edda1b..b6a6f6cfde 100644 --- a/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp @@ -26,11 +26,11 @@ namespace UI { MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_frontend_combat2_tgx_005a2010); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); - DWORD DVar1 = timeGetTime(); - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[355].stateTransitionTimeBaseUnk_0x18 = DVar1 - 4800; - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[356].stateTransitionTimeBaseUnk_0x18 = DVar1 - 3200; - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[357].stateTransitionTimeBaseUnk_0x18 = DVar1 - 1600; - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[358].stateTransitionTimeBaseUnk_0x18 = DVar1; + DWORD const now = timeGetTime(); + for (int i = 0; i < 4; ++i) { + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[355 + i].stateTransitionTimeBaseUnk_0x18 + = now - (3 - i) * 1600; + } INT_00b95abc::instance = -1; DAT_UnknownGFXIndex::instance = 0; MACRO_CALL_MEMBER(UI::MenuModalComposition_Func::activateModalDialog, DAT_MenuModalComposition3::ptr)( diff --git a/src/OpenSHC/UI/MenuViews/Unknown33/MenuView_Unknown33_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/Unknown33/MenuView_Unknown33_DoEveryFrame.cpp index 065303fbbc..fb02de4c9d 100644 --- a/src/OpenSHC/UI/MenuViews/Unknown33/MenuView_Unknown33_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/Unknown33/MenuView_Unknown33_DoEveryFrame.cpp @@ -24,10 +24,8 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x0042C090 void Unknown33::MenuView_Unknown33_DoEveryFrame() { - int iVar1; - iVar1 = MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::checkAllPlayersReadyAndCleanupSlots, - DAT_GameSynchronyState::ptr)(); - if (iVar1 != 0) { + if (MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::checkAllPlayersReadyAndCleanupSlots, + DAT_GameSynchronyState::ptr)()) { if (DAT_GameSynchronyState::instance.isHost) { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)(OpenSHC::Commands::GCT_HOST_SHARE_LOBBY_STATE); @@ -35,13 +33,14 @@ namespace UI { MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)(OpenSHC::Commands::GCT_TRIGGER_LOBBY_PLAYER_INFORMATION_REFRESH); } - for (int iVar1 = 1; iVar1 < 9; iVar1 = iVar1 + 1) { - if (DAT_GameSynchronyState::instance.currentPlayerFullIDArray[iVar1] == -1 + for (int playerID = 1; playerID < countof(DAT_GameSynchronyState::instance.currentPlayerFullIDArray); + ++playerID) { + if (DAT_GameSynchronyState::instance.currentPlayerFullIDArray[playerID] == -1 && (DAT_GameCore::instance.mapU4Int0 == 0 - || (iVar1 != DAT_GameState::instance.mapAndTime.somePlayerID)) - && DAT_GameSynchronyState::instance.currentAIArray[iVar1] == 0) { + || (playerID != DAT_GameState::instance.mapAndTime.somePlayerID)) + && DAT_GameSynchronyState::instance.currentAIArray[playerID] == 0) { MACRO_CALL_MEMBER(OpenSHC::Game::GameStateStructures_Func::destroyPlayerCompletely, - DAT_GameState::ptr)(iVar1); + DAT_GameState::ptr)(playerID); } } MACRO_CALL(OpenSHC::Synchrony_Func::SetAIPlayerNickNames)(); @@ -50,15 +49,9 @@ namespace UI { MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( OpenSHC::UI::Enums::MVT_BUILD_MENU, 0); DAT_GameSynchronyState::instance.DAT_TwoIfNotHost = 0; - DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[0] = 0; - DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[1] = 0; - DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[2] = 0; - DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[3] = 0; - DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[4] = 0; - DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[5] = 0; - DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[6] = 0; - DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[7] = 0; - DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[8] = 0; + for (int i = 0; i < countof(DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue); ++i) { + DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[i] = 0; + } DAT_00b960f8::instance = 0; INT_00b960f0::instance = 0; DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; diff --git a/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp index b30b6f1627..52d80dbb1d 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp @@ -22,13 +22,11 @@ namespace UI { MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)(s_frontend_economics2_tgx_005a203c); MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); - DWORD _currentTime = timeGetTime(); - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[360].stateTransitionTimeBaseUnk_0x18 - = _currentTime - 4800; - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[361].stateTransitionTimeBaseUnk_0x18 - = _currentTime - 3200; - DAT_UIButtonDefinedData::instance.ButtonGmDataArray[362].stateTransitionTimeBaseUnk_0x18 - = _currentTime - 1600; + DWORD const now = timeGetTime(); + for (int i = 0; i < 3; ++i) { + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[360 + i].stateTransitionTimeBaseUnk_0x18 + = now - (3 - i) * 1600; + } INT_00b95abc::instance = -1; DAT_GameCore::instance.isTimeHalted2 = 0; } diff --git a/src/OpenSHC/UI/MenuViews/UnusedSelectRandomNumberOfEnemies/MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/UnusedSelectRandomNumberOfEnemies/MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame.cpp index 5eb77d363d..fe819c2f9b 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedSelectRandomNumberOfEnemies/MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedSelectRandomNumberOfEnemies/MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame.cpp @@ -4,10 +4,9 @@ #include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/DE/SHCDE/eTextSections.hpp" -#include "OpenSHC/Rendering/Colors/BGR24.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" #include "OpenSHC/Rendering/Enums/RenderTarget.hpp" #include "OpenSHC/Text/TextAlignment.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" #include "OpenSHC/Globals/DAT_TextManagerObject.hpp" @@ -18,22 +17,9 @@ namespace OpenSHC { namespace UI { namespace MenuViews { - using OpenSHC::Rendering::Colors::BGR24; - using OpenSHC::Text::TextAlignment; - using OpenSHC::WindowsHelper::Enums::BOOLEnum; - // FUNCTION: STRONGHOLDCRUSADER 0x0042B960 void UnusedSelectRandomNumberOfEnemies::MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame() { - int iVar1; - int iVar3; - TextAlignment alignment; - BGR24 color; - int iVar4; - uint color_00; - BOOLEnum keepOffsetX; - int iVar5; - int blendStrength; MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(0, (DAT_WindowAndDirectDraw::instance.resolutionX @@ -46,30 +32,21 @@ namespace UI { MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBorderedBoxWithBlendedBackground, DAT_PencilRenderCore::ptr)(DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 100, DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 100, 600, 400); - iVar5 = 0; - keepOffsetX = FALSE; - iVar4 = 17; - color = 0xccfaff; - alignment = OpenSHC::Text::TTA_CENTER; - iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 200; - iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + int const titleY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 200; + int const titleX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; // "How many opponents can you handle!" MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_NEW_TEXT, 1), - iVar3, iVar1, alignment, color, iVar4, keepOffsetX, iVar5); - blendStrength = 0; - iVar5 = 18; - color_00 = 0xccfaff; - iVar4 = 400; - iVar1 = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; - iVar3 = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 200; + titleX, titleY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 17, FALSE, 0); + int const textY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; + int const textX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 200; // "This will create some random opponents for you. You can still change opponent types afterwards." MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderMultilineText5Unk, DAT_TextManagerObject::ptr)( MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_NEW_TEXT, 2), - iVar3, iVar1, iVar4, color_00, iVar5, blendStrength); + textX, textY, 400, OpenSHC::Rendering::Colors::COL_CCFAFF, 18, 0); } } From a543741a1a868dfaaa571261f1dfcd45fdc2552e Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Mon, 9 Nov 2026 11:16:03 +0100 Subject: [PATCH 54/58] MenuViews backlog: names for decompiler locals in ten files, signed values, one goto Ten more files of gynt's: decompiler locals named for what they hold or dropped where the call can be tested directly (TicksSinceCounterStart, FindCampaignMapHotspotAtMouse, getEventIDForTimeUntilDefeatEventType), the current menu as menu, the chapter of a historic mission, the campaign texts as text; lastClickedListIndex is set to -1 and DAT_00b960dc to -3 rather than their unsigned hex; the minimap clear's byte count is sizeof(loadedMiniMap); the old title menu's colour is COL_0080FF and its positions are declared where they are computed; a doubled include goes; and MenuView_MapEditorLandscaping_DoEveryFrame draws its panel under one test of unk_resetViewportRelated in place of the goto, which compiles to the same branches. quick_diff identical for every file; reccmp 100.0 for each of them in the full build at the branch head, as with gynt's goto. Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- .../BuildMenu/MenuView_BuildMenu_Prepare.cpp | 7 +++---- ...MenuView_CrusadeEndscreen_DoEveryFrame.cpp | 3 +-- .../MenuView_CustomScenarios_DoEveryFrame.cpp | 1 - ...MenuView_HistoricCampaignIntro_Prepare.cpp | 12 +++++------- ...MenuView_HistoricMissionSelect_Prepare.cpp | 17 +++++++++-------- ...View_MapEditorLandscaping_DoEveryFrame.cpp | 16 ++++++++-------- ...MenuView_SingleplayerMapChoice_Prepare.cpp | 15 +++++++-------- ...ew_UnusedEconomicMissionSelect_Prepare.cpp | 2 +- .../MenuView_UnusedExtremeAd_DoEveryFrame.cpp | 6 ++---- .../MenuView_UnusedOldTitleMenu_DoInitial.cpp | 19 +++++++++---------- 10 files changed, 45 insertions(+), 53 deletions(-) diff --git a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp index 053bdd30dd..368850855d 100644 --- a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp @@ -25,7 +25,6 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x00431A90 void BuildMenu::MenuView_BuildMenu_Prepare() { - int iVar1; MACRO_CALL_MEMBER(OpenSHC::Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)(4); if (DAT_GameCore::instance.activeMenuTab.tabType != OpenSHC::UI::Enums::BASMTT_SIEGETENT_BATTERINGRAM && DAT_GameCore::instance.activeMenuTab.tabType != OpenSHC::UI::Enums::BASMTT_SIEGETENT_SHIELD @@ -37,9 +36,9 @@ namespace UI { MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( OpenSHC::UI::Enums::DEID_KEEP_AND_GRANERY_PLACEMENT_INFO, 0); DAT_WindowAndDirectDraw::instance.pendingMenuRedraw = 1; - iVar1 = MACRO_CALL_MEMBER(OpenSHC::Map::MapPropertiesState_Func::getEventIDForTimeUntilDefeatEventType, - DAT_MapPropertiesState::ptr)(); - if (0 <= iVar1) { + if (MACRO_CALL_MEMBER(OpenSHC::Map::MapPropertiesState_Func::getEventIDForTimeUntilDefeatEventType, + DAT_MapPropertiesState::ptr)() + >= 0) { MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( OpenSHC::UI::Enums::DEID_TIME_UNTIL_DEFEAT, 1); } diff --git a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoEveryFrame.cpp index 6d078bf58f..5da9a28730 100644 --- a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoEveryFrame.cpp @@ -16,8 +16,7 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x004E1F50 void CrusadeEndscreen::MenuView_CrusadeEndscreen_DoEveryFrame() { - int iVar1 = MACRO_CALL(UI::Helpers_Func::TicksSinceCounterStart)(); - if (iVar1) { + if (MACRO_CALL(UI::Helpers_Func::TicksSinceCounterStart)()) { MACRO_CALL(Rendering_Func::ProcessCreditsScriptCommands)(); if ((59 <= (int)DAT_UnknownBinkIndex::instance) && (!INT_00ed27b8::instance)) { MACRO_CALL_MEMBER(Audio::MSS::SoundSystem_Func::setSomeSoundTime, DAT_SoundSystemState::ptr)(); diff --git a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp index 1f19d544b5..f81b09aaa7 100644 --- a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp @@ -1,7 +1,6 @@ #include "../CustomScenarios.func.hpp" #include "OpenSHC/Game/GameCore.func.hpp" -#include "OpenSHC/UI/MenuViews/CustomScenarios.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/UI/Enums/MenuModalType.hpp" #include "OpenSHC/UI/Enums/MenuViewType.hpp" diff --git a/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp b/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp index d1f9591207..05072c75d1 100644 --- a/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp @@ -22,7 +22,6 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x004DBAF0 void HistoricCampaignIntro::MenuView_HistoricCampaignIntro_Prepare() { - char* pcVar1; MACRO_CALL(UI::Helpers_Func::PrepareHistoryBook)(); switch (DAT_GameCore::instance.historicCampaignNumber) { case 1: @@ -43,14 +42,13 @@ namespace UI { break; } DAT_NumberOfStoredMenuStrings::instance = 0; - pcVar1 + char* text = MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( DE::SHCDE::TEXT_CAMPAIGN_INFO, (int)(DAT_GameCore::instance.historicCampaignNumber * 6 - 5)); - MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)(pcVar1); - pcVar1 - = MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( - DE::SHCDE::TEXT_CAMPAIGN_INFO, (int)(DAT_GameCore::instance.historicCampaignNumber * 6 - 4)); - MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)(pcVar1); + MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)(text); + text = MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( + DE::SHCDE::TEXT_CAMPAIGN_INFO, (int)(DAT_GameCore::instance.historicCampaignNumber * 6 - 4)); + MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)(text); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); FLOAT_00ec0834::instance = 0.0; DAT_00ed2780::instance = 1; diff --git a/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp index 924ab79703..5b96ae50fa 100644 --- a/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp @@ -25,19 +25,20 @@ namespace UI { MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); DAT_GameCore::instance.section1066 = 0; DAT_MenuTextInputState::instance.lastListClickTime = 0; - DAT_MenuTextInputState::instance.lastClickedListIndex = 0xffffffff; - int iVar1; + DAT_MenuTextInputState::instance.lastClickedListIndex = -1; + // the campaign is four chapters of five missions + int chapter; if (DAT_GameCore::instance.missionNumber1to20 < 6) { - iVar1 = 0; + chapter = 0; } else if (DAT_GameCore::instance.missionNumber1to20 < 11) { - iVar1 = 1; + chapter = 1; } else if (DAT_GameCore::instance.missionNumber1to20 < 16) { - iVar1 = 2; + chapter = 2; } else { - iVar1 = 3; + chapter = 3; } - DAT_00b95b2c::instance = iVar1; - DAT_00b96100::instance = iVar1 * 5 + 1; + DAT_00b95b2c::instance = chapter; + DAT_00b96100::instance = chapter * 5 + 1; } } diff --git a/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp index 0462dedb22..8b1ef8f9b1 100644 --- a/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp @@ -25,14 +25,14 @@ namespace UI { } if (!DAT_MinimapViewState::instance.field_0xc) { DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated = 2; - } else if (DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated != 2) - goto LAB_00431429; - DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; - MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, - DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_PANELS, 3, - DAT_MenuHandlerState::instance.x, DAT_MenuHandlerState::instance.y + 434); - DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; - LAB_00431429: + } + if (DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated == 2) { + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_PANELS, 3, + DAT_MenuHandlerState::instance.x, DAT_MenuHandlerState::instance.y + 434); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } DAT_MinimapViewState::instance.needsRedraw = 1; MACRO_CALL_MEMBER(OpenSHC::UI::MinimapViewState_Func::renderMinimapLandscaping, DAT_MinimapViewState::ptr)( DAT_MenuHandlerState::instance.x + 664, DAT_MenuHandlerState::instance.y + 464, 128, 128); diff --git a/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp b/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp index efcb85e3c7..60a42148ba 100644 --- a/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp @@ -36,11 +36,9 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x00448D40 void SingleplayerMapChoice::MenuView_SingleplayerMapChoice_Prepare() { - Menu* pMVar1; - char* tgxFileName; Menu_SingleplayerMapChoice::instance.thousand = 0; DAT_MenuTextInputState::instance.lastListClickTime = 0; - DAT_MenuTextInputState::instance.lastClickedListIndex = 0xffffffff; + DAT_MenuTextInputState::instance.lastClickedListIndex = -1; DAT_GameSynchronyState::instance.currentGameMode = Game::GM_SOLITARY; DAT_GameCore::instance.gameMode_2 = Game::GM_BUILDERUnk; if (INT_00b95b64::instance != 0) { @@ -52,7 +50,8 @@ namespace UI { DAT_GameSynchronyState::instance.DAT_MapSelectionRelativeSelected = -1; DAT_GameSynchronyState::instance.mapName[0] = '\0'; DAT_GameCore::instance.mapDescription[0] = '\0'; - MACRO_CALL(OS_Func::_memset)(DAT_MinimapViewState::instance.loadedMiniMap, 0, 80000); + MACRO_CALL(OS_Func::_memset)(DAT_MinimapViewState::instance.loadedMiniMap, 0, + sizeof(DAT_MinimapViewState::instance.loadedMiniMap)); DAT_GameSynchronyState::instance.reparseMaps = TRUE; DAT_SH1_SiegeAdvancedMode::instance = 0; DAT_SiegeRemainingPoints::instance = 0; @@ -63,7 +62,7 @@ namespace UI { DAT_GameSynchronyState::instance.skirmishRelated1 = 1; } DAT_ButtonBackgroundBlendStrength::instance = 32; - DAT_00b960dc::instance = 0xfffffffd; + DAT_00b960dc::instance = -3; DWORD_00b95b1c::instance = timeGetTime(); DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; if ((int)DAT_MapMissionType::instance < 2) { @@ -76,9 +75,9 @@ namespace UI { MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; MACRO_CALL_MEMBER(Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)(4); diff --git a/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp index a21d9f5a53..5865712d2d 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp @@ -24,7 +24,7 @@ namespace UI { DAT_GameCore::instance.section1066 = 0; DAT_MenuTextInputState::instance.lastListClickTime = 0; DAT_GameCore::instance.missionNumber1to20 = 33; - DAT_MenuTextInputState::instance.lastClickedListIndex = 0xffffffff; + DAT_MenuTextInputState::instance.lastClickedListIndex = -1; } } diff --git a/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoEveryFrame.cpp index 309accbae6..e16aca7e2d 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoEveryFrame.cpp @@ -18,14 +18,12 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x004E1AA0 void UnusedExtremeAd::MenuView_UnusedExtremeAd_DoEveryFrame() { - int iVar1 = MACRO_CALL(UI::Helpers_Func::TicksSinceCounterStart)(); - if (iVar1) { + if (MACRO_CALL(UI::Helpers_Func::TicksSinceCounterStart)()) { if (DAT_MouseState::instance.rightClickStop) { MACRO_CALL(UI::Credits_Func::StopCreditsPlaybackAndSounds)(); } if (DAT_MouseState::instance.leftClickStart) { - iVar1 = MACRO_CALL(UI::Helpers_Func::FindCampaignMapHotspotAtMouse)(); - if (iVar1 == 1) { + if (MACRO_CALL(UI::Helpers_Func::FindCampaignMapHotspotAtMouse)() == 1) { MACRO_CALL(UI::Credits_Func::EndCreditsSegmentAndAdvanceToNext)(); ++DAT_00ed278c::instance; if (DAT_00ed278c::instance == 3) { diff --git a/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp index acce519ca6..4342eba299 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp @@ -3,6 +3,7 @@ #include "OpenSHC/Text/TextManager.func.hpp" #include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" #include "OpenSHC/Text/TextAlignment.hpp" #include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/string-literals.hpp" @@ -22,23 +23,20 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x0042DD00 void UnusedOldTitleMenu::MenuView_UnusedOldTitleMenu_DoInitial() { - Menu* pMVar1; - int left; - int top; MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, (ushort)(COL_BLACK::instance.shortValue)); int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; MACRO_CALL_MEMBER( UI::Rendering::PencilRenderCore_Func::drawPixelPattern4x4OverWholeScreen, DAT_PencilRenderCore::ptr)(); - top = (DAT_WindowAndDirectDraw::instance.resolutionY - 400) / 2; - left = (DAT_WindowAndDirectDraw::instance.resolutionX - 600) / 2; + int const top = (DAT_WindowAndDirectDraw::instance.resolutionY - 400) / 2; + int const left = (DAT_WindowAndDirectDraw::instance.resolutionX - 600) / 2; MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)( left, top, left + 600, top + 400, (ushort)(COL_WHITE::instance.shortValue)); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( @@ -46,10 +44,11 @@ namespace UI { DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 100); MACRO_CALL_MEMBER(Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( s_FireFly_s_005a22c4, DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400, - DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 210, Text::TTA_LEFT, 33023, 0xf, FALSE, 0); + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 210, Text::TTA_LEFT, + OpenSHC::Rendering::Colors::COL_0080FF, 15, FALSE, 0); MACRO_CALL_MEMBER(Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( s_Crusader_005a22b8, DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400, - DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 0xf8, Text::TTA_LEFT, 0, 17, FALSE, 0); + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 248, Text::TTA_LEFT, 0, 17, FALSE, 0); } } From eb52adb6a1632d6a8be3f48414ae4458c1a417cd Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Mon, 9 Nov 2026 15:28:43 +0100 Subject: [PATCH 55/58] header: BuildMenuTabType gets BMTT_UNKNOWN_62 MenuView_BuildMenu_DoEveryFrame (0x00433030) compares activeMenuTab.buildMenuTab with 62 (cmp ..., 0x3e at 0x0043303E), a tab the enum has no name for; gynt's branch wrote it (BuildMenuTabTypeShort)0x3e. Main's hideOrUnhideUI (0x00471AA0) switches the build menu from BMTT_SOLDIERS to 62 when it hides the menu and from 62 back to BMTT_SOLDIERS when it shows it again, so 62 is the hidden soldiers tab. Named the way the enum already names 49 (BMTT_UNKNOWN_49) until Ghidra has a name for it. Used in the next commit; code generation is the same. Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- src/OpenSHC/UI/Enums/BuildMenuTabType.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/OpenSHC/UI/Enums/BuildMenuTabType.hpp b/src/OpenSHC/UI/Enums/BuildMenuTabType.hpp index def20ec6e8..8be87d64cc 100644 --- a/src/OpenSHC/UI/Enums/BuildMenuTabType.hpp +++ b/src/OpenSHC/UI/Enums/BuildMenuTabType.hpp @@ -33,6 +33,7 @@ namespace UI { BMTT_UNKNOWN_49 = 49, // 0x00000031 BMTT_MENU_HIDDEN = 60, // 0x0000003C BMTT_SOLDIERS = 61, // 0x0000003D + BMTT_UNKNOWN_62 = 62, // 0x0000003E BMTT_CITIZEN_SELECTED = 70 // 0x00000046 } BuildMenuTabType; From 07a1c3a1fad0f05419307dab75e439f462287a4f Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Mon, 9 Nov 2026 15:28:44 +0100 Subject: [PATCH 56/58] header: TextArrayIndexType gets TAIT_UNKNOWN_4 Three of gynt's MenuViews functions reset the user text handler to index 4 (push 4 before resetToTextIndex): MenuView_SingleplayerMapChoice_Prepare (0x00448D40), MenuView_BuildMenu_Prepare (0x00431A90) and MenuView_LobbyMenu_Prepare (0x00427320). The enum leaves 4 out between TAIT_THREE__FILTER_A and TAIT_FIVE__NUMERIC_DOT; TheRedDaemon asked for such values on #300. The ModalsDisplayRendering backlog branch carries the same line for MenuModalRenderFunction_Chat, so the two merge cleanly. Used in the next commit; code generation is the same. Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- src/OpenSHC/Text/TextArrayIndexType.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/OpenSHC/Text/TextArrayIndexType.hpp b/src/OpenSHC/Text/TextArrayIndexType.hpp index 23170757f8..ed5c64df3e 100644 --- a/src/OpenSHC/Text/TextArrayIndexType.hpp +++ b/src/OpenSHC/Text/TextArrayIndexType.hpp @@ -16,6 +16,7 @@ namespace Text { TAIT_ONE__FILTER_B = 1, // 0x00000001 TAIT_TWO__FILTER_A = 2, // 0x00000002 TAIT_THREE__FILTER_A = 3, // 0x00000003 + TAIT_UNKNOWN_4 = 4, // 0x00000004 TAIT_FIVE__NUMERIC_DOT = 5, // 0x00000005 TAIT_SIX__NUMERIC_ONLY = 6, // 0x00000006 TAIT_SEVEN__NUMERIC_ONLY = 7, // 0x00000007 From 7fe4cf7ea4b45a511894594c766e598d7e35ea3e Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Mon, 9 Nov 2026 15:28:44 +0100 Subject: [PATCH 57/58] MenuViews backlog: the review's points - The current menu is `Menu* const menu` at its one assignment and the border values are int const, in the shape of main's MenuView_General_DoInitial_OnlySetMenuXY (21 files had pMVar1, _menu or _menuPtr declared early). - No (ushort) casts on the COL_ shortValues (drawColorBox takes them as they are), no unused BOOLEnum.hpp includes. - Every s_ string pointer has its text in a comment above the statement. - BMTT_UNKNOWN_62 and TAIT_UNKNOWN_4 (previous two commits; TAIT_UNKNOWN_4 in all three resets) and TAIT_NINE__FILTER_B for the numbers 62, 4 and 9; TEXT_MAINOPTIONS, 15 for MissionSelect's text; COL_000000 for the old title menu's black text. - Early returns in Unknown33_DoEveryFrame, UnusedExtremeAd_DoEveryFrame (whose two click tests are one condition) and MissionSelect_DoEveryFrame; HistoricCampaignIntro_Prepare stores its two texts straight from the call, as main's HistoricCampaignOutro_Prepare does; BuildMenu_DoEveryFrame takes timeGetTime() in the store. - TRUE/FALSE for BOOL-like flags (needsRedraw, pendingMenuRedraw, mapLoadedForEditor, INT_00ed27b8, INT_00b960e4, INT_00b95f68), == 0 for counters and IDs, truth tests for isBinkVideoPlaying, NULL for the Bink handle, and casts and parentheses that did nothing removed (MainMenu_DoInitial's sword position, BuildMenu_DoEveryFrame's tab test, Unknown33's ready check). - Comments where a reader would ask: the repeated game-mode test, the button timings, the Custom Game button, the Italian text size (fontSizeUnk, as its meaning isn't proven), HistoricCampaignIntro's two campaign texts, and why CrusadeEndscreen_Prepare writes its five texts and its three runs of blocks out (a loop over the texts: quick_diff 0.9985 -> 0.9718). quick_diff identical for every file; all 47 functions reccmp 100.0 in a full build at the branch head. Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- .../MenuView_BuildMenu_DoEveryFrame.cpp | 21 +++--- .../BuildMenu/MenuView_BuildMenu_Prepare.cpp | 7 +- .../MenuView_CampaignUnk_DoInitial.cpp | 11 ++- .../Credits/MenuView_Credits_DoInitial.cpp | 14 ++-- ...MenuView_CrusadeEndscreen_DoEveryFrame.cpp | 4 +- .../MenuView_CrusadeEndscreen_DoInitial.cpp | 15 ++-- .../MenuView_CrusadeEndscreen_Prepare.cpp | 68 ++++++++++++++++--- .../MenuView_CustomScenarios_DoEveryFrame.cpp | 3 +- .../MenuView_CustomScenarios_Prepare.cpp | 9 ++- .../MenuView_GameStartEnterName_DoInitial.cpp | 13 ++-- ...ew_General_DoInitial_BlackBorderAndGfx.cpp | 2 +- ...nitial_BlackBoxDefaultBorderAndPicture.cpp | 13 ++-- ...w_General_DoInitial_CrusadeAndRankMenu.cpp | 13 ++-- ...ral_DoInitial_DefaultMainMenuStructure.cpp | 13 ++-- ...nuView_General_DoInitial_ScreenToBlack.cpp | 13 ++-- ...MenuView_HistoricCampaignIntro_Prepare.cpp | 19 ++++-- ...ew_HistoricCampaignSelect_DoEveryFrame.cpp | 2 +- ...enuView_HistoricCampaignSelect_Prepare.cpp | 4 +- ...MenuView_HistoricMissionSelect_Prepare.cpp | 2 +- .../MenuView_IntroLogos_Prepare.cpp | 4 +- .../MenuView_IntroVideo_DoEveryFrame.cpp | 7 +- .../MenuView_IntroVideo_Prepare.cpp | 16 ++--- .../LobbyMenu/MenuView_LobbyMenu_Prepare.cpp | 37 +++++++--- .../MainMenu/MenuView_MainMenu_DoInitial.cpp | 21 +++--- .../MainMenu/MenuView_MainMenu_Prepare.cpp | 3 +- ...View_MapEditorLandscaping_DoEveryFrame.cpp | 8 +-- .../MenuView_MissionSelect_DoEveryFrame.cpp | 42 ++++++------ .../MenuView_MpConnection_Prepare.cpp | 13 ++-- ...MenuView_ScenarioDescription_DoInitial.cpp | 11 ++- .../MenuView_SelectCrusade_DoInitial.cpp | 13 ++-- ...MenuView_SingleplayerMapChoice_Prepare.cpp | 14 ++-- ...Unknown26_CampaignRelatedUnk_DoInitial.cpp | 11 ++- .../MenuView_Unknown33_DoEveryFrame.cpp | 62 ++++++++--------- ...61ReturnToSkrimishMenuUnk_DoEveryFrame.cpp | 10 +-- ...own61ReturnToSkrimishMenuUnk_DoInitial.cpp | 13 ++-- ...known61ReturnToSkrimishMenuUnk_Prepare.cpp | 13 ++-- .../MenuView_UnusedCreateSiege_Prepare.cpp | 8 ++- ...MenuView_UnusedDemoBuyItScreen_Prepare.cpp | 4 +- ...UnusedEconomicGametypeSelect_DoInitial.cpp | 15 ++-- ...w_UnusedEconomicGametypeSelect_Prepare.cpp | 3 + ...ew_UnusedEconomicMissionSelect_Prepare.cpp | 2 +- .../MenuView_UnusedExtremeAd_DoEveryFrame.cpp | 38 +++++------ .../MenuView_UnusedExtremeAd_DoInitial.cpp | 13 ++-- .../MenuView_UnusedOldTitleMenu_DoInitial.cpp | 14 ++-- .../MenuView_UnusedOldTitleMenu_Prepare.cpp | 12 ++-- 45 files changed, 363 insertions(+), 290 deletions(-) diff --git a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp index 0e6ca0f94a..24abd87f7d 100644 --- a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp @@ -11,7 +11,6 @@ #include "OpenSHC/Rendering/ScreenResolutionEnum.hpp" #include "OpenSHC/UI/Enums/BuildMenuTabType.hpp" #include "OpenSHC/UI/Enums/DisplayElementID.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/COL_MAGENTA.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" @@ -30,8 +29,8 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x00433030 void BuildMenu::MenuView_BuildMenu_DoEveryFrame() { - if ((DAT_GameCore::instance.activeMenuTab.buildMenuTab != OpenSHC::UI::Enums::BMTT_MENU_HIDDEN) - && (DAT_GameCore::instance.activeMenuTab.buildMenuTab != 62)) { + if (DAT_GameCore::instance.activeMenuTab.buildMenuTab != OpenSHC::UI::Enums::BMTT_MENU_HIDDEN + && DAT_GameCore::instance.activeMenuTab.buildMenuTab != OpenSHC::UI::Enums::BMTT_UNKNOWN_62) { if (DAT_MinimapViewState::instance.field_0xc == 0) { DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated = 2; } @@ -45,12 +44,12 @@ namespace UI { if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_640x480) { MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_PANELS, 2, - DAT_MenuHandlerState::instance.x, (int)(DAT_MenuHandlerState::instance.y + 472)); + DAT_MenuHandlerState::instance.x, DAT_MenuHandlerState::instance.y + 472); } else { MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(DAT_MenuHandlerState::instance.x, DAT_MenuHandlerState::instance.y + 406, DAT_MenuHandlerState::instance.x + 799, - DAT_MenuHandlerState::instance.y + 471, (ushort)(COL_MAGENTA::instance.shortValue)); + DAT_MenuHandlerState::instance.y + 471, COL_MAGENTA::instance.shortValue); if (DAT_GameCore::instance.activeMenuTab.buildMenuTab == OpenSHC::UI::Enums::BMTT_SOLDIERS) { MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_PANELS, 5, @@ -65,9 +64,8 @@ namespace UI { DAT_MenuHandlerState::instance.y + 576); MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawTgxGmOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(OpenSHC::IO::Graphics::GID_INTERFACE_BUTTONS, 7, - (DAT_MenuHandlerState::instance.x - - DAT_MenuHandlerState::instance.buildMenuBackgroundLeftShift_0x24) - + 17, + DAT_MenuHandlerState::instance.x + - DAT_MenuHandlerState::instance.buildMenuBackgroundLeftShift_0x24 + 17, DAT_MenuHandlerState::instance.y + 473); MACRO_CALL_MEMBER( OpenSHC::UI::Rendering::TextureRenderCore_Func::setRenderingRectToGameResolution, @@ -77,8 +75,8 @@ namespace UI { DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; } - DAT_MinimapViewState::instance.needsRedraw = 1; - if (DAT_GameCore::instance.isBinkVideoPlaying == 0) { + DAT_MinimapViewState::instance.needsRedraw = TRUE; + if (!DAT_GameCore::instance.isBinkVideoPlaying) { MACRO_CALL_MEMBER( OpenSHC::UI::MinimapViewState_Func::renderMinimapMain, DAT_MinimapViewState::ptr)(); } @@ -86,8 +84,7 @@ namespace UI { if (DAT_GameCore::instance.isVictoryOrDefeatUnk != 0) { DAT_GameCore::instance.isVictoryOrDefeatUnk = 0; DAT_GameState::instance.mapAndTime.gameOver = TRUE; - DWORD _currentTime = timeGetTime(); - DAT_GameState::instance.mapAndTime.gameOverTime = _currentTime - 6000; + DAT_GameState::instance.mapAndTime.gameOverTime = timeGetTime() - 6000; DAT_GameState::instance.mapAndTime.playerIsAlive[DAT_GameSynchronyState::instance.currentPlayerSlotID] = 1; DAT_GameCore::instance.skipStoreSKMasters = 1; diff --git a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp index 368850855d..a40042e71b 100644 --- a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp @@ -4,6 +4,7 @@ #include "OpenSHC/Text/UserTextHandler.func.hpp" #include "OpenSHC/UI/DisplayElements.func.hpp" #include "OpenSHC/Game/GameMode.hpp" +#include "OpenSHC/Text/TextArrayIndexType.hpp" #include "OpenSHC/UI/Enums/BuildingsAndStatusMenuTabType.hpp" #include "OpenSHC/UI/Enums/DisplayElementID.hpp" @@ -25,7 +26,8 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x00431A90 void BuildMenu::MenuView_BuildMenu_Prepare() { - MACRO_CALL_MEMBER(OpenSHC::Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)(4); + MACRO_CALL_MEMBER(OpenSHC::Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)( + OpenSHC::Text::TAIT_UNKNOWN_4); if (DAT_GameCore::instance.activeMenuTab.tabType != OpenSHC::UI::Enums::BASMTT_SIEGETENT_BATTERINGRAM && DAT_GameCore::instance.activeMenuTab.tabType != OpenSHC::UI::Enums::BASMTT_SIEGETENT_SHIELD && DAT_GameCore::instance.menuTabToSwitchTo.tabType != OpenSHC::UI::Enums::BASMTT_SIEGETENT_BATTERINGRAM @@ -35,7 +37,7 @@ namespace UI { } MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( OpenSHC::UI::Enums::DEID_KEEP_AND_GRANERY_PLACEMENT_INFO, 0); - DAT_WindowAndDirectDraw::instance.pendingMenuRedraw = 1; + DAT_WindowAndDirectDraw::instance.pendingMenuRedraw = TRUE; if (MACRO_CALL_MEMBER(OpenSHC::Map::MapPropertiesState_Func::getEventIDForTimeUntilDefeatEventType, DAT_MapPropertiesState::ptr)() >= 0) { @@ -47,6 +49,7 @@ namespace UI { MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( OpenSHC::UI::Enums::DEID_UNKNOWN_25, 1); } + // the original tests the game mode again after each call if (DAT_GameSynchronyState::instance.currentGameMode != OpenSHC::Game::GM_SOLITARY) { MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( OpenSHC::UI::Enums::DEID_PLAYER_INFO_ON_HOVER, 1); diff --git a/src/OpenSHC/UI/MenuViews/CampaignUnk/MenuView_CampaignUnk_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/CampaignUnk/MenuView_CampaignUnk_DoInitial.cpp index 30be497505..5255bfb825 100644 --- a/src/OpenSHC/UI/MenuViews/CampaignUnk/MenuView_CampaignUnk_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/CampaignUnk/MenuView_CampaignUnk_DoInitial.cpp @@ -14,12 +14,11 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x004DD0C0 void CampaignUnk::MenuView_CampaignUnk_DoInitial() { - Menu* pMVar1; - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; MACRO_CALL(UI::Helpers_Func::ColorEntireScreen)(COL_BLACK::instance.shortValue); diff --git a/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoInitial.cpp index ca7ae8b81f..b315668d4b 100644 --- a/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoInitial.cpp @@ -3,7 +3,6 @@ #include "OpenSHC/UI/Rendering.func.hpp" #include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/COL_BLACK.hpp" #include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" @@ -19,10 +18,9 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x004262B0 void Credits::MenuView_Credits_DoInitial() { - Menu* pMVar1; MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, - (ushort)(COL_BLACK::instance.shortValue)); + COL_BLACK::instance.shortValue); MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); MACRO_CALL_MEMBER( UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(0, @@ -32,11 +30,11 @@ namespace UI { (DAT_WindowAndDirectDraw::instance.resolutionY - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) / 2); - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; DAT_TextEditorState::instance.pendingCreditsFadeBorder = TRUE; diff --git a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoEveryFrame.cpp index 5da9a28730..b9f2064000 100644 --- a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoEveryFrame.cpp @@ -18,11 +18,11 @@ namespace UI { { if (MACRO_CALL(UI::Helpers_Func::TicksSinceCounterStart)()) { MACRO_CALL(Rendering_Func::ProcessCreditsScriptCommands)(); - if ((59 <= (int)DAT_UnknownBinkIndex::instance) && (!INT_00ed27b8::instance)) { + if (DAT_UnknownBinkIndex::instance >= 59 && !INT_00ed27b8::instance) { MACRO_CALL_MEMBER(Audio::MSS::SoundSystem_Func::setSomeSoundTime, DAT_SoundSystemState::ptr)(); MACRO_CALL_MEMBER(Audio::MSS::SoundSystem_Func::setupVolumeAndSoundID, DAT_SoundSystemState::ptr)( DE::SHCDE::MUSIC_GERMAN_EGG); - INT_00ed27b8::instance = 1; + INT_00ed27b8::instance = TRUE; } MACRO_CALL(Rendering_Func::RenderActiveCreditsElements)(); } diff --git a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoInitial.cpp index 982364eca2..6cb7fb9fd9 100644 --- a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoInitial.cpp @@ -16,19 +16,18 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x004D91D0 void CrusadeEndscreen::MenuView_CrusadeEndscreen_DoInitial() { - Menu* pMVar1; MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, - (ushort)(COL_BLACK::instance.shortValue)); + COL_BLACK::instance.shortValue); MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; - INT_00ed27b8::instance = 0; + INT_00ed27b8::instance = FALSE; } } diff --git a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp index ebda71ea8e..ee42406177 100644 --- a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp @@ -23,28 +23,39 @@ namespace UI { void CrusadeEndscreen::MenuView_CrusadeEndscreen_Prepare() { DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "sktrail_win.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_sktrail_win_tgx_005ab768); + // "endframe1.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_endframe1_tgx_005ab758); + // "endframe2.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_endframe2_tgx_005ab748); + // "endframe3.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_endframe3_tgx_005ab738); + // "endframe4.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_endframe4_tgx_005ab728); + // "endframe5.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_endframe5_tgx_005ab718); + // "endframe6.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_endframe6_tgx_005ab708); + // "endframe7.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_endframe7_tgx_005ab6f8); + // "endframe8.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_endframe8_tgx_005ab6e8); + // "jesterlast.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_jesterlast_tgx_005ab6d8); MACRO_CALL(UI::Credits_Func::ResetCredits)(); DAT_NumberOfStoredMenuStrings::instance = 0; + // the five texts are written out: a loop over them loses (quick_diff 0.9985 -> 0.9718) // "Congratulations!" MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( @@ -66,157 +77,192 @@ namespace UI { MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( DE::SHCDE::TEXT_SKTRAIL_WIN, 4)); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundEntry)(1, 0); + // the repeated blocks are written out: the original has no loop here MACRO_CALL(UI::Credits_Func::AppendCreditsShowImageCommand)(41, 0, 230, 203, 336, 168, 0, 1); MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 0, 15, 1, 402, 234, 0, 1); MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 0, 15, 0, 400, 232, 0, 1); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 1, 106, 53, 4); + // "rt_vict1.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_rt_vict1_bik_005a78fc, 106, 53, 0, 0); + // "fx\\speech\\rt_anger_04.wav" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( (char*)s_fx_speech_rt_anger_04_wav_005ab6bc, 3, 0, 100); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 2, 331, 24, 4); + // "sn_vict2.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_sn_vict2_bik_005a78ec, 331, 24, 0, 0); + // "fx\\speech\\sn_add_player.wav" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( (char*)s_fx_speech_sn_add_player_wav_005ab6a0, 3, 0, 100); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 3, 557, 53, 4); + // "pg_taunt2.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_pg_taunt2_bik_005a7c44, 557, 53, 0, 0); + // "fx\\speech\\pg_add_player.wav" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( (char*)s_fx_speech_pg_add_player_wav_005ab684, 3, 0, 100); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 4, 640, 223, 4); + // "wf_anger1.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_wf_anger1_bik_005a7b20, 640, 223, 0, 0); + // "fx\\speech\\wf_anger_04.wav" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( (char*)s_fx_speech_wf_anger_04_wav_005ab668, 3, 0, 100); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 5, 557, 394, 4); + // "saladin_angry.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_saladin_angry_bik_005a7b0c, 557, 394, 0, 0); + // "fx\\speech\\sa_extra_01.wav" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( (char*)s_fx_speech_sa_extra_01_wav_005ab64c, 3, 0, 100); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 6, 332, 436, 4); + // "sultan_natural.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_sultan_natural_bik_005a78a4, 332, 436, 0, 0); + // "fx\\speech\\su_congrats_01.wav" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( (char*)s_fx_speech_su_congrats_01_wav_005ab62c, 3, 0, 100); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 7, 106, 394, 4); + // "richard_taunting.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_richard_taunting_bik_005a7d00, 106, 394, 0, 0); + // "fx\\speech\\ri_congrats_01.wav" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( (char*)s_fx_speech_ri_congrats_01_wav_005ab60c, 3, 0, 100); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 8, 35, 223, 4); + // "bad_arab_taunt.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_bad_arab_taunt_bik_005a7d2c, 35, 223, 0, 0); + // "fx\\speech\\ca_add_player_01.wav" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( (char*)s_fx_speech_ca_add_player_01_wav_005ab5ec, 3, 0, 100); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); - // the texts are a size larger in Italian - int fontSize = 16; + // 17 in Italian, 16 otherwise + int fontSizeUnk = 16; if (DAT_TextManagerObject::instance.gameLanguage == Text::GL_ITALIAN) { - fontSize = 17; + fontSizeUnk = 17; } MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(16, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 1, fontSize, 1, 262, 238, 282, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 1, fontSize, 0, 260, 236, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 1, fontSizeUnk, 1, 262, 238, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 1, fontSizeUnk, 0, 260, 236, 282, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 1); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(1, 90); MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(16, 1); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 1); - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 2, fontSize, 1, 262, 238, 282, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 2, fontSize, 0, 260, 236, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 2, fontSizeUnk, 1, 262, 238, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 2, fontSizeUnk, 0, 260, 236, 282, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 2); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(1, 90); MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(16, 2); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 2); if (DAT_GameCore::instance.currentTrailType == Game::TT_EXTREME) { - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 4, fontSize, 1, 262, 238, 282, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 4, fontSize, 0, 260, 236, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 4, fontSizeUnk, 1, 262, 238, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 4, fontSizeUnk, 0, 260, 236, 282, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 4); } else { - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 3, fontSize, 1, 262, 238, 282, 0); - MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 3, fontSize, 0, 260, 236, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 3, fontSizeUnk, 1, 262, 238, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 3, fontSizeUnk, 0, 260, 236, 282, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 3); } + // Written out too: the original has no loop here. MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 1); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 106, 53, 4); + // "action_jester.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 106, 53, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 2); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 331, 24, 4); + // "action_jester.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 331, 24, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 557, 53, 4); + // "action_jester.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 557, 53, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 4); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 640, 223, 4); + // "action_jester.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 640, 223, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 5); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 557, 394, 4); + // "action_jester.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 557, 394, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 6); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 332, 436, 4); + // "action_jester.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 332, 436, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 7); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 106, 394, 4); + // "action_jester.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 106, 394, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 8); MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 35, 223, 4); + // "action_jester.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 35, 223, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsImageEndCommand)(42, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(16, 3); MACRO_CALL(UI::Credits_Func::AppendCreditsSegmentEndCommand)(); + // Written out too: the original has no loop here. + // "action_jester.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 106, 53, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + // "action_jester.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 331, 24, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + // "action_jester.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 557, 53, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + // "action_jester.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 640, 223, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + // "action_jester.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 557, 394, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + // "action_jester.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 332, 436, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + // "action_jester.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 106, 394, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + // "action_jester.bik" MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( 12, (char*)s_action_jester_bik_005aa504, 35, 223, 0, 0); MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); diff --git a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp index f81b09aaa7..26f9c3eabe 100644 --- a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp @@ -20,7 +20,7 @@ namespace UI { void CustomScenarios::MenuView_CustomScenarios_DoEveryFrame() { DAT_UnknownGFXIndex::instance - = (int)(DAT_MenuModalComposition1::instance.activeModalDialogID != OpenSHC::UI::Enums::MMT_NONE); + = DAT_MenuModalComposition1::instance.activeModalDialogID != OpenSHC::UI::Enums::MMT_NONE; MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(DAT_UnknownGFXIndex::instance, (DAT_WindowAndDirectDraw::instance.resolutionX @@ -35,7 +35,6 @@ namespace UI { } if (DAT_MenuTextInputState::instance.dialogResult == -1) { MACRO_CALL(OpenSHC::UI::MenuViews::CustomScenarios_Func::MenuView_CustomScenarios_Prepare)(); - return; } } diff --git a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp index f140bb8c3a..116646b124 100644 --- a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp @@ -25,12 +25,15 @@ namespace UI { void CustomScenarios::MenuView_CustomScenarios_Prepare() { DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_builder.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_frontend_builder_tgx_005a2084); + // "frontend_builder2.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_frontend_builder2_tgx_005a206c); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); DWORD const now = timeGetTime(); + // the four buttons start their animation 1600 ms apart for (int i = 0; i < 4; ++i) { DAT_UIButtonDefinedData::instance.ButtonGmDataArray[364 + i].stateTransitionTimeBaseUnk_0x18 = now - (3 - i) * 1600; @@ -38,10 +41,10 @@ namespace UI { INT_00b95abc::instance = -1; DAT_MenuTextInputState::instance.dialogResult = 0; DAT_GameCore::instance.missionNumber1to20 = 0; - DAT_GameCore::instance.mapLoadedForEditor = 0; + DAT_GameCore::instance.mapLoadedForEditor = FALSE; DAT_GameCore::instance.gameMode_2 = Game::GM_EDITOR; - INT_00b960e4::instance = 0; - if (!DAT_GameSynchronyState::instance.currentPlayerSlotID) { + INT_00b960e4::instance = FALSE; + if (DAT_GameSynchronyState::instance.currentPlayerSlotID == 0) { DAT_GameSynchronyState::instance.currentPlayerSlotID = 1; } DAT_GameSynchronyState::instance diff --git a/src/OpenSHC/UI/MenuViews/GameStartEnterName/MenuView_GameStartEnterName_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/GameStartEnterName/MenuView_GameStartEnterName_DoInitial.cpp index 3409044ca0..7a9ed5e894 100644 --- a/src/OpenSHC/UI/MenuViews/GameStartEnterName/MenuView_GameStartEnterName_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/GameStartEnterName/MenuView_GameStartEnterName_DoInitial.cpp @@ -17,10 +17,9 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x004406F0 void GameStartEnterName::MenuView_GameStartEnterName_DoInitial() { - Menu* pMVar1; MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, - (ushort)(COL_BLACK::instance.shortValue)); + COL_BLACK::instance.shortValue); MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); MACRO_CALL_MEMBER( UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(0, @@ -30,11 +29,11 @@ namespace UI { (DAT_WindowAndDirectDraw::instance.resolutionY - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) / 2); - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; } diff --git a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBorderAndGfx.cpp b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBorderAndGfx.cpp index 7bd65a7848..7cc095c442 100644 --- a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBorderAndGfx.cpp +++ b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBorderAndGfx.cpp @@ -16,7 +16,7 @@ namespace UI { { MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, - (ushort)(COL_BLACK::instance.shortValue)); + COL_BLACK::instance.shortValue); MACRO_CALL(OpenSHC::UI::Rendering_Func::DrawOuterMenuBorder)(); MACRO_CALL(OpenSHC::UI::Rendering_Func::RenderGfxHelperUnk)(0, 0, 0); } diff --git a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture.cpp b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture.cpp index b2d230f821..962e2b8ede 100644 --- a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture.cpp +++ b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture.cpp @@ -18,10 +18,9 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x00425F60 void General::MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture() { - Menu* pMVar1; MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, - (ushort)(COL_BLACK::instance.shortValue)); + COL_BLACK::instance.shortValue); MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(DAT_UnknownGFXIndex::instance, @@ -31,11 +30,11 @@ namespace UI { (DAT_WindowAndDirectDraw::instance.resolutionY - DAT_TextureRenderCoreObject::instance.loadedGfxArray[DAT_UnknownGFXIndex::instance].height) / 2); - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; } diff --git a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_CrusadeAndRankMenu.cpp b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_CrusadeAndRankMenu.cpp index 8d4c02a460..f660261b2a 100644 --- a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_CrusadeAndRankMenu.cpp +++ b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_CrusadeAndRankMenu.cpp @@ -15,16 +15,15 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x004DD750 void General::MenuView_General_DoInitial_CrusadeAndRankMenu() { - Menu* pMVar1; MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, - (ushort)(COL_BLACK::instance.shortValue)); + COL_BLACK::instance.shortValue); MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; MACRO_CALL(UI::Rendering_Func::RenderGfxHelperUnk)(0, 0, 0); diff --git a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_DefaultMainMenuStructure.cpp b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_DefaultMainMenuStructure.cpp index 904f716cde..c13960bcc9 100644 --- a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_DefaultMainMenuStructure.cpp +++ b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_DefaultMainMenuStructure.cpp @@ -15,16 +15,15 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x004276F0 void General::MenuView_General_DoInitial_DefaultMainMenuStructure() { - Menu* pMVar1; MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, - (ushort)(COL_BLACK::instance.shortValue)); + COL_BLACK::instance.shortValue); MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; } diff --git a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_ScreenToBlack.cpp b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_ScreenToBlack.cpp index c2e43b8b92..c15970e3ab 100644 --- a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_ScreenToBlack.cpp +++ b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_ScreenToBlack.cpp @@ -14,15 +14,14 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x00430100 void General::MenuView_General_DoInitial_ScreenToBlack() { - Menu* pMVar1; MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, - (ushort)(COL_BLACK::instance.shortValue)); - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + COL_BLACK::instance.shortValue); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; } diff --git a/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp b/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp index 05072c75d1..5e718ac58d 100644 --- a/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp @@ -23,32 +23,37 @@ namespace UI { void HistoricCampaignIntro::MenuView_HistoricCampaignIntro_Prepare() { MACRO_CALL(UI::Helpers_Func::PrepareHistoryBook)(); + // the campaign's picture switch (DAT_GameCore::instance.historicCampaignNumber) { case 1: + // "c1pic.tgx" DAT_00eb0b20::instance = MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)(s_c1pic_tgx_005ab0ec); break; case 2: + // "c2pic.tgx" DAT_00eb0b20::instance = MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)(s_c2pic_tgx_005ab0e0); break; case 3: + // "c3pic.tgx" DAT_00eb0b20::instance = MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)(s_c3pic_tgx_005ab0d4); break; case 4: + // "c4pic.tgx" DAT_00eb0b20::instance = MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)(s_c4pic_tgx_005ab0c8); break; } + // the campaign's title and opening text, the first two of its six in TEXT_CAMPAIGN_INFO DAT_NumberOfStoredMenuStrings::instance = 0; - char* text - = MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( - DE::SHCDE::TEXT_CAMPAIGN_INFO, (int)(DAT_GameCore::instance.historicCampaignNumber * 6 - 5)); - MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)(text); - text = MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( - DE::SHCDE::TEXT_CAMPAIGN_INFO, (int)(DAT_GameCore::instance.historicCampaignNumber * 6 - 4)); - MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)(text); + MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( + MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( + DE::SHCDE::TEXT_CAMPAIGN_INFO, DAT_GameCore::instance.historicCampaignNumber * 6 - 5)); + MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( + MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( + DE::SHCDE::TEXT_CAMPAIGN_INFO, DAT_GameCore::instance.historicCampaignNumber * 6 - 4)); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); FLOAT_00ec0834::instance = 0.0; DAT_00ed2780::instance = 1; diff --git a/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_DoEveryFrame.cpp index 495f32a5b0..45975792e5 100644 --- a/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_DoEveryFrame.cpp @@ -16,7 +16,7 @@ namespace UI { void HistoricCampaignSelect::MenuView_HistoricCampaignSelect_DoEveryFrame() { DAT_UnknownGFXIndex::instance - = (int)(DAT_MenuModalComposition1::instance.activeModalDialogID != OpenSHC::UI::Enums::MMT_NONE); + = DAT_MenuModalComposition1::instance.activeModalDialogID != OpenSHC::UI::Enums::MMT_NONE; MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(DAT_UnknownGFXIndex::instance, (DAT_WindowAndDirectDraw::instance.resolutionX diff --git a/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp index b6a6f6cfde..ac48f36523 100644 --- a/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp @@ -4,7 +4,6 @@ #include "OpenSHC/UI/MenuModalComposition.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/UI/Enums/MenuModalType.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_MenuModalComposition3.hpp" @@ -21,12 +20,15 @@ namespace UI { void HistoricCampaignSelect::MenuView_HistoricCampaignSelect_Prepare() { DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_combat.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_frontend_combat_tgx_005a2028); + // "frontend_combat2.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_frontend_combat2_tgx_005a2010); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); DWORD const now = timeGetTime(); + // the four buttons start their animation 1600 ms apart for (int i = 0; i < 4; ++i) { DAT_UIButtonDefinedData::instance.ButtonGmDataArray[355 + i].stateTransitionTimeBaseUnk_0x18 = now - (3 - i) * 1600; diff --git a/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp index 5b96ae50fa..0044bd9269 100644 --- a/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp @@ -2,7 +2,6 @@ #include "OpenSHC/UI/Helpers.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_00b95b2c.hpp" @@ -20,6 +19,7 @@ namespace UI { { DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_combat2.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_frontend_combat2_tgx_005a2010); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); diff --git a/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_Prepare.cpp b/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_Prepare.cpp index 2e2c2de3a2..6917f54426 100644 --- a/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_Prepare.cpp @@ -15,12 +15,14 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x00424720 void IntroLogos::MenuView_IntroLogos_Prepare() { - if (!DAT_IntroStep::instance) { + if (DAT_IntroStep::instance == 0) { DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "logo1.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_logo1_tgx_005a1f74); } else if (DAT_IntroStep::instance == 1) { DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "logo2.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_logo2_tgx_005a1f68); } diff --git a/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_DoEveryFrame.cpp index 9458706528..9ce45f2d50 100644 --- a/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_DoEveryFrame.cpp @@ -3,7 +3,6 @@ #include "OpenSHC/Game/GameCore.func.hpp" #include "OpenSHC/Rendering/Bink/BinkControlClass.func.hpp" #include "OpenSHC/UI/Enums/MenuViewType.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_BinkControlState.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" @@ -17,13 +16,13 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x00424AD0 void IntroVideo::MenuView_IntroVideo_DoEveryFrame() { - DWORD DVar1 = timeGetTime(); - if (400 <= DVar1 - TIME_IntroVideo_Prepare::instance) { + DWORD const now = timeGetTime(); + if (now - TIME_IntroVideo_Prepare::instance >= 400) { if (DAT_MouseState::instance.draggingStopped) { MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::BinkControlClass_Func::stopBinkPlayback, DAT_BinkControlState::ptr)(0); } - if (DAT_BinkControlState::instance.binkObjPtrArray[0] == (HBINK)0) { + if (DAT_BinkControlState::instance.binkObjPtrArray[0] == NULL) { MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( OpenSHC::UI::Enums::MVT_GAME_START_ENTER_NAME, 0); } diff --git a/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_Prepare.cpp b/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_Prepare.cpp index 68ddd131ab..993dd9e161 100644 --- a/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_Prepare.cpp @@ -18,20 +18,20 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x00424A50 void IntroVideo::MenuView_IntroVideo_Prepare() { - Menu* pMVar1; - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, - (ushort)((int)(COL_BLACK::instance.shortValue))); + COL_BLACK::instance.shortValue); + // "intro.bik" MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::BinkControlClass_Func::playBINK, DAT_BinkControlState::ptr)(0, s_intro_bik_005a1f80, 0, 0, DAT_MenuHandlerState::instance.x + 80, - DAT_MenuHandlerState::instance.y + 0x3c, 0); + DAT_MenuHandlerState::instance.y + 60, 0); TIME_IntroVideo_Prepare::instance = timeGetTime(); } diff --git a/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp index 2810734e53..eae04dcef7 100644 --- a/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp @@ -6,8 +6,8 @@ #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/Game/GameMode2.hpp" #include "OpenSHC/Game/TrailType.hpp" +#include "OpenSHC/Text/TextArrayIndexType.hpp" #include "OpenSHC/UI/Enums/MenuModalType.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" @@ -28,7 +28,6 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x00427320 void LobbyMenu::MenuView_LobbyMenu_Prepare() { - Menu* pMVar1; MACRO_CALL_MEMBER(UI::MenuModalComposition_Func::activateModalDialog, DAT_MenuModalComposition3::ptr)( UI::Enums::MMT_NONE, FALSE); DAT_GameCore::instance.gameMode_2 = Game::GM_SKIRMISH_AND_MULTIPLAYER; @@ -36,58 +35,80 @@ namespace UI { DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; DAT_GameSynchronyState::instance.field_0x106ee4 = 0; DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_combat3.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_frontend_combat3_tgx_005a2134); + // "firefly-small.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_firefly_small_tgx_005a226c); + // "table.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_table_tgx_005a2260); + // "tslice1.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_tslice1_tgx_005a2254); + // "tslice2.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_tslice2_tgx_005a2248); + // "tslice3.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_tslice3_tgx_005a223c); + // "tslice4.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_tslice4_tgx_005a2230); + // "tslice5.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_tslice5_tgx_005a2224); + // "tslice6.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_tslice6_tgx_005a2218); + // "tslice7.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_tslice7_tgx_005a220c); + // "tslice8.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_tslice8_tgx_005a2200); + // "tslice1b.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_tslice1b_tgx_005a21f0); + // "tslice2b.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_tslice2b_tgx_005a21e0); + // "tslice3b.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_tslice3b_tgx_005a21d0); + // "tslice4b.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_tslice4b_tgx_005a21c0); + // "tslice5b.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_tslice5b_tgx_005a21b0); + // "tslice6b.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_tslice6b_tgx_005a21a0); + // "tslice7b.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_tslice7b_tgx_005a2190); + // "tslice8b.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_tslice8b_tgx_005a2180); + // "pick_opponent_normal.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_pick_opponent_normal_tgx_005a2164); + // "pick_opponent_large.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_pick_opponent_large_tgx_005a214c); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; DAT_UserTextHandlerState::instance.allowUserTextInput = 0; - MACRO_CALL_MEMBER(Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)(4); + MACRO_CALL_MEMBER(Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)( + Text::TAIT_UNKNOWN_4); MACRO_CALL_MEMBER(Text::UserTextHandler_Func::clearTextAndCursor, DAT_UserTextHandlerState::ptr)(); INT_00b960fc::instance = timeGetTime(); INT_00b95f6c::instance = 0; diff --git a/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_DoInitial.cpp index df1c5993ec..9882e98f53 100644 --- a/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_DoInitial.cpp @@ -23,10 +23,9 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x00424CD0 void MainMenu::MenuView_MainMenu_DoInitial() { - Menu* _menu; MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, - (ushort)((int)(COL_BLACK::instance.shortValue))); + COL_BLACK::instance.shortValue); MACRO_CALL(OpenSHC::UI::Rendering_Func::DrawOuterMenuBorder)(); MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(DAT_UnknownGFXIndex::instance, @@ -36,18 +35,18 @@ namespace UI { (DAT_WindowAndDirectDraw::instance.resolutionY - DAT_TextureRenderCoreObject::instance.loadedGfxArray[DAT_UnknownGFXIndex::instance].height) / 2); - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - _menu = DAT_MenuHandlerState::instance.currentMenu; - _menu->xPosition = borderWidth; - _menu->yPosition = borderHeight; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; - INT_00b95f68::instance = 0; + INT_00b95f68::instance = FALSE; + // "richard_swordswing.bik" MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::BinkControlClass_Func::playBINK, DAT_BinkControlState::ptr)(0, - s_richard_swordswing_bik_005a1fc4, 0, 0, - (int)((int)(DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 508)), - (int)((int)(DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 22)), 0); + s_richard_swordswing_bik_005a1fc4, 0, 0, DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 508, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 22, 0); DAT_MainMenuSwingSwordBool::instance = 0; } diff --git a/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_Prepare.cpp index b508ff1fea..f4ec8f1d28 100644 --- a/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_Prepare.cpp @@ -5,7 +5,6 @@ #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/Game/GameMode2.hpp" #include "OpenSHC/UI/Enums/MenuModalType.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" @@ -26,8 +25,10 @@ namespace UI { void MainMenu::MenuView_MainMenu_Prepare() { DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_main.tgx" MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)(s_frontend_main_tgx_005a1fb0); + // "frontend_main2.tgx" MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)(s_frontend_main2_tgx_005a1f9c); MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); diff --git a/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp index 8b1ef8f9b1..c31faa5357 100644 --- a/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp @@ -19,11 +19,11 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x004313C0 void MapEditorLandscaping::MenuView_MapEditorLandscaping_DoEveryFrame() { - if ((DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_SIEGETENT_SIEGETOWER) - || (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_SIEGETENT_SHIELD)) { + if (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_SIEGETENT_SIEGETOWER + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_SIEGETENT_SHIELD) { return; } - if (!DAT_MinimapViewState::instance.field_0xc) { + if (DAT_MinimapViewState::instance.field_0xc == 0) { DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated = 2; } if (DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated == 2) { @@ -33,7 +33,7 @@ namespace UI { DAT_MenuHandlerState::instance.x, DAT_MenuHandlerState::instance.y + 434); DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; } - DAT_MinimapViewState::instance.needsRedraw = 1; + DAT_MinimapViewState::instance.needsRedraw = TRUE; MACRO_CALL_MEMBER(OpenSHC::UI::MinimapViewState_Func::renderMinimapLandscaping, DAT_MinimapViewState::ptr)( DAT_MenuHandlerState::instance.x + 664, DAT_MenuHandlerState::instance.y + 464, 128, 128); } diff --git a/src/OpenSHC/UI/MenuViews/MissionSelect/MenuView_MissionSelect_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/MissionSelect/MenuView_MissionSelect_DoEveryFrame.cpp index f8f408dbfd..3c877fc8a7 100644 --- a/src/OpenSHC/UI/MenuViews/MissionSelect/MenuView_MissionSelect_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/MissionSelect/MenuView_MissionSelect_DoEveryFrame.cpp @@ -2,6 +2,7 @@ #include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" #include "OpenSHC/Rendering/Enums/RenderTarget.hpp" #include "OpenSHC/UI/Enums/MenuModalType.hpp" @@ -28,27 +29,28 @@ namespace UI { (DAT_WindowAndDirectDraw::instance.resolutionY - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) / 2); - if ((DAT_MenuTextInputState::instance.currentModalDialog == OpenSHC::UI::Enums::MMT_NO_MENU) - && (DAT_MenuModalComposition1::instance.activeModalDialogID == OpenSHC::UI::Enums::MMT_NONE)) { - int y1 = DAT_MenuHandlerState::instance.y + 190; - int x2 = DAT_MenuHandlerState::instance.x + 570; - int x1 = DAT_MenuHandlerState::instance.x + 229; - int y2 = DAT_MenuHandlerState::instance.y + 289; - MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( - x1, y1 - 1, x2, y1 - 1, (ushort)((int)(COL_VERY_SOFT_YELLOW::instance.shortValue))); - MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( - x1, y2 + 1, x2, y2 + 1, (ushort)((int)(COL_VERY_SOFT_YELLOW::instance.shortValue))); - MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( - x1, y1, x1, y2, (ushort)((int)(COL_VERY_SOFT_YELLOW::instance.shortValue))); - MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( - x2, y1, x2, y2, (ushort)((int)(COL_VERY_SOFT_YELLOW::instance.shortValue))); - DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; - // "Mission" - MACRO_CALL_MEMBER( - OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, DAT_PencilRenderCore::ptr)( - 5, 0xf, DAT_MenuHandlerState::instance.x + 184, DAT_MenuHandlerState::instance.y + 100, 432, 50); - DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + if (DAT_MenuTextInputState::instance.currentModalDialog != OpenSHC::UI::Enums::MMT_NO_MENU + || DAT_MenuModalComposition1::instance.activeModalDialogID != OpenSHC::UI::Enums::MMT_NONE) { + return; } + int const y1 = DAT_MenuHandlerState::instance.y + 190; + int const x2 = DAT_MenuHandlerState::instance.x + 570; + int const x1 = DAT_MenuHandlerState::instance.x + 229; + int const y2 = DAT_MenuHandlerState::instance.y + 289; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y1 - 1, x2, y1 - 1, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y2 + 1, x2, y2 + 1, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y1, x1, y2, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x2, y1, x2, y2, COL_VERY_SOFT_YELLOW::instance.shortValue); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + // "Mission" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(OpenSHC::DE::SHCDE::TEXT_MAINOPTIONS, 15, + DAT_MenuHandlerState::instance.x + 184, DAT_MenuHandlerState::instance.y + 100, 432, 50); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; } } diff --git a/src/OpenSHC/UI/MenuViews/MpConnection/MenuView_MpConnection_Prepare.cpp b/src/OpenSHC/UI/MenuViews/MpConnection/MenuView_MpConnection_Prepare.cpp index 93aa97709f..8c78948f9f 100644 --- a/src/OpenSHC/UI/MenuViews/MpConnection/MenuView_MpConnection_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/MpConnection/MenuView_MpConnection_Prepare.cpp @@ -4,7 +4,6 @@ #include "OpenSHC/UI/Helpers.func.hpp" #include "OpenSHC/UI/MenuModalComposition.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" @@ -21,17 +20,17 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x00427110 void MpConnection::MenuView_MpConnection_Prepare() { - Menu* pMVar1; DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_combat3.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_frontend_combat3_tgx_005a2134); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; MACRO_CALL_MEMBER( diff --git a/src/OpenSHC/UI/MenuViews/ScenarioDescription/MenuView_ScenarioDescription_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/ScenarioDescription/MenuView_ScenarioDescription_DoInitial.cpp index cd80d788e9..2cf469452c 100644 --- a/src/OpenSHC/UI/MenuViews/ScenarioDescription/MenuView_ScenarioDescription_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/ScenarioDescription/MenuView_ScenarioDescription_DoInitial.cpp @@ -14,12 +14,11 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x004DD300 void ScenarioDescription::MenuView_ScenarioDescription_DoInitial() { - Menu* pMVar1; - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; MACRO_CALL(UI::Helpers_Func::ColorEntireScreen)(COL_BLACK::instance.shortValue); diff --git a/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoInitial.cpp index b77cce6ffa..c16c5bf280 100644 --- a/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoInitial.cpp @@ -16,16 +16,15 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x0042BB90 void SelectCrusade::MenuView_SelectCrusade_DoInitial() { - Menu* pMVar1; MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, - (ushort)(COL_BLACK::instance.shortValue)); + COL_BLACK::instance.shortValue); MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; DAT_HighlightedSkirmishType::instance = 0; diff --git a/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp b/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp index 60a42148ba..912d2c25a5 100644 --- a/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp @@ -8,7 +8,7 @@ #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/Game/GameMode.hpp" #include "OpenSHC/Game/GameMode2.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" +#include "OpenSHC/Text/TextArrayIndexType.hpp" #include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_00b960dc.hpp" @@ -66,25 +66,27 @@ namespace UI { DWORD_00b95b1c::instance = timeGetTime(); DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; if ((int)DAT_MapMissionType::instance < 2) { + // "frontend_economics2.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_frontend_economics2_tgx_005a203c); } else { + // "frontend_combat2.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_frontend_combat2_tgx_005a2010); } MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; menu->xPosition = borderWidth; menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; - MACRO_CALL_MEMBER(Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)(4); + MACRO_CALL_MEMBER(Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)( + Text::TAIT_UNKNOWN_4); MACRO_CALL_MEMBER(Map::TileMapState_Func::setupAllMapSections, DAT_TileMapState::ptr)(); INT_00b95b64::instance = 0; - DAT_GameCore::instance.activeMenuTab.tabType - = (UI::Enums::BuildingsAndStatusMenuTabTypeInt)(DAT_MapMissionType::instance != 0); + DAT_GameCore::instance.activeMenuTab.tabType = DAT_MapMissionType::instance != 0; } } diff --git a/src/OpenSHC/UI/MenuViews/Unknown26/MenuView_Unknown26_CampaignRelatedUnk_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/Unknown26/MenuView_Unknown26_CampaignRelatedUnk_DoInitial.cpp index ee5e7d64f8..eb975da1ed 100644 --- a/src/OpenSHC/UI/MenuViews/Unknown26/MenuView_Unknown26_CampaignRelatedUnk_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/Unknown26/MenuView_Unknown26_CampaignRelatedUnk_DoInitial.cpp @@ -14,12 +14,11 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x004E1E30 void Unknown26::MenuView_Unknown26_CampaignRelatedUnk_DoInitial() { - Menu* pMVar1; - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; MACRO_CALL(UI::Helpers_Func::ColorEntireScreen)(COL_BLACK::instance.shortValue); diff --git a/src/OpenSHC/UI/MenuViews/Unknown33/MenuView_Unknown33_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/Unknown33/MenuView_Unknown33_DoEveryFrame.cpp index fb02de4c9d..fee8a53434 100644 --- a/src/OpenSHC/UI/MenuViews/Unknown33/MenuView_Unknown33_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/Unknown33/MenuView_Unknown33_DoEveryFrame.cpp @@ -7,7 +7,6 @@ #include "OpenSHC/Commands/GameCommandType.hpp" #include "OpenSHC/UI/Enums/BuildingsAndStatusMenuTabType.hpp" #include "OpenSHC/UI/Enums/MenuViewType.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/Globals/DAT_00b960f8.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" @@ -24,39 +23,40 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x0042C090 void Unknown33::MenuView_Unknown33_DoEveryFrame() { - if (MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::checkAllPlayersReadyAndCleanupSlots, + if (!MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::checkAllPlayersReadyAndCleanupSlots, DAT_GameSynchronyState::ptr)()) { - if (DAT_GameSynchronyState::instance.isHost) { - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, - DAT_GameSynchronyState::ptr)(OpenSHC::Commands::GCT_HOST_SHARE_LOBBY_STATE); - DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 0; - MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, - DAT_GameSynchronyState::ptr)(OpenSHC::Commands::GCT_TRIGGER_LOBBY_PLAYER_INFORMATION_REFRESH); - } - for (int playerID = 1; playerID < countof(DAT_GameSynchronyState::instance.currentPlayerFullIDArray); - ++playerID) { - if (DAT_GameSynchronyState::instance.currentPlayerFullIDArray[playerID] == -1 - && (DAT_GameCore::instance.mapU4Int0 == 0 - || (playerID != DAT_GameState::instance.mapAndTime.somePlayerID)) - && DAT_GameSynchronyState::instance.currentAIArray[playerID] == 0) { - MACRO_CALL_MEMBER(OpenSHC::Game::GameStateStructures_Func::destroyPlayerCompletely, - DAT_GameState::ptr)(playerID); - } - } - MACRO_CALL(OpenSHC::Synchrony_Func::SetAIPlayerNickNames)(); - DAT_GameSynchronyState::instance.timeSkirmishGameStart = timeGetTime(); - DAT_GameCore::instance.buildmenuMenuTabToSwitchTo.tabType = OpenSHC::UI::Enums::BASMTT_HUNTERSHUT; - MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( - OpenSHC::UI::Enums::MVT_BUILD_MENU, 0); - DAT_GameSynchronyState::instance.DAT_TwoIfNotHost = 0; - for (int i = 0; i < countof(DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue); ++i) { - DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[i] = 0; + return; + } + if (DAT_GameSynchronyState::instance.isHost) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, + DAT_GameSynchronyState::ptr)(OpenSHC::Commands::GCT_HOST_SHARE_LOBBY_STATE); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, + DAT_GameSynchronyState::ptr)(OpenSHC::Commands::GCT_TRIGGER_LOBBY_PLAYER_INFORMATION_REFRESH); + } + for (int playerID = 1; playerID < countof(DAT_GameSynchronyState::instance.currentPlayerFullIDArray); + ++playerID) { + if (DAT_GameSynchronyState::instance.currentPlayerFullIDArray[playerID] == -1 + && (DAT_GameCore::instance.mapU4Int0 == 0 + || playerID != DAT_GameState::instance.mapAndTime.somePlayerID) + && DAT_GameSynchronyState::instance.currentAIArray[playerID] == 0) { + MACRO_CALL_MEMBER( + OpenSHC::Game::GameStateStructures_Func::destroyPlayerCompletely, DAT_GameState::ptr)(playerID); } - DAT_00b960f8::instance = 0; - INT_00b960f0::instance = 0; - DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; - DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated = 1; } + MACRO_CALL(OpenSHC::Synchrony_Func::SetAIPlayerNickNames)(); + DAT_GameSynchronyState::instance.timeSkirmishGameStart = timeGetTime(); + DAT_GameCore::instance.buildmenuMenuTabToSwitchTo.tabType = OpenSHC::UI::Enums::BASMTT_HUNTERSHUT; + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_BUILD_MENU, 0); + DAT_GameSynchronyState::instance.DAT_TwoIfNotHost = 0; + for (int i = 0; i < countof(DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue); ++i) { + DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[i] = 0; + } + DAT_00b960f8::instance = 0; + INT_00b960f0::instance = 0; + DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; + DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated = 1; } } diff --git a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame.cpp index 86dffc5d73..b2bbef460c 100644 --- a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame.cpp @@ -13,11 +13,11 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x004272C0 void Unknown61ReturnToSkrimishMenuUnk::MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame() { - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - Menu* _menuPtr = DAT_MenuHandlerState::instance.currentMenu; - _menuPtr->yPosition = borderHeight; - _menuPtr->xPosition = borderWidth; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->yPosition = borderHeight; + menu->xPosition = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; MACRO_CALL_MEMBER( diff --git a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial.cpp index ca1ebcc70e..60a9995b68 100644 --- a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial.cpp @@ -17,16 +17,15 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x00427240 void Unknown61ReturnToSkrimishMenuUnk::MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial() { - Menu* pMVar1; MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, - (ushort)(COL_BLACK::instance.shortValue)); + COL_BLACK::instance.shortValue); MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; MACRO_CALL_MEMBER( diff --git a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare.cpp b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare.cpp index b825bb5459..a8bde1e4cb 100644 --- a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare.cpp @@ -19,16 +19,16 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x004409C0 void Unknown61ReturnToSkrimishMenuUnk::MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare() { - Menu* pMVar1; DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_combat3.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_frontend_combat3_tgx_005a2134); MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); @@ -40,6 +40,7 @@ namespace UI { (DAT_WindowAndDirectDraw::instance.resolutionY - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) / 2); + // 2 is the Custom Game button MACRO_CALL(UI::MenuItems::SelectCrusade_Func::MenuItemActionHandler_SelectCrusade_Main)(2); MACRO_CALL_MEMBER(Game::Skirmish::SkirmishLobbySetupStructure_Func::restoreSkirmishLobbySetup, SEC_SkirmishLobbySetupStructure::ptr)(); diff --git a/src/OpenSHC/UI/MenuViews/UnusedCreateSiege/MenuView_UnusedCreateSiege_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedCreateSiege/MenuView_UnusedCreateSiege_Prepare.cpp index 1597a07443..f0210141ae 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedCreateSiege/MenuView_UnusedCreateSiege_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedCreateSiege/MenuView_UnusedCreateSiege_Prepare.cpp @@ -3,7 +3,7 @@ #include "OpenSHC/Text/UserTextHandler.func.hpp" #include "OpenSHC/UI/Helpers.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" +#include "OpenSHC/Text/TextArrayIndexType.hpp" #include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" @@ -19,12 +19,14 @@ namespace UI { void UnusedCreateSiege::MenuView_UnusedCreateSiege_Prepare() { DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; - MACRO_CALL_MEMBER(OpenSHC::Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)(9); + MACRO_CALL_MEMBER(OpenSHC::Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)( + OpenSHC::Text::TAIT_NINE__FILTER_B); DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_builder2.tgx" MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)(s_frontend_builder2_tgx_005a206c); MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); - INT_00b960e4::instance = 0; + INT_00b960e4::instance = FALSE; } } diff --git a/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_Prepare.cpp index 2a5f56f68e..34054bc480 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_Prepare.cpp @@ -4,7 +4,6 @@ #include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/Rendering/ScreenResolutionEnum.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/COL_BLACK.hpp" @@ -24,11 +23,12 @@ namespace UI { void UnusedDemoBuyItScreen::MenuView_UnusedDemoBuyItScreen_Prepare() { DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "demo buy it screen.tgx" MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)(s_demo_buy_it_screen_tgx_005a20f8); MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, - (ushort)(COL_BLACK::instance.shortValue)); + COL_BLACK::instance.shortValue); INT_00b95b34::instance = timeGetTime(); INT_00b960e0::instance = 0; if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_800x600) { diff --git a/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_DoInitial.cpp index c7d566e0ed..cc3d2fd80b 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_DoInitial.cpp @@ -18,10 +18,9 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x00425A40 void UnusedEconomicGametypeSelect::MenuView_UnusedEconomicGametypeSelect_DoInitial() { - Menu* pMVar1; MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, - (ushort)(COL_BLACK::instance.shortValue)); + COL_BLACK::instance.shortValue); MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); MACRO_CALL_MEMBER( UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(0, @@ -31,14 +30,14 @@ namespace UI { (DAT_WindowAndDirectDraw::instance.resolutionY - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) / 2); - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; - INT_00b95f68::instance = 0; + INT_00b95f68::instance = FALSE; } } diff --git a/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp index 52d80dbb1d..08add0b236 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp @@ -17,12 +17,15 @@ namespace UI { void UnusedEconomicGametypeSelect::MenuView_UnusedEconomicGametypeSelect_Prepare() { DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_economics.tgx" MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)(s_frontend_economics_tgx_005a2054); + // "frontend_economics2.tgx" MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)(s_frontend_economics2_tgx_005a203c); MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); DWORD const now = timeGetTime(); + // this menu's three buttons start their animation 1600 ms apart for (int i = 0; i < 3; ++i) { DAT_UIButtonDefinedData::instance.ButtonGmDataArray[360 + i].stateTransitionTimeBaseUnk_0x18 = now - (3 - i) * 1600; diff --git a/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp index 5865712d2d..ea6d6aeee5 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp @@ -2,7 +2,6 @@ #include "OpenSHC/UI/Helpers.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" @@ -18,6 +17,7 @@ namespace UI { { DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_economics2.tgx" MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)(s_frontend_economics2_tgx_005a203c); MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); diff --git a/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoEveryFrame.cpp index e16aca7e2d..ebaf34cba6 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoEveryFrame.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoEveryFrame.cpp @@ -18,28 +18,28 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x004E1AA0 void UnusedExtremeAd::MenuView_UnusedExtremeAd_DoEveryFrame() { - if (MACRO_CALL(UI::Helpers_Func::TicksSinceCounterStart)()) { - if (DAT_MouseState::instance.rightClickStop) { - MACRO_CALL(UI::Credits_Func::StopCreditsPlaybackAndSounds)(); - } - if (DAT_MouseState::instance.leftClickStart) { - if (MACRO_CALL(UI::Helpers_Func::FindCampaignMapHotspotAtMouse)() == 1) { - MACRO_CALL(UI::Credits_Func::EndCreditsSegmentAndAdvanceToNext)(); - ++DAT_00ed278c::instance; - if (DAT_00ed278c::instance == 3) { - DAT_WindowAndDirectDraw::instance.postWindowCloseMessage = 1; - } - } - } - MACRO_CALL(Rendering_Func::ProcessCreditsScriptCommands)(); - if ((int)DAT_UnknownBinkIndex::instance < (int)DAT_UnknownBinkCount::instance) { - MACRO_CALL(Rendering_Func::RenderActiveCreditsElements)(); - } - ++INT_00ed3140::instance; - if ((int)DAT_UnknownBinkIndex::instance >= (int)DAT_UnknownBinkCount::instance) { + if (!MACRO_CALL(UI::Helpers_Func::TicksSinceCounterStart)()) { + return; + } + if (DAT_MouseState::instance.rightClickStop) { + MACRO_CALL(UI::Credits_Func::StopCreditsPlaybackAndSounds)(); + } + if (DAT_MouseState::instance.leftClickStart + && MACRO_CALL(UI::Helpers_Func::FindCampaignMapHotspotAtMouse)() == 1) { + MACRO_CALL(UI::Credits_Func::EndCreditsSegmentAndAdvanceToNext)(); + ++DAT_00ed278c::instance; + if (DAT_00ed278c::instance == 3) { DAT_WindowAndDirectDraw::instance.postWindowCloseMessage = 1; } } + MACRO_CALL(Rendering_Func::ProcessCreditsScriptCommands)(); + if (DAT_UnknownBinkIndex::instance < DAT_UnknownBinkCount::instance) { + MACRO_CALL(Rendering_Func::RenderActiveCreditsElements)(); + } + ++INT_00ed3140::instance; + if (DAT_UnknownBinkIndex::instance >= DAT_UnknownBinkCount::instance) { + DAT_WindowAndDirectDraw::instance.postWindowCloseMessage = 1; + } } } diff --git a/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoInitial.cpp index c813a1b402..4ae30d24bd 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoInitial.cpp @@ -15,15 +15,14 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x004E1A50 void UnusedExtremeAd::MenuView_UnusedExtremeAd_DoInitial() { - Menu* pMVar1; MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, - (ushort)(COL_BLACK::instance.shortValue)); - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - pMVar1 = DAT_MenuHandlerState::instance.currentMenu; - pMVar1->xPosition = borderWidth; - pMVar1->yPosition = borderHeight; + COL_BLACK::instance.shortValue); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; MACRO_CALL(Rendering_Func::RenderActiveCreditsElements)(); diff --git a/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp index 4342eba299..d50a7de5a5 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp @@ -5,7 +5,6 @@ #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" #include "OpenSHC/Text/TextAlignment.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/COL_BLACK.hpp" @@ -25,9 +24,9 @@ namespace UI { { MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, - (ushort)(COL_BLACK::instance.shortValue)); - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + COL_BLACK::instance.shortValue); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; menu->xPosition = borderWidth; menu->yPosition = borderHeight; @@ -38,17 +37,20 @@ namespace UI { int const top = (DAT_WindowAndDirectDraw::instance.resolutionY - 400) / 2; int const left = (DAT_WindowAndDirectDraw::instance.resolutionX - 600) / 2; MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)( - left, top, left + 600, top + 400, (ushort)(COL_WHITE::instance.shortValue)); + left, top, left + 600, top + 400, COL_WHITE::instance.shortValue); MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( 0, DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 100, DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 100); + // "FireFly's" MACRO_CALL_MEMBER(Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( s_FireFly_s_005a22c4, DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400, DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 210, Text::TTA_LEFT, OpenSHC::Rendering::Colors::COL_0080FF, 15, FALSE, 0); + // "Crusader" MACRO_CALL_MEMBER(Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( s_Crusader_005a22b8, DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400, - DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 248, Text::TTA_LEFT, 0, 17, FALSE, 0); + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 248, Text::TTA_LEFT, + OpenSHC::Rendering::Colors::COL_000000, 17, FALSE, 0); } } diff --git a/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_Prepare.cpp index 9d21fd574a..7c6566e236 100644 --- a/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_Prepare.cpp @@ -1,7 +1,6 @@ #include "../UnusedOldTitleMenu.func.hpp" #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" -#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" #include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" @@ -16,15 +15,16 @@ namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x0042DCB0 void UnusedOldTitleMenu::MenuView_UnusedOldTitleMenu_Prepare() { - int borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; - int borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; - Menu* pMVar1 = DAT_MenuHandlerState::instance.currentMenu; + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; - pMVar1->yPosition = borderHeight; - pMVar1->xPosition = borderWidth; + menu->yPosition = borderHeight; + menu->xPosition = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; DAT_MenuHandlerState::instance.x = borderWidth; DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "gm_fly.tgx" MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( s_gm_fly_tgx_005a2110); } From b2f3e340ab7f3f518790b700994f7efaf1686106 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Tue, 10 Nov 2026 00:42:04 +0100 Subject: [PATCH 58/58] UI-gynt-backlog-MenuViews: main's names after its Ghidra sync (TAIT_UNKNOWN, INT_00b9840c) Co-authored-by: Gynt Co-Authored-By: Claude Opus 5.5 --- .../UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp | 2 +- .../UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp | 2 +- .../MenuView_SingleplayerMapChoice_Prepare.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp index a40042e71b..a90bfba498 100644 --- a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp @@ -27,7 +27,7 @@ namespace UI { void BuildMenu::MenuView_BuildMenu_Prepare() { MACRO_CALL_MEMBER(OpenSHC::Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)( - OpenSHC::Text::TAIT_UNKNOWN_4); + OpenSHC::Text::TAIT_UNKNOWN); if (DAT_GameCore::instance.activeMenuTab.tabType != OpenSHC::UI::Enums::BASMTT_SIEGETENT_BATTERINGRAM && DAT_GameCore::instance.activeMenuTab.tabType != OpenSHC::UI::Enums::BASMTT_SIEGETENT_SHIELD && DAT_GameCore::instance.menuTabToSwitchTo.tabType != OpenSHC::UI::Enums::BASMTT_SIEGETENT_BATTERINGRAM diff --git a/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp index eae04dcef7..4d096c77e2 100644 --- a/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp @@ -108,7 +108,7 @@ namespace UI { DAT_MenuHandlerState::instance.y = borderHeight; DAT_UserTextHandlerState::instance.allowUserTextInput = 0; MACRO_CALL_MEMBER(Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)( - Text::TAIT_UNKNOWN_4); + Text::TAIT_UNKNOWN); MACRO_CALL_MEMBER(Text::UserTextHandler_Func::clearTextAndCursor, DAT_UserTextHandlerState::ptr)(); INT_00b960fc::instance = timeGetTime(); INT_00b95f6c::instance = 0; diff --git a/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp b/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp index 912d2c25a5..004823253a 100644 --- a/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp +++ b/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp @@ -83,7 +83,7 @@ namespace UI { DAT_MenuHandlerState::instance.x = borderWidth; DAT_MenuHandlerState::instance.y = borderHeight; MACRO_CALL_MEMBER(Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)( - Text::TAIT_UNKNOWN_4); + Text::TAIT_UNKNOWN); MACRO_CALL_MEMBER(Map::TileMapState_Func::setupAllMapSections, DAT_TileMapState::ptr)(); INT_00b95b64::instance = 0; DAT_GameCore::instance.activeMenuTab.tabType = DAT_MapMissionType::instance != 0;