From 8c5fa6ff11233cc46deef18404a5cf65316df33b Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 11:19:43 +0100 Subject: [PATCH 1/3] reimplement: SHC_3BB0A8C1_0x004398B0 100.0% Reimplemented BuildingAndStatusMenu::MenuView_BuildingAndStatusMenu_DoInitial, from gynt's draft on his fork's reimpl/UI-MenuViews-development (his newest scored commit on the file is 24a37e86f at 96.23%; the newest commit on the file, e9bc49c12, is on his reimpl/UI-MenuItems-development), through our draft bef74aef8 (96.3%, in the draft PR #356), which restored the y store at 640x480. Two differences were left, and both come from one thing: a store that both arms of an if / else share was written once behind the arms. The compiler merges the arms' identical ends, so the instructions come out the same either way, but what it decides before that merge does not: - DAT_MenuHandlerState::instance.y at the function's start. Written in each arm, ebp is saved behind the merged store and the load of the tab type (push ebp at 0x004398FF), as in the original. Written once behind the arms, ebp is saved in front of the store. - drawBufferChoiceValue = RT_MAP_GAME at the end of the 1024x768 and the 1024x600 blocks. The function stores 99 sixteen times, so the compiler holds 99 in ecx (lea ecx, [ebx + 99] at 0x00439986). The original uses that register only up to the first call and stores the immediate in every later block. Written once behind the arms, our compiler loaded 99 into ecx again at each block's end (13 times). Written in each arm of those two blocks, it does not. Measured: quick_diff 1.0000 with 1069 instructions on both sides; reccmp 100.0% (normalized 100.0%) alone, data resolvers and its own resolver on. Not run in game. Tried on the way, all without effect on the 99: where the 99 stores sit in the first two blocks, a local for the 99, the second store reading the index back, and the four callees in the same translation unit (quick_diff 0.7860). The text against the draft: pendingMenuRedraw is a BOOLEnum, so it is tested by truthiness and stored FALSE; in the first two blocks, where each arm is now complete by itself, leftGfx is declared in the arm with its value. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- ...nuView_BuildingAndStatusMenu_DoInitial.cpp | 843 ++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 844 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/BuildingAndStatusMenu/MenuView_BuildingAndStatusMenu_DoInitial.cpp diff --git a/src/OpenSHC/UI/MenuViews/BuildingAndStatusMenu/MenuView_BuildingAndStatusMenu_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/BuildingAndStatusMenu/MenuView_BuildingAndStatusMenu_DoInitial.cpp new file mode 100644 index 0000000000..4f1298f347 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/BuildingAndStatusMenu/MenuView_BuildingAndStatusMenu_DoInitial.cpp @@ -0,0 +1,843 @@ +#include "../BuildingAndStatusMenu.func.hpp" + +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/Rendering/ScreenResolutionEnum.hpp" +#include "OpenSHC/UI/Enums/BuildingsAndStatusMenuTabType.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/COL_MAGENTA.hpp" +#include "OpenSHC/Globals/DAT_GameCore.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 0x004398B0 + void BuildingAndStatusMenu::MenuView_BuildingAndStatusMenu_DoInitial() + { + // the menu sits at the bottom of the screen, pushed off its left edge at 640x480. Each arm stores y + // itself (one store behind both arms loses the match) + int const y = DAT_WindowAndDirectDraw::instance.resolutionY - 600; + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_640x480) { + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = -698; + menu->yPosition = y; + DAT_MenuHandlerState::instance.x = -698; + DAT_MenuHandlerState::instance.y = y; + } else { + int const x = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = x; + menu->yPosition = y; + DAT_MenuHandlerState::instance.x = x; + DAT_MenuHandlerState::instance.y = y; + } + if (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM) { + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::setMenuTabIndexUnk, + DAT_TextureRenderCoreObject::ptr)(7); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::setMenuTabIndexUnk, + DAT_TextureRenderCoreObject::ptr)(3); + } + } else if (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST) { + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::setMenuTabIndexUnk, + DAT_TextureRenderCoreObject::ptr)(7); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::setMenuTabIndexUnk, + DAT_TextureRenderCoreObject::ptr)(3); + } + } else if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::setMenuTabIndexUnk, + DAT_TextureRenderCoreObject::ptr)(6); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::setMenuTabIndexUnk, + DAT_TextureRenderCoreObject::ptr)(1); + } + if (!DAT_WindowAndDirectDraw::instance.pendingMenuRedraw) { + return; + } + DAT_WindowAndDirectDraw::instance.pendingMenuRedraw = FALSE; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, + DAT_MenuHandlerState::instance.y + 406, DAT_WindowAndDirectDraw::instance.resolutionX - 1, + DAT_MenuHandlerState::instance.y + 471, COL_MAGENTA::instance.shortValue); + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1024x768) { + if (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST) { + DAT_TextureRenderCoreObject::instance.backwardsLoadedGfxIndex_0x16C850 = 99; + DAT_TextureRenderCoreObject::instance.loadedGfxArray[99].backwardsOffsetInBuffer = 0; + // "edge_military_1024l.tgx" + int const leftGfx + = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1024l_tgx_005a25c0); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge_military_1024l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1024l_tgx_005a25c0); + } else { + // "edge_military_1024r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1024r_tgx_005a25a8); + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue + = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)( + leftGfx, 0, 768 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx].height); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 896, + 768 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 912, + 768 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } + // set in each arm, here and in the next block (one store behind both arms loses the match) + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue + = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } else { + DAT_TextureRenderCoreObject::instance.backwardsLoadedGfxIndex_0x16C850 = 99; + DAT_TextureRenderCoreObject::instance.loadedGfxArray[99].backwardsOffsetInBuffer = 0; + // "edge1024l.tgx" + int const leftGfx + = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1024l_tgx_005a2388); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge1024l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1024l_tgx_005a2388); + } else { + // "edge1024r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1024r_tgx_005a2418); + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue + = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)( + leftGfx, 0, 768 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx].height); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 912, + 768 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue + = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1024x600) { + if (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST) { + DAT_TextureRenderCoreObject::instance.backwardsLoadedGfxIndex_0x16C850 = 99; + DAT_TextureRenderCoreObject::instance.loadedGfxArray[99].backwardsOffsetInBuffer = 0; + // "edge_military_1024l.tgx" + int const leftGfx + = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1024l_tgx_005a25c0); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge_military_1024l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1024l_tgx_005a25c0); + } else { + // "edge_military_1024r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1024r_tgx_005a25a8); + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue + = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)( + leftGfx, 0, 600 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx].height); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 896, + 600 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 912, + 600 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue + = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } else { + DAT_TextureRenderCoreObject::instance.backwardsLoadedGfxIndex_0x16C850 = 99; + DAT_TextureRenderCoreObject::instance.loadedGfxArray[99].backwardsOffsetInBuffer = 0; + // "edge1024l.tgx" + int const leftGfx + = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1024l_tgx_005a2388); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge1024l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1024l_tgx_005a2388); + } else { + // "edge1024r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1024r_tgx_005a2418); + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue + = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)( + leftGfx, 0, 600 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx].height); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 912, + 600 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue + = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1280x1024) { + int leftGfx; + DAT_TextureRenderCoreObject::instance.backwardsLoadedGfxIndex_0x16C850 = 99; + DAT_TextureRenderCoreObject::instance.loadedGfxArray[99].backwardsOffsetInBuffer = 0; + if (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST) { + // "edge_military_1280l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1280l_tgx_005a2590); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge_military_1280l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1280l_tgx_005a2590); + } else { + // "edge_military_1280r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1280r_tgx_005a2578); + } + } else { + // "edge1280l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1280l_tgx_005a2378); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge1280l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1280l_tgx_005a2378); + } else { + // "edge1280r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1280r_tgx_005a2408); + } + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + leftGfx, 0, 1024 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx].height); + if ((DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) + && (DAT_GameCore::instance.activeMenuTab.tabType + == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST)) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1024, + 1024 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1040, + 1024 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1600x1200) { + int leftGfx; + DAT_TextureRenderCoreObject::instance.backwardsLoadedGfxIndex_0x16C850 = 99; + DAT_TextureRenderCoreObject::instance.loadedGfxArray[99].backwardsOffsetInBuffer = 0; + if (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST) { + // "edge_military_1600l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1600l_tgx_005a2560); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge_military_1600l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1600l_tgx_005a2560); + } else { + // "edge_military_1600r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1600r_tgx_005a2548); + } + } else { + // "edge1600l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1600l_tgx_005a2368); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge1600l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1600l_tgx_005a2368); + } else { + // "edge1600r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1600r_tgx_005a23f8); + } + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + leftGfx, 0, 1200 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx].height); + if ((DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) + && (DAT_GameCore::instance.activeMenuTab.tabType + == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST)) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1184, + 1200 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1200, + 1200 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1280x720) { + int leftGfx; + DAT_TextureRenderCoreObject::instance.backwardsLoadedGfxIndex_0x16C850 = 99; + DAT_TextureRenderCoreObject::instance.loadedGfxArray[99].backwardsOffsetInBuffer = 0; + if (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST) { + // "edge_military_1280l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1280l_tgx_005a2590); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge_military_1280l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1280l_tgx_005a2590); + } else { + // "edge_military_1280r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1280r_tgx_005a2578); + } + } else { + // "edge1280l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1280l_tgx_005a2378); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge1280l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1280l_tgx_005a2378); + } else { + // "edge1280r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1280r_tgx_005a2408); + } + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + leftGfx, 0, 720 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx].height); + if ((DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) + && (DAT_GameCore::instance.activeMenuTab.tabType + == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST)) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1024, + 720 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1040, + 720 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1440x900) { + int leftGfx; + DAT_TextureRenderCoreObject::instance.backwardsLoadedGfxIndex_0x16C850 = 99; + DAT_TextureRenderCoreObject::instance.loadedGfxArray[99].backwardsOffsetInBuffer = 0; + if (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST) { + // "edge_military_1440l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1440l_tgx_005a2530); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge_military_1440l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1440l_tgx_005a2530); + } else { + // "edge_military_1440r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1440r_tgx_005a2518); + } + } else { + // "edge1440l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1440l_tgx_005a2358); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge1440l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1440l_tgx_005a2358); + } else { + // "edge1440r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1440r_tgx_005a23e8); + } + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + leftGfx, 0, 900 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx].height); + if ((DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) + && (DAT_GameCore::instance.activeMenuTab.tabType + == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST)) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1104, + 900 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1120, + 900 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1920x1080) { + int leftGfx; + DAT_TextureRenderCoreObject::instance.backwardsLoadedGfxIndex_0x16C850 = 99; + DAT_TextureRenderCoreObject::instance.loadedGfxArray[99].backwardsOffsetInBuffer = 0; + if (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST) { + // "edge_military_1920l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1920l_tgx_005a2500); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge_military_1920l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1920l_tgx_005a2500); + } else { + // "edge_military_1920r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1920r_tgx_005a24e8); + } + } else { + // "edge1920l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1920l_tgx_005a2348); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge1920l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1920l_tgx_005a2348); + } else { + // "edge1920r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1920r_tgx_005a23d8); + } + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + leftGfx, 0, 1080 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx].height); + if ((DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) + && (DAT_GameCore::instance.activeMenuTab.tabType + == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST)) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1344, + 1080 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1360, + 1080 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1920x1200) { + int leftGfx; + DAT_TextureRenderCoreObject::instance.backwardsLoadedGfxIndex_0x16C850 = 99; + DAT_TextureRenderCoreObject::instance.loadedGfxArray[99].backwardsOffsetInBuffer = 0; + if (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST) { + // "edge_military_1920l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1920l_tgx_005a2500); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge_military_1920l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1920l_tgx_005a2500); + } else { + // "edge_military_1920r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1920r_tgx_005a24e8); + } + } else { + // "edge1920l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1920l_tgx_005a2348); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge1920l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1920l_tgx_005a2348); + } else { + // "edge1920r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1920r_tgx_005a23d8); + } + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + leftGfx, 0, 1200 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx].height); + if ((DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) + && (DAT_GameCore::instance.activeMenuTab.tabType + == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST)) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1344, + 1200 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1360, + 1200 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_2560x1440) { + int leftGfx; + DAT_TextureRenderCoreObject::instance.backwardsLoadedGfxIndex_0x16C850 = 99; + DAT_TextureRenderCoreObject::instance.loadedGfxArray[99].backwardsOffsetInBuffer = 0; + if (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST) { + // "edge_military_2560l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_2560l_tgx_005a24d0); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge_military_2560l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_2560l_tgx_005a24d0); + } else { + // "edge_military_2560r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_2560r_tgx_005a24b8); + } + } else { + // "edge2560l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge2560l_tgx_005a2338); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge2560l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge2560l_tgx_005a2338); + } else { + // "edge2560r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge2560r_tgx_005a23c8); + } + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + leftGfx, 0, 1440 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx].height); + if ((DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) + && (DAT_GameCore::instance.activeMenuTab.tabType + == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST)) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1664, + 1440 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1680, + 1440 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_2560x1600) { + int leftGfx; + DAT_TextureRenderCoreObject::instance.backwardsLoadedGfxIndex_0x16C850 = 99; + DAT_TextureRenderCoreObject::instance.loadedGfxArray[99].backwardsOffsetInBuffer = 0; + if (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST) { + // "edge_military_2560l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_2560l_tgx_005a24d0); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge_military_2560l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_2560l_tgx_005a24d0); + } else { + // "edge_military_2560r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_2560r_tgx_005a24b8); + } + } else { + // "edge2560l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge2560l_tgx_005a2338); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge2560l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge2560l_tgx_005a2338); + } else { + // "edge2560r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge2560r_tgx_005a23c8); + } + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + leftGfx, 0, 1600 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx].height); + if ((DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) + && (DAT_GameCore::instance.activeMenuTab.tabType + == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST)) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1664, + 1600 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1680, + 1600 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1366x768) { + int leftGfx; + DAT_TextureRenderCoreObject::instance.backwardsLoadedGfxIndex_0x16C850 = 99; + DAT_TextureRenderCoreObject::instance.loadedGfxArray[99].backwardsOffsetInBuffer = 0; + if (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST) { + // "edge_military_1366l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1366l_tgx_005a24a0); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge_military_1366l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1366l_tgx_005a24a0); + } else { + // "edge_military_1366r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1366r_tgx_005a2488); + } + } else { + // "edge1366l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1366l_tgx_005a2328); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge1366l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1366l_tgx_005a2328); + } else { + // "edge1366r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1366r_tgx_005a23b8); + } + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + leftGfx, 0, 768 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx].height); + if ((DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) + && (DAT_GameCore::instance.activeMenuTab.tabType + == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST)) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1066, + 768 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1082, + 768 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1360x768) { + int leftGfx; + DAT_TextureRenderCoreObject::instance.backwardsLoadedGfxIndex_0x16C850 = 99; + DAT_TextureRenderCoreObject::instance.loadedGfxArray[99].backwardsOffsetInBuffer = 0; + if (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST) { + // "edge_military_1360l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1360l_tgx_005a2470); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge_military_1360l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1360l_tgx_005a2470); + } else { + // "edge_military_1360r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1360r_tgx_005a2458); + } + } else { + // "edge1360l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1360l_tgx_005a2318); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge1360l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1360l_tgx_005a2318); + } else { + // "edge1360r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1360r_tgx_005a23a8); + } + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + leftGfx, 0, 768 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx].height); + if ((DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) + && (DAT_GameCore::instance.activeMenuTab.tabType + == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST)) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1064, + 768 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1080, + 768 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1680x1050) { + int leftGfx; + DAT_TextureRenderCoreObject::instance.backwardsLoadedGfxIndex_0x16C850 = 99; + DAT_TextureRenderCoreObject::instance.loadedGfxArray[99].backwardsOffsetInBuffer = 0; + if (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST) { + // "edge_military_1680l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1680l_tgx_005a2440); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge_military_1680l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1680l_tgx_005a2440); + } else { + // "edge_military_1680r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1680r_tgx_005a2428); + } + } else { + // "edge1680l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1680l_tgx_005a2308); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge1680l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1680l_tgx_005a2308); + } else { + // "edge1680r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1680r_tgx_005a2398); + } + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + leftGfx, 0, 1050 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx].height); + if ((DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) + && (DAT_GameCore::instance.activeMenuTab.tabType + == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST)) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1224, + 1050 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1240, + 1050 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1600x900) { + int leftGfx; + DAT_TextureRenderCoreObject::instance.backwardsLoadedGfxIndex_0x16C850 = 99; + DAT_TextureRenderCoreObject::instance.loadedGfxArray[99].backwardsOffsetInBuffer = 0; + if (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST) { + // "edge_military_1600l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1600l_tgx_005a2560); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge_military_1600l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1600l_tgx_005a2560); + } else { + // "edge_military_1600r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge_military_1600r_tgx_005a2548); + } + } else { + // "edge1600l.tgx" + leftGfx = MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1600l_tgx_005a2368); + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + // "edge1600l.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1600l_tgx_005a2368); + } else { + // "edge1600r.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxAtBufferEnd, + DAT_TextureRenderCoreObject::ptr)((char*)s_edge1600r_tgx_005a23f8); + } + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + leftGfx, 0, 900 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx].height); + if ((DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) + && (DAT_GameCore::instance.activeMenuTab.tabType + == OpenSHC::UI::Enums::BASMTT_BARRACKS_OR_MPMENU_MODEM + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_MERCENARYPOST)) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1184, + 900 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, + DAT_TextureRenderCoreObject::ptr)(leftGfx - 1, 1200, + 900 - DAT_TextureRenderCoreObject::instance.loadedGfxArray[leftGfx - 1].height); + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index b62540e14f..1f8c616206 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -13391,7 +13391,7 @@ SHC_3BB0A8C1_0x00439730 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00439890 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004398B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004398B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0043A850 | 100.0% | Reimplemented From c28ad52031a8cabf78263fce8527e5504db5e738 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 11:19:43 +0100 Subject: [PATCH 2/3] reimplement: SHC_3BB0A8C1_0x004261E0 100.0% Reimplemented Credits::MenuView_Credits_Prepare, from gynt's draft on his fork's reimpl/UI-MenuViews-development (his scored commit on the file is 458bcd5d8 at 80.00%, and the branch's status line records 82.1% since 71e725a06; the newest commit on the file, 029533228, is on his reimpl/UI-MenuItems-development), through our draft 3480be06c (82.1%, his code in main's style, in the draft PR #356). One change: each arm of the test empties the list of loaded pictures itself (totalLoadedGfx = 0), where the draft had one store in front of the test. The original keeps 0 in edi for the whole function (xor edi, edi at 0x004261E2, six uses) and saves esi and edi at the start. With one store our compiler used the immediate 0 everywhere and saved esi only in front of its first use. With the store in each arm it keeps 0 in edi, and the two stores still come out as one, between the compare and the jump (0x004261EA), where the single store stood too. Presumably the compiler counts the uses of 0 before it merges the two stores. Measured: reccmp 100.0% (normalized 100.0%) alone, data resolvers and its own resolver on. Not run in game. The text against the draft: the string pointers have their texts as comments. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../Credits/MenuView_Credits_Prepare.cpp | 70 +++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_Prepare.cpp diff --git a/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_Prepare.cpp b/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_Prepare.cpp new file mode 100644 index 0000000000..c81e833702 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_Prepare.cpp @@ -0,0 +1,70 @@ +#include "../Credits.func.hpp" + +#include "OpenSHC/Text/TextEditorState.func.hpp" +#include "OpenSHC/UI/Helpers.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_00b95b3c.hpp" +#include "OpenSHC/Globals/DAT_00b95b70.hpp" +#include "OpenSHC/Globals/DAT_00b9610c.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" +#include "OpenSHC/Globals/INT_00b95954.hpp" +#include "OpenSHC/Globals/INT_00b960d0.hpp" +#include "OpenSHC/Globals/INT_00b960d4.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + namespace Credits { + + // FUNCTION: STRONGHOLDCRUSADER 0x004261E0 + void MenuView_Credits_Prepare() + { + if (INT_00b95954::instance == 0) { + // each arm resets the loaded pictures itself (one store in front of the test loses the match) + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "credits_1.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_credits_1_tgx_005a20e8); + // "credits_2.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_credits_2_tgx_005a20d8); + // "credits_3.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_credits_3_tgx_005a20c8); + // "credits_4.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_credits_4_tgx_005a20b8); + } else { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "end_credit.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_end_credit_tgx_005a20a8); + } + // "credits.hlp" + MACRO_CALL_MEMBER( + OpenSHC::Text::TextEditorState_Func::openCreditsScrollDialog, DAT_TextEditorState::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextEditorState_Func::findOrAddHelpSectionName, + DAT_TextEditorState::ptr)((char*)s_credits_hlp_005a209c)); + DAT_TextEditorState::instance.helpContentScrollOffsetY = -600; + DAT_00b95b3c::instance = 0; + INT_00b960d0::instance = timeGetTime(); + DAT_00b95b70::instance = 0; + DAT_00b9610c::instance = 1; + MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); + INT_00b960d4::instance = timeGetTime(); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, + DAT_PencilRenderCore::ptr)(0, 0, DAT_WindowAndDirectDraw::instance.resolutionX, + DAT_WindowAndDirectDraw::instance.resolutionY, COL_BLACK::instance.shortValue); + } + + } + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 1f8c616206..62d91d7878 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6759,7 +6759,7 @@ SHC_3BB0A8C1_0x00425FF0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00426060 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004261E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004261E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004262B0 | 100.0% | Reimplemented From d93e88d24ea54c7aeb67eb800897454108dd68a7 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 11:19:43 +0100 Subject: [PATCH 3/3] reimplement: SHC_3BB0A8C1_0x004B2820 100.0% Reimplemented MenuModalComposition::activateModalDialog2, from gynt's drafts: 06829d84a at 53.6% on sourcehold's reimpl/UI-Core; b1c48adcd at 50.64% and 10280b161, whose status line records 53.7%, on his fork's reimpl/UI-Core-development; the newest commit on the file, 1eaeddd95, is on his reimpl/UI-MenuItems-development. Through our draft 950e83ebd (82.7%, in the draft PR #313). What was left: our compiler kept a zero in esi for the whole function (xor esi, esi at the start and again behind the copy of the modal), where the original compares with and stores the immediate 0 and saves esi only around that copy. The last block decided it. It had the result of getAreWeInAInGameMenu and the dialog's x and y in locals in front of the test. Now the call is tested directly and each arm has its own x and y. The original loads y and x between the call's test and the jump (0x004B29F2 to 0x004B29FA), which is where the compiler puts loads that both arms start with, and tests the result with test eax, eax. With that form no zero register is left. Checked against the binary: the function returns when the next stored AI lord message starts playing (jne at 0x004B2854), and in game it blits only the map surface's rectangle (the two blits are the arms of one test, each followed by its own end, 0x004B2A2A and 0x004B2A4D). All four of gynt's versions of the file (06829d84a, 8ca78619c, 10280b161, 1eaeddd95) go on from the in-game blit to the menu surface's blit, and 10280b161 and 1eaeddd95 have an empty if where the first return is. Our draft 950e83ebd had both right already. Measured: quick_diff 0.9895 with 191 instructions on both sides (what differs is how the two listings print a rep movsd and an import call); reccmp 100.0% (normalized 100.0%) alone, data resolvers and its own resolver on. Not run in game. The text against the draft: the unused BOOLEnum using and include are gone; the border style masks are written in decimal, (32 | 512) for the two tiled styles and 1024, as the bits have no names yet; the imported note on the copy is gone, as in main's activateModalDialog. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../activateModalDialog2.cpp | 102 ++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuModalComposition/activateModalDialog2.cpp diff --git a/src/OpenSHC/UI/MenuModalComposition/activateModalDialog2.cpp b/src/OpenSHC/UI/MenuModalComposition/activateModalDialog2.cpp new file mode 100644 index 0000000000..b25a40b5d5 --- /dev/null +++ b/src/OpenSHC/UI/MenuModalComposition/activateModalDialog2.cpp @@ -0,0 +1,102 @@ +#include "../MenuModalComposition.func.hpp" + +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/Rendering/Bink/AIMessageQueue.func.hpp" +#include "OpenSHC/UI/MenuTextInputState.func.hpp" +#include "OpenSHC/UI/Rendering/WindowAndDirectDraw.func.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_VideoBikQueue.hpp" +#include "OpenSHC/Globals/DAT_ViewportRenderState.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/DWORD_00df5534.hpp" + +namespace OpenSHC { +namespace UI { + + using OpenSHC::UI::Enums::MenuModalType; + + // FUNCTION: STRONGHOLDCRUSADER 0x004B2820 + void MenuModalComposition::activateModalDialog2(MenuModalType modalDialogID) + { + if (this->slot == 0 && DAT_MenuTextInputState::instance.currentModalDialog != OpenSHC::UI::Enums::MMT_NO_MENU) { + MACRO_CALL_MEMBER( + OpenSHC::UI::MenuTextInputState_Func::clearAnyOtherModalDialogs, DAT_MenuTextInputState::ptr)(); + } + if (this->activeModalDialogID == OpenSHC::UI::Enums::MMT_DISPLAY_AI_LORD_MESSAGE) { + this->activeModalDialogID = OpenSHC::UI::Enums::MMT_NONE; + if (MACRO_CALL_MEMBER( + OpenSHC::Rendering::Bink::AIMessageQueue_Func::playNextStoredAIMessage, DAT_VideoBikQueue::ptr)()) { + return; + } + } + this->activeModalDialogID = modalDialogID; + if (modalDialogID != OpenSHC::UI::Enums::MMT_NONE) { + memcpy(&this->modalMenu, + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::findModalMenu, this)(modalDialogID), + sizeof(MenuModal)); + } + this->modalDragDropUnk = 0; + if ((this->modalMenu.borderStyle & (32 | 512)) != 0) { + // tiled frames come in whole 24x24 tiles + this->modalMenu.width = ((this->modalMenu.width - 1) / 24 + 1) * 24; + this->modalMenu.height = ((this->modalMenu.height - 1) / 24 + 1) * 24; + } + if (MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::getAreWeInAInGameMenu, DAT_GameCore::ptr)()) { + if (this->modalMenu.x == -1) { + this->modalMenu.x = DAT_WindowAndDirectDraw::instance.gameResolutionX / 2 - this->modalMenu.width / 2; + } else { + this->modalMenu.x += (DAT_WindowAndDirectDraw::instance.gameResolutionX - 800) / 2; + } + if (this->modalMenu.y == -1) { + // centred over the map, above the 128 pixel high menu bar + this->modalMenu.y + = (DAT_WindowAndDirectDraw::instance.gameResolutionY - 128) / 2 - this->modalMenu.height / 2; + } else { + this->modalMenu.y += (DAT_WindowAndDirectDraw::instance.gameResolutionY - 600) / 2; + } + } else { + if (this->modalMenu.x == -1) { + this->modalMenu.x = DAT_WindowAndDirectDraw::instance.gameResolutionX / 2 - this->modalMenu.width / 2; + } else { + this->modalMenu.x += (DAT_WindowAndDirectDraw::instance.gameResolutionX - 800) / 2; + } + if (this->modalMenu.y == -1) { + this->modalMenu.y = DAT_WindowAndDirectDraw::instance.gameResolutionY / 2 - this->modalMenu.height / 2; + } else { + this->modalMenu.y += (DAT_WindowAndDirectDraw::instance.gameResolutionY - 600) / 2; + } + } + this->disappearAfter = 32; + this->mbr_0x6c = 0; + this->timeItIsSet = timeGetTime(); + if ((this->modalMenu.borderStyle & 1024) != 0) { + this->disappearAfter = 0; + } + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::renderMenuModal, this)(); + if (30 < (int)(this->timeItIsSet - DWORD_00df5534::instance)) { + DWORD_00df5534::instance = this->timeItIsSet; + // show the dialog right away: blit its rectangle to the screen. The call is tested directly and + // each arm has its own x and y (with locals in front of the test, the match is lost) + if (MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::getAreWeInAInGameMenu, DAT_GameCore::ptr)()) { + int const x = this->modalMenu.x + DAT_ViewportRenderState::instance.viewportState.currentCameraOffsetX; + int const y = this->modalMenu.y + DAT_ViewportRenderState::instance.viewportState.currentCameraOffsetY; + DAT_PencilRenderCore::instance.surfaceTarget = OpenSHC::Rendering::Enums::RT_MAP_GAME; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::WindowAndDirectDraw_Func::bltMapGameSurfaceToScreen, + DAT_WindowAndDirectDraw::ptr)(x, y, this->modalMenu.width + x, this->modalMenu.height + y); + } else { + int const x = this->modalMenu.x; + int const y = this->modalMenu.y; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::WindowAndDirectDraw_Func::bltScreenMenuSurfaceToScreen, + DAT_WindowAndDirectDraw::ptr)(x, y, this->modalMenu.width + x, this->modalMenu.height + y); + } + } + this->activeModalDialogID = OpenSHC::UI::Enums::MMT_NONE; + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 62d91d7878..1d2fd5c8e6 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -26007,7 +26007,7 @@ SHC_3BB0A8C1_0x004B2280 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B2530 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004B2820 | 0.0% | Pending +SHC_3BB0A8C1_0x004B2820 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B2A60 | 100.0% | Reimplemented