From 707c3d840d386430183df3bd00a937bd8a253c87 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 13:00:52 +0100 Subject: [PATCH 1/2] reimplement: SHC_3BB0A8C1_0x004AAB50 100.0% Reimplemented CreditsScroll::MenuModalRenderFunction_CreditsScroll, rewritten from the original's listing. gynt's drafts: a4ce8c208 at 37.8% on sourcehold's reimpl/UI-MenuModals and 934219cbe at 40.84% ("allocator only") on his fork's reimpl/UI-MenuModals-development; the newest commit on the file, 1eaeddd95, is on his fork's reimpl/UI-MenuItems-development. Our draft be9edd1fd (41.0%, in the draft PR #360) was his code, not reworked. The drafts had the decompiler's text: 21 counters in locals, each stepped by hand, and all of it twice. The listing shows what they are. The scroll fades to black towards its top and bottom edge over 30 rows of four pixels, each row over its 20 leftmost columns, and the blend of column c in row r is (r - 30) * (c + 1) / 20 + 32. Written that way, with the row as the only variable, the compiler makes the same counters by itself, down to the one it does not make: column 3's product 4 * (r - 30) comes from the row's y, which also steps by four (mov edx, [esp + 0x60]; lea ecx, [edx + esi] at 0x004AACAA). Three things the match needs: - Each column is its own call. As a loop over the columns the compiler keeps the loop (102 instructions against 709), so the 20 calls are written out. - The first column is 32 - (30 - r) / 20, not (r - 30) / 20 + 32. The original keeps 30 - r as a counter of its own for it (0x004AAC27, used at 0x004AAC38) and leaves the loop by the second column's counter (0x004AAFD5). With the first column in the others' form the compiler has no such counter and ends the loop by counting down (700 instructions). - One row variable for both loops. The original has both loops' row counter in [esp + 0x10]; with a counter of its own in each loop, the second loop's 20 counters land one slot off (reccmp 91.4%). Measured: quick_diff 1.0000 with 709 instructions on both sides, also with the stack slots kept; reccmp 100.0% (normalized 100.0%) alone, data resolvers and its own resolver on. Not run in game. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- .../MenuModalRenderFunction_CreditsScroll.cpp | 123 ++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/MenuModals/CreditsScroll/MenuModalRenderFunction_CreditsScroll.cpp diff --git a/src/OpenSHC/UI/MenuModals/CreditsScroll/MenuModalRenderFunction_CreditsScroll.cpp b/src/OpenSHC/UI/MenuModals/CreditsScroll/MenuModalRenderFunction_CreditsScroll.cpp new file mode 100644 index 0000000000..c9cb3c5786 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/CreditsScroll/MenuModalRenderFunction_CreditsScroll.cpp @@ -0,0 +1,123 @@ +#include "../CreditsScroll.func.hpp" + +#include "OpenSHC/Text/TextEditorState.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextEditorState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AAB50 + void CreditsScroll::MenuModalRenderFunction_CreditsScroll(int x, int y, int width, int height) + { + if (!DAT_TextEditorState::instance.pendingCreditsFadeBorder) { + return; + } + DAT_TextEditorState::instance.pendingCreditsFadeBorder = FALSE; + MACRO_CALL_MEMBER(OpenSHC::Text::TextEditorState_Func::setTextRenderingLogic, DAT_TextEditorState::ptr)(); + // one row counter for both edges (with a counter of its own in each loop, the match is lost) + int row; + // the top edge fades to black over 30 rows of four pixels, and each row over its 20 leftmost columns + for (row = 0; row < 30; ++row) { + int const rowY = y + row * 4; + // every column is its own call, and the first one divides the other way round (a loop over the + // columns, or the first column in the others' form, loses the match) + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x, rowY, x, rowY + 3, 32 - (30 - row) / 20); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 1, rowY, x + 1, rowY + 3, (row - 30) * 2 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 2, rowY, x + 2, rowY + 3, (row - 30) * 3 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 3, rowY, x + 3, rowY + 3, (row - 30) * 4 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 4, rowY, x + 4, rowY + 3, (row - 30) * 5 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 5, rowY, x + 5, rowY + 3, (row - 30) * 6 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 6, rowY, x + 6, rowY + 3, (row - 30) * 7 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 7, rowY, x + 7, rowY + 3, (row - 30) * 8 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 8, rowY, x + 8, rowY + 3, (row - 30) * 9 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 9, rowY, x + 9, rowY + 3, (row - 30) * 10 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 10, rowY, x + 10, rowY + 3, (row - 30) * 11 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 11, rowY, x + 11, rowY + 3, (row - 30) * 12 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 12, rowY, x + 12, rowY + 3, (row - 30) * 13 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 13, rowY, x + 13, rowY + 3, (row - 30) * 14 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 14, rowY, x + 14, rowY + 3, (row - 30) * 15 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 15, rowY, x + 15, rowY + 3, (row - 30) * 16 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 16, rowY, x + 16, rowY + 3, (row - 30) * 17 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 17, rowY, x + 17, rowY + 3, (row - 30) * 18 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 18, rowY, x + 18, rowY + 3, (row - 30) * 19 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 19, rowY, x + 19, rowY + 3, (row - 30) * 20 / 20 + 32); + // the rest of the row, one step darker per row + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 20, rowY, x + width - 1, rowY + 3, row + 2); + } + // the bottom edge, the same from the bottom up + for (row = 0; row < 30; ++row) { + int const rowY = y + height - row * 4; + // (written out for the same reason as above) + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x, rowY, x, rowY + 3, 32 - (30 - row) / 20); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 1, rowY, x + 1, rowY + 3, (row - 30) * 2 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 2, rowY, x + 2, rowY + 3, (row - 30) * 3 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 3, rowY, x + 3, rowY + 3, (row - 30) * 4 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 4, rowY, x + 4, rowY + 3, (row - 30) * 5 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 5, rowY, x + 5, rowY + 3, (row - 30) * 6 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 6, rowY, x + 6, rowY + 3, (row - 30) * 7 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 7, rowY, x + 7, rowY + 3, (row - 30) * 8 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 8, rowY, x + 8, rowY + 3, (row - 30) * 9 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 9, rowY, x + 9, rowY + 3, (row - 30) * 10 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 10, rowY, x + 10, rowY + 3, (row - 30) * 11 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 11, rowY, x + 11, rowY + 3, (row - 30) * 12 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 12, rowY, x + 12, rowY + 3, (row - 30) * 13 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 13, rowY, x + 13, rowY + 3, (row - 30) * 14 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 14, rowY, x + 14, rowY + 3, (row - 30) * 15 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 15, rowY, x + 15, rowY + 3, (row - 30) * 16 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 16, rowY, x + 16, rowY + 3, (row - 30) * 17 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 17, rowY, x + 17, rowY + 3, (row - 30) * 18 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 18, rowY, x + 18, rowY + 3, (row - 30) * 19 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 19, rowY, x + 19, rowY + 3, (row - 30) * 20 / 20 + 32); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(x + 20, rowY, x + width - 1, rowY + 3, row + 2); + } + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index b62540e14f..2f5892e62c 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -25537,7 +25537,7 @@ SHC_3BB0A8C1_0x004AAB20 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AAB40 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AAB50 | 0.0% | Pending +SHC_3BB0A8C1_0x004AAB50 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AB440 | 100.0% | Reimplemented From 015b79f74108e87399d961faa7b8fa9e9601a5ad Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 20 Nov 2026 15:01:14 +0100 Subject: [PATCH 2/2] reimplement: SHC_3BB0A8C1_0x004AFB30 100.0% Reimplemented DisplayElements::RenderInGameWinDefeatWindowDisplayElement, rewritten from the original's listing. gynt's drafts are on his fork's reimpl/UI-DisplayElements-pr-development: 3c85538c3 at 65.16%, 7648a6d85 at 76.62% and 7a4656b79 at 80.97%, which the branch's status line records as 81.0% (158fe8df1 at 87.80% was reverted in 94926b6ae; ff0d33f74 is the newest commit on the file there). Our draft d0fbcd579 (82.0%, in the draft PR #360) was his code. The drafts walked three pointers through the players' arrays and kept the window's y in a second variable, as the decompiler shows it. Written with the arrays indexed by the player and the y parameter itself counted on, the compiler makes the same three pointers, and four differences go: - The window's y. posY += -28 - height / 2, with posY used from there on, gives the original's mov edx, -28; sub edx, eax; add esi, edx (0x004AFC25). With the sum in a variable of its own the compiler folded it into two subtractions, in every form. - The loop over the players ends at the array's length, player < countof(playerIsAlive), which is 9 (the jl at 0x004AFD7D, behind a compare with the array's end, 0x0117EF52). - The count of the players alive is a loop as well; the compiler unrolls it into the original's eight tests. - "Wins" behind each name: its colour and its x are locals in front of the call, the colour first. The original loads the colour and works out x where the call's pushes begin (0x004AFCE1 to 0x004AFCF8). Written in the call, x was finished behind the pushes and in another register. The security cookie: the original has one, and an 8-byte frame (the cookie and the players' pointer), so its source had a buffer whose address was taken. Nothing reads it, so `char unused[8]; char* unusedPointer = unused;` is a guess at its type and length. An unused array alone gets no cookie. gynt's 7a4656b79 found the cookie first, with a ushort[3] whose address went into the loop's pointer; our draft d0fbcd579 had made that a short[3]. Measured: quick_diff 0.9893 with 187 instructions on both sides (what differs is how the two listings print the cookie's address and an import call); reccmp 100.0% (normalized 100.0%) alone, data resolvers and its own resolver on. Not run in game. Co-authored-by: Gynt Co-Authored-By: Claude Fable 5.2 --- ...derInGameWinDefeatWindowDisplayElement.cpp | 118 ++++++++++++++++++ status/addresses-SHC-3BB0A8C1.txt | 2 +- 2 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 src/OpenSHC/UI/DisplayElements/RenderInGameWinDefeatWindowDisplayElement.cpp diff --git a/src/OpenSHC/UI/DisplayElements/RenderInGameWinDefeatWindowDisplayElement.cpp b/src/OpenSHC/UI/DisplayElements/RenderInGameWinDefeatWindowDisplayElement.cpp new file mode 100644 index 0000000000..c1810dae87 --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/RenderInGameWinDefeatWindowDisplayElement.cpp @@ -0,0 +1,118 @@ +#include "../DisplayElements.func.hpp" + +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/Text/GameLanguage.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" + +#include "OpenSHC/Globals/DAT_BlendingDefinedData.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_RenderingDefinedData.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AFB30 + void DisplayElements::RenderInGameWinDefeatWindowDisplayElement(int posX, int posY, DWORD elementState) + { + // the original has a security cookie, so its source had a buffer here whose address was taken; nothing + // reads it, so its type and length are a guess + char unused[8]; + char* unusedPointer = unused; + // eight seconds after the game is over, on to the next screen + if (8000 < timeGetTime() - DAT_GameState::instance.mapAndTime.gameOverTime) { + if (DAT_GameState::instance.mapAndTime.playerIsAlive[DAT_GameSynchronyState::instance.currentPlayerSlotID] + != 0) { + DAT_GameCore::instance.isVictoryOrDefeatUnk = 0; + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_MISSION_FINISHED_TRANSITION, 0); + } else { + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_GAME_LOSTUnk, 0); + } + } + // the window is as high as the list of the players still alive, in whole steps of 30 + int players = 0; + for (int player = 1; player < countof(DAT_GameState::instance.mapAndTime.playerIsAlive); ++player) { + if (DAT_GameState::instance.mapAndTime.playerIsAlive[player] != 0) { + ++players; + } + } + DAT_PencilRenderCore::instance.surfaceTarget = OpenSHC::Rendering::Enums::RT_MAP_GAME; + int height = players * 30 - 6; + height += 29 - (height + 29) % 30; + posY += -28 - height / 2; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBorderedBoxWithBlendedBackground, + DAT_PencilRenderCore::ptr)(posX - 264, posY - 19, 528, height + 96); + DAT_PencilRenderCore::instance.surfaceTarget = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + if (DAT_GameState::instance.mapAndTime.playerIsAlive[DAT_GameSynchronyState::instance.currentPlayerSlotID] + != 0) { + // "Victory" + 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_MAINOPTIONS, 16), + posX, posY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_C2F0EB, 15, FALSE, 0); + } else { + // "Defeat" + 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_MAINOPTIONS, 17), + posX, posY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_C2F0EB, 15, FALSE, 0); + } + // each player still alive: the name in the player's colour and "Wins" behind it + posY += 57; + for (int player = 1; player < countof(DAT_GameState::instance.mapAndTime.playerIsAlive); ++player) { + if (DAT_GameState::instance.mapAndTime.playerIsAlive[player] != 0) { + if (DAT_TextManagerObject::instance.gameLanguage == OpenSHC::Text::GL_ENGLISH + || DAT_TextManagerObject::instance.gameLanguage == OpenSHC::Text::GL_AMERICAN) { + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderInGameTextWithShadow, + DAT_TextManagerObject::ptr)(DAT_GameSynchronyState::instance.DAT_PlayerNames[player], posX - 28, + posY, OpenSHC::Text::TTA_CENTER, + DAT_RenderingDefinedData::instance + .ColorArray[DAT_BlendingDefinedData::instance.PlayerSlotUnitColor[player]], + 0, 17, FALSE, 0); + // the colour, then x, in locals in front of the call (in the call, or x first, loses the match) + uint const winsColor + = DAT_RenderingDefinedData::instance + .ColorArray[DAT_BlendingDefinedData::instance.PlayerSlotUnitColor[player]]; + int const winsX = DAT_TextManagerObject::instance.currentXOffset_0x0 / 2 - 22 + posX; + // "Wins" + MACRO_CALL_MEMBER( + OpenSHC::Text::TextManager_Func::renderInGameTextWithShadow, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_XPLAY_WAITING_ROOM, 64), + winsX, posY, OpenSHC::Text::TTA_LEFT, winsColor, 0, 17, FALSE, 0); + } else { + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderInGameTextWithShadow, + DAT_TextManagerObject::ptr)(DAT_GameSynchronyState::instance.DAT_PlayerNames[player], posX - 78, + posY, OpenSHC::Text::TTA_CENTER, + DAT_RenderingDefinedData::instance + .ColorArray[DAT_BlendingDefinedData::instance.PlayerSlotUnitColor[player]], + 0, 18, FALSE, 0); + uint const winsColor + = DAT_RenderingDefinedData::instance + .ColorArray[DAT_BlendingDefinedData::instance.PlayerSlotUnitColor[player]]; + int const winsX = DAT_TextManagerObject::instance.currentXOffset_0x0 / 2 - 72 + posX; + // "Wins" + MACRO_CALL_MEMBER( + OpenSHC::Text::TextManager_Func::renderInGameTextWithShadow, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_XPLAY_WAITING_ROOM, 64), + winsX, posY, OpenSHC::Text::TTA_LEFT, winsColor, 0, 18, FALSE, 0); + } + posY += 30; + } + } + } + +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index 2f5892e62c..ac38a1bccc 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -25929,7 +25929,7 @@ SHC_3BB0A8C1_0x004AFA80 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AFB00 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AFB30 | 0.0% | Pending +SHC_3BB0A8C1_0x004AFB30 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AFDA0 | 100.0% | Reimplemented