From 3ff64a1b08da38adc0c79def6a5a0aafabf02c59 Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 6 Nov 2026 09:29:02 +0100 Subject: [PATCH 1/2] fix: names and types after the Ghidra header syncs The Ghidra header syncs a9401a727 and d972299d0 renamed or retyped fields, globals and parameters that 15 reimplemented files still use in their old form, so those files no longer compile once they are in the build list (main's committed list is empty, so CI does not see it). This follows a9401a727 (and d972299d0 for the last file): each old name becomes the name at the same address in the current header, an array that became a scalar loses its [0], and a parameter that became an enum gets the header's type or a cast. No header changes and no behaviour changes. With these, a full build of every reimplemented file compiles and links. PlayerData: counter -> availableCows (a9401a727) - AI/AICState/yieldCowThrow.cpp - Game/GameStateStructures/migrateGameStateForMapVersion.cpp - Map/Buildings/UpdateFireBallistaBuilding.cpp GameSynchronyState: someIndex -> selectedCommandsCount (a9401a727) - Synchrony/GameSynchronyState/processWaitingCommands.cpp Helpers::CheckGoldResource: int parameter -> UnitType, as the header now declares it (a9401a727) - UI/Helpers/CheckGoldResource.cpp: the definition takes UnitType - UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_TunnelerPortrait.cpp: the int button parameter is cast to Map::Units::UnitType at the call (plus the UnitType.hpp include) MenuTextInputState: DAT_ArrayOfMapU3EndInt2[501] -> int DAT_ArrayOfMapU3EndInt2, so [0] -> no index (a9401a727) - UI/MenuItems/SaveLoadMap/MenuItemActionHandler_SaveLoadMap_Buttons.cpp - UI/MenuTextInputState/loadOrSaveMap.cpp - UI/MenuTextInputState/activateLoadOrSaveMapUI.cpp, which also takes MenuModalType for its int parameter, as the header now declares activateLoadOrSaveMapUI Globals (a9401a727; include lines re-sorted by clang-format): - DAT_00b95b74 -> INT_00b95b74: UI/Rendering/DisplayMapDescriptionAndAllocatePlayersToSlots.cpp - DAT_00df3350 -> INT_00df3350: UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Min1.cpp (which now stores -1 for 0xffffffff, since the global is an int), UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_BarracksWeaponAvailability.cpp - DAT_00df5554 -> INT_00df5554: UI/MenuItems/TutorialBox/MenuItemActionHandler_TutorialBox_Main.cpp - INT_DisableTutorialRestrictions -> DAT_DisableTutorialRestrictions: UI/MenuItems/TutorialBox/MenuItemActionHandler_TutorialBox_Main.cpp, UI/Helpers/UpdateTutorialStepAndProgress.cpp TribesState::spawnUnitsAroundLocation: undefined4 param_1 -> AITribeType tribeType (d972299d0) - Game/GameStateStructures/handleActivateTacticalPowers.cpp: the literal 1 is cast to AI::Tribes::AITribeType, which has no constant for 1 (plus the AITribeType.hpp include) Co-Authored-By: Claude Opus 5.5 --- src/OpenSHC/AI/AICState/yieldCowThrow.cpp | 2 +- .../handleActivateTacticalPowers.cpp | 3 ++- .../migrateGameStateForMapVersion.cpp | 6 +++--- .../Map/Buildings/UpdateFireBallistaBuilding.cpp | 2 +- .../GameSynchronyState/processWaitingCommands.cpp | 4 ++-- src/OpenSHC/UI/Helpers/CheckGoldResource.cpp | 2 +- .../UI/Helpers/UpdateTutorialStepAndProgress.cpp | 8 ++++---- ...ionHandler_BuildingAndStatusMenu_Unknown_Min1.cpp | 4 ++-- ...ldingAndStatusMenu_BarracksWeaponAvailability.cpp | 12 ++++++------ ...nction_BuildingAndStatusMenu_TunnelerPortrait.cpp | 3 ++- .../MenuItemActionHandler_SaveLoadMap_Buttons.cpp | 2 +- .../MenuItemActionHandler_TutorialBox_Main.cpp | 8 ++++---- .../MenuTextInputState/activateLoadOrSaveMapUI.cpp | 4 ++-- src/OpenSHC/UI/MenuTextInputState/loadOrSaveMap.cpp | 2 +- ...isplayMapDescriptionAndAllocatePlayersToSlots.cpp | 8 ++++---- 15 files changed, 36 insertions(+), 34 deletions(-) diff --git a/src/OpenSHC/AI/AICState/yieldCowThrow.cpp b/src/OpenSHC/AI/AICState/yieldCowThrow.cpp index 5129c6cc1d..fe6800d078 100644 --- a/src/OpenSHC/AI/AICState/yieldCowThrow.cpp +++ b/src/OpenSHC/AI/AICState/yieldCowThrow.cpp @@ -15,7 +15,7 @@ namespace AI { int const aicIndex = aiType - 1; if (DAT_GameState::instance.mapAndTime.skirmishNoCowThrowing == 0 && this->aics[aicIndex].CowThrowInterval != 0 - && DAT_GameState::instance.playerDataArray[playerID].counter > 0) { + && DAT_GameState::instance.playerDataArray[playerID].availableCows > 0) { DAT_GameState::instance.playerDataArray[playerID].aiCowThrowCounter++; if (DAT_GameState::instance.playerDataArray[playerID].aiCowThrowCounter > this->aics[aicIndex].CowThrowInterval) { diff --git a/src/OpenSHC/Game/GameStateStructures/handleActivateTacticalPowers.cpp b/src/OpenSHC/Game/GameStateStructures/handleActivateTacticalPowers.cpp index 96fc464bc3..c02d8ae696 100644 --- a/src/OpenSHC/Game/GameStateStructures/handleActivateTacticalPowers.cpp +++ b/src/OpenSHC/Game/GameStateStructures/handleActivateTacticalPowers.cpp @@ -4,6 +4,7 @@ #include "OpenSHC/Map/Navigation/PathFindingState.func.hpp" #include "OpenSHC/Map/Units/TribesState.func.hpp" #include "OpenSHC/Random/RNG.func.hpp" +#include "OpenSHC/AI/Tribes/AITribeType.hpp" #include "OpenSHC/Audio/SFX/SoundEffectID.hpp" #include "OpenSHC/Map/Units/Behavior/UnitStanceEnum.hpp" #include "OpenSHC/Map/Units/UnitType.hpp" @@ -64,7 +65,7 @@ namespace Game { int const y = DAT_ViewportRenderState::instance.tileTranslationMatrix_YComponent[tile]; int const x = tile - DAT_ViewportRenderState::instance.translationMatrix[y].addXgetTile; dword const tribeID = MACRO_CALL_MEMBER(Map::Units::TribesState_Func::spawnUnitsAroundLocation, - DAT_TribesState::ptr)(1, x, y, playerID, unitType, unitCount); + DAT_TribesState::ptr)((AI::Tribes::AITribeType)1, x, y, playerID, unitType, unitCount); if ((int)tribeID > 0) { DAT_TribesState::instance.tribes[tribeID].unitStance = Map::Units::Behavior::USE_AGGRESSIVE; } diff --git a/src/OpenSHC/Game/GameStateStructures/migrateGameStateForMapVersion.cpp b/src/OpenSHC/Game/GameStateStructures/migrateGameStateForMapVersion.cpp index 7e38fb9418..9da562dec9 100644 --- a/src/OpenSHC/Game/GameStateStructures/migrateGameStateForMapVersion.cpp +++ b/src/OpenSHC/Game/GameStateStructures/migrateGameStateForMapVersion.cpp @@ -94,7 +94,7 @@ namespace Game { if (receivedMapVersion < 139) { for (int playerID = 1; playerID < 9; ++playerID) { int cowCount = 0; - DAT_GameState::instance.playerDataArray[playerID].counter = 0; + DAT_GameState::instance.playerDataArray[playerID].availableCows = 0; int siegeEngineCount = 0; for (int unitID = 1; unitID < 2500; ++unitID) { if (DAT_UnitsState::instance.units[unitID].logicalState != Map::Units::ULS_INVISIBLE @@ -113,9 +113,9 @@ namespace Game { .buildingEntryInfos[Player::Enums::BEIE_KEEP] .id != 0) { - DAT_GameState::instance.playerDataArray[playerID].counter = cowCount; + DAT_GameState::instance.playerDataArray[playerID].availableCows = cowCount; } else { - DAT_GameState::instance.playerDataArray[playerID].counter = siegeEngineCount; + DAT_GameState::instance.playerDataArray[playerID].availableCows = siegeEngineCount; } } } diff --git a/src/OpenSHC/Map/Buildings/UpdateFireBallistaBuilding.cpp b/src/OpenSHC/Map/Buildings/UpdateFireBallistaBuilding.cpp index 49898ae79a..1d09816a45 100644 --- a/src/OpenSHC/Map/Buildings/UpdateFireBallistaBuilding.cpp +++ b/src/OpenSHC/Map/Buildings/UpdateFireBallistaBuilding.cpp @@ -131,7 +131,7 @@ namespace Map { .buildingEntryInfos[OpenSHC::Game::Player::Enums::BEIE_KEEP] .id == 0) { - DAT_GameState::instance.playerDataArray[owner].counter += 2; + DAT_GameState::instance.playerDataArray[owner].availableCows += 2; } } // AI tribe type 24 and unit logic state 5 have no constants. diff --git a/src/OpenSHC/Synchrony/GameSynchronyState/processWaitingCommands.cpp b/src/OpenSHC/Synchrony/GameSynchronyState/processWaitingCommands.cpp index 6699cf1631..b0582911a6 100644 --- a/src/OpenSHC/Synchrony/GameSynchronyState/processWaitingCommands.cpp +++ b/src/OpenSHC/Synchrony/GameSynchronyState/processWaitingCommands.cpp @@ -16,9 +16,9 @@ namespace Synchrony { { int _gameCommandID = MACRO_CALL_MEMBER(Synchrony::GameSynchronyState_Func::getCommandIDFromCommandSelectionStuff, this)(); - if ((_gameCommandID) && (_gameCommandID = 0, 0 < this->someIndex)) { + if ((_gameCommandID) && (_gameCommandID = 0, 0 < this->selectedCommandsCount)) { int (*_selected)[2] = this->selectedGameCommands; - while (_gameCommandID < this->someIndex) { + while (_gameCommandID < this->selectedCommandsCount) { // process all commands that should have been executed by now. // Measured: indexing selectedGameCommands per iteration instead of walking // _selected costs the match, so the pointer stays. diff --git a/src/OpenSHC/UI/Helpers/CheckGoldResource.cpp b/src/OpenSHC/UI/Helpers/CheckGoldResource.cpp index 66b2125ef3..cfcd88c307 100644 --- a/src/OpenSHC/UI/Helpers/CheckGoldResource.cpp +++ b/src/OpenSHC/UI/Helpers/CheckGoldResource.cpp @@ -10,7 +10,7 @@ namespace UI { using OpenSHC::WindowsHelper::Enums::BOOLEnum; // FUNCTION: STRONGHOLDCRUSADER 0x004650C0 - BOOLEnum Helpers::CheckGoldResource(int unitIndex) + BOOLEnum Helpers::CheckGoldResource(UnitType unitIndex) { int requiredGold = 0; if (unitIndex == 5) { diff --git a/src/OpenSHC/UI/Helpers/UpdateTutorialStepAndProgress.cpp b/src/OpenSHC/UI/Helpers/UpdateTutorialStepAndProgress.cpp index ea22a51f4f..2f86ef966e 100644 --- a/src/OpenSHC/UI/Helpers/UpdateTutorialStepAndProgress.cpp +++ b/src/OpenSHC/UI/Helpers/UpdateTutorialStepAndProgress.cpp @@ -22,6 +22,7 @@ #include "OpenSHC/Globals/DAT_00df5588.hpp" #include "OpenSHC/Globals/DAT_00df558c.hpp" #include "OpenSHC/Globals/DAT_00df5590.hpp" +#include "OpenSHC/Globals/DAT_DisableTutorialRestrictions.hpp" #include "OpenSHC/Globals/DAT_FileDoesntExist.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" #include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" @@ -38,7 +39,6 @@ #include "OpenSHC/Globals/INT_00df5584.hpp" #include "OpenSHC/Globals/INT_00df5650.hpp" #include "OpenSHC/Globals/INT_00df5654.hpp" -#include "OpenSHC/Globals/INT_DisableTutorialRestrictions.hpp" #include "OpenSHC/Globals/TUT_RotateMapHappened.hpp" namespace OpenSHC { @@ -48,7 +48,7 @@ namespace UI { void Helpers::UpdateTutorialStepAndProgress() { int const wasComplete = DAT_00df5560::instance; - if (INT_DisableTutorialRestrictions::instance + if (DAT_DisableTutorialRestrictions::instance && DAT_MenuModalComposition1::instance.activeModalDialogID != UI::Enums::MMT_TUTORIAL_BOX && DAT_MenuModalComposition1::instance.activeModalDialogID != UI::Enums::MMT_TUTORIAL_BOX_WITH_LEAVE) { return; @@ -122,7 +122,7 @@ namespace UI { } if (fade >= 32) { ++DAT_TutorialCurrentStep::instance; - if (INT_DisableTutorialRestrictions::instance) { + if (DAT_DisableTutorialRestrictions::instance) { MACRO_CALL_MEMBER(UI::MenuModalComposition_Func::activateModalDialog, DAT_MenuModalComposition1::ptr)(UI::Enums::MMT_NONE, FALSE); } else { @@ -146,7 +146,7 @@ namespace UI { if (DAT_00df5560::instance) { return; } - if (INT_DisableTutorialRestrictions::instance || DAT_00df5540::instance == 2) { + if (DAT_DisableTutorialRestrictions::instance || DAT_00df5540::instance == 2) { return; } diff --git a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Min1.cpp b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Min1.cpp index a2f272fc3e..f39d56f950 100644 --- a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Min1.cpp +++ b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Min1.cpp @@ -1,6 +1,6 @@ #include "OpenSHC/UI/MenuItems/BuildingAndStatusMenu.func.hpp" -#include "OpenSHC/Globals/DAT_00df3350.hpp" +#include "OpenSHC/Globals/INT_00df3350.hpp" namespace OpenSHC { namespace UI { @@ -8,7 +8,7 @@ namespace UI { namespace BuildingAndStatusMenu { // FUNCTION: STRONGHOLDCRUSADER 0x004649C0 - void MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Min1() { DAT_00df3350::instance = 0xffffffff; } + void MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Min1() { INT_00df3350::instance = -1; } } } diff --git a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_BarracksWeaponAvailability.cpp b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_BarracksWeaponAvailability.cpp index 65d90909a8..971a042a56 100644 --- a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_BarracksWeaponAvailability.cpp +++ b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_BarracksWeaponAvailability.cpp @@ -7,7 +7,6 @@ #include "OpenSHC/Text/TextAlignment.hpp" #include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" -#include "OpenSHC/Globals/DAT_00df3350.hpp" #include "OpenSHC/Globals/DAT_ButtonCurrentlyInteracting.hpp" #include "OpenSHC/Globals/DAT_ButtonX.hpp" #include "OpenSHC/Globals/DAT_ButtonY.hpp" @@ -20,6 +19,7 @@ #include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" #include "OpenSHC/Globals/DAT_UIButtonDefinedData.hpp" #include "OpenSHC/Globals/DAT_UnitPropertiesDefinedData.hpp" +#include "OpenSHC/Globals/INT_00df3350.hpp" namespace OpenSHC { namespace UI { @@ -40,12 +40,12 @@ namespace UI { } else { DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; - if ((int)DAT_00df3350::instance >= 0) { + if ((int)INT_00df3350::instance >= 0) { for (int i = 0; i < countof(DAT_UnitPropertiesDefinedData::instance - .EuroUnitResourceCosts[DAT_00df3350::instance]); + .EuroUnitResourceCosts[INT_00df3350::instance]); ++i) { if (DAT_UnitPropertiesDefinedData::instance - .EuroUnitResourceCosts[DAT_00df3350::instance][i] + .EuroUnitResourceCosts[INT_00df3350::instance][i] == -1) { neededByHoveredUnit = TRUE; } @@ -116,10 +116,10 @@ namespace UI { return; } DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; - if ((int)DAT_00df3350::instance >= 0) { + if ((int)INT_00df3350::instance >= 0) { // The item part tests only the first three cost slots, as the original does. for (int i = 0; i < 3; ++i) { - if (DAT_UnitPropertiesDefinedData::instance.EuroUnitResourceCosts[DAT_00df3350::instance][i] + if (DAT_UnitPropertiesDefinedData::instance.EuroUnitResourceCosts[INT_00df3350::instance][i] == resourceType) { neededByHoveredUnit = TRUE; } diff --git a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_TunnelerPortrait.cpp b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_TunnelerPortrait.cpp index 4bf73b56e0..809386e63d 100644 --- a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_TunnelerPortrait.cpp +++ b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_TunnelerPortrait.cpp @@ -5,6 +5,7 @@ #include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" #include "OpenSHC/Game/GameMode.hpp" #include "OpenSHC/IO/Graphics/GmID.hpp" +#include "OpenSHC/Map/Units/UnitType.hpp" #include "OpenSHC/Rendering/Enums/RenderTarget.hpp" #include "OpenSHC/Globals/DAT_ButtonCurrentlyInteracting.hpp" @@ -39,7 +40,7 @@ namespace UI { if (DAT_EnoughGoldForRequestedUnit::instance) { DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; - if (MACRO_CALL(Helpers_Func::CheckGoldResource)(unitType)) { + if (MACRO_CALL(Helpers_Func::CheckGoldResource)((Map::Units::UnitType)unitType)) { ButtonGmData* const buttonGmData = &DAT_UIButtonDefinedData::instance .ButtonGmDataArray[DAT_CurrentButtonGmDataIndex::instance]; diff --git a/src/OpenSHC/UI/MenuItems/SaveLoadMap/MenuItemActionHandler_SaveLoadMap_Buttons.cpp b/src/OpenSHC/UI/MenuItems/SaveLoadMap/MenuItemActionHandler_SaveLoadMap_Buttons.cpp index 7cce329d52..6bb2ccebad 100644 --- a/src/OpenSHC/UI/MenuItems/SaveLoadMap/MenuItemActionHandler_SaveLoadMap_Buttons.cpp +++ b/src/OpenSHC/UI/MenuItems/SaveLoadMap/MenuItemActionHandler_SaveLoadMap_Buttons.cpp @@ -128,7 +128,7 @@ namespace UI { != 0) { // One resolve call per arm and != tests with the else arm last: the original lays the chain out // this way. - if (DAT_MenuTextInputState::instance.DAT_ArrayOfMapU3EndInt2[0] != 0) { + if (DAT_MenuTextInputState::instance.DAT_ArrayOfMapU3EndInt2 != 0) { strcpy(fileName, MACRO_CALL_MEMBER( OpenSHC::Text::UserTextHandler_Func::getCurrentText, DAT_UserTextHandlerState::ptr)()); diff --git a/src/OpenSHC/UI/MenuItems/TutorialBox/MenuItemActionHandler_TutorialBox_Main.cpp b/src/OpenSHC/UI/MenuItems/TutorialBox/MenuItemActionHandler_TutorialBox_Main.cpp index eb6d4d19eb..cf1d0ea857 100644 --- a/src/OpenSHC/UI/MenuItems/TutorialBox/MenuItemActionHandler_TutorialBox_Main.cpp +++ b/src/OpenSHC/UI/MenuItems/TutorialBox/MenuItemActionHandler_TutorialBox_Main.cpp @@ -15,12 +15,12 @@ #include "OpenSHC/string-literals.hpp" #include "OpenSHC/Globals/DAT_00df5540.hpp" -#include "OpenSHC/Globals/DAT_00df5554.hpp" #include "OpenSHC/Globals/DAT_00df5558.hpp" #include "OpenSHC/Globals/DAT_00df555c.hpp" #include "OpenSHC/Globals/DAT_00df5560.hpp" #include "OpenSHC/Globals/DAT_00df556c.hpp" #include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_DisableTutorialRestrictions.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" #include "OpenSHC/Globals/DAT_GameState.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" @@ -32,7 +32,7 @@ #include "OpenSHC/Globals/DAT_SoundSystemState.hpp" #include "OpenSHC/Globals/DAT_TutorialCurrentStep.hpp" #include "OpenSHC/Globals/DAT_VideoBikQueue.hpp" -#include "OpenSHC/Globals/INT_DisableTutorialRestrictions.hpp" +#include "OpenSHC/Globals/INT_00df5554.hpp" namespace OpenSHC { namespace UI { @@ -82,8 +82,8 @@ namespace UI { MACRO_CALL(OpenSHC::UI::Helpers_Func::InitTutorialStepTransition)(2); DAT_00df5560::instance = FALSE; // the original compares the step counters signed - if ((int)DAT_TutorialCurrentStep::instance >= (int)DAT_00df5554::instance - 1) { - INT_DisableTutorialRestrictions::instance = TRUE; + if ((int)DAT_TutorialCurrentStep::instance >= (int)INT_00df5554::instance - 1) { + DAT_DisableTutorialRestrictions::instance = TRUE; } if (DAT_MissionAestheticsDefinedData::instance.TutorialStepSpeechTrigger[DAT_TutorialCurrentStep::instance] == 1) { diff --git a/src/OpenSHC/UI/MenuTextInputState/activateLoadOrSaveMapUI.cpp b/src/OpenSHC/UI/MenuTextInputState/activateLoadOrSaveMapUI.cpp index d3ae0c3775..17bddc832d 100644 --- a/src/OpenSHC/UI/MenuTextInputState/activateLoadOrSaveMapUI.cpp +++ b/src/OpenSHC/UI/MenuTextInputState/activateLoadOrSaveMapUI.cpp @@ -18,7 +18,7 @@ namespace OpenSHC { namespace UI { // FUNCTION: STRONGHOLDCRUSADER 0x00493980 - void MenuTextInputState::activateLoadOrSaveMapUI(int loadOrSaveMap) + void MenuTextInputState::activateLoadOrSaveMapUI(MenuModalType loadOrSaveMap) { DAT_MouseState::instance.waitCursorToggle = 1; MACRO_CALL(OpenSHC::UI::Helpers_Func::SetCursorDependingOnProgramState)(); @@ -46,7 +46,7 @@ namespace UI { } this->lastListClickTime = 0; this->lastClickedListIndex = -1; - this->DAT_ArrayOfMapU3EndInt2[0] = 0; + this->DAT_ArrayOfMapU3EndInt2 = 0; DAT_MouseState::instance.waitCursorToggle = 0; this->fileListVisibleRowCount = 16; if (loadOrSaveMap == OpenSHC::UI::Enums::MMT_LOAD_MAP) { diff --git a/src/OpenSHC/UI/MenuTextInputState/loadOrSaveMap.cpp b/src/OpenSHC/UI/MenuTextInputState/loadOrSaveMap.cpp index 6dc1bef7d0..3b6b37c568 100644 --- a/src/OpenSHC/UI/MenuTextInputState/loadOrSaveMap.cpp +++ b/src/OpenSHC/UI/MenuTextInputState/loadOrSaveMap.cpp @@ -49,7 +49,7 @@ namespace UI { DAT_MouseState::instance.waitCursorToggle = 0; this->lastListClickTime = 0; this->lastClickedListIndex = -1; - this->DAT_ArrayOfMapU3EndInt2[0] = 1; + this->DAT_ArrayOfMapU3EndInt2 = 1; this->fileListVisibleRowCount = 16; if (dialogType == OpenSHC::UI::Enums::MMT_LOAD_MAP) { MACRO_CALL_MEMBER(OpenSHC::UI::MenuTextInputState_Func::activateModalDialogAndClearText, this)( diff --git a/src/OpenSHC/UI/Rendering/DisplayMapDescriptionAndAllocatePlayersToSlots.cpp b/src/OpenSHC/UI/Rendering/DisplayMapDescriptionAndAllocatePlayersToSlots.cpp index ca56297a16..c8825476d7 100644 --- a/src/OpenSHC/UI/Rendering/DisplayMapDescriptionAndAllocatePlayersToSlots.cpp +++ b/src/OpenSHC/UI/Rendering/DisplayMapDescriptionAndAllocatePlayersToSlots.cpp @@ -14,7 +14,6 @@ #include "OpenSHC/IO/FileResourceType.hpp" #include "OpenSHC/string-macros.hpp" -#include "OpenSHC/Globals/DAT_00b95b74.hpp" #include "OpenSHC/Globals/DAT_00b960f4.hpp" #include "OpenSHC/Globals/DAT_GameCore.hpp" #include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" @@ -23,6 +22,7 @@ #include "OpenSHC/Globals/FilePackagerObj.hpp" #include "OpenSHC/Globals/INT_00b95958.hpp" #include "OpenSHC/Globals/INT_00b95ab8.hpp" +#include "OpenSHC/Globals/INT_00b95b74.hpp" #include "OpenSHC/Globals/INT_00b960b0.hpp" namespace OpenSHC { @@ -43,14 +43,14 @@ namespace UI { OpenSHC::IO::FRT_MAPS, mapFileName); MACRO_CALL_MEMBER(OpenSHC::IO::FilePackager_Func::readMapHeader, FilePackagerObj::ptr)(TRUE); INT_00b95958::instance = 1; - DAT_00b95b74::instance = 0; + INT_00b95b74::instance = 0; DAT_00b960f4::instance = -19; if (DAT_GameCore::instance.mapDescUseStringTable == 0) { - DAT_00b95b74::instance = MACRO_CALL_MEMBER(OpenSHC::Text::FontSizeClass_Func::renderMultilineTextUnk, + INT_00b95b74::instance = MACRO_CALL_MEMBER(OpenSHC::Text::FontSizeClass_Func::renderMultilineTextUnk, &DAT_TextManagerObject::instance.fontSizeClassArray[19])( DAT_GameCore::instance.mapDescription, 0, 0, 345, 0, 0, 1); } else if (DAT_GameCore::instance.mapDescUseStringTableIndex != 0) { - DAT_00b95b74::instance = MACRO_CALL_MEMBER(OpenSHC::Text::FontSizeClass_Func::renderMultilineTextUnk, + INT_00b95b74::instance = MACRO_CALL_MEMBER(OpenSHC::Text::FontSizeClass_Func::renderMultilineTextUnk, &DAT_TextManagerObject::instance.fontSizeClassArray[19])( MACRO_CALL_MEMBER( OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( From 3ada8bbae233dfee207936824628140fcb80dc6f Mon Sep 17 00:00:00 2001 From: kotijekriv Date: Fri, 6 Nov 2026 10:56:08 +0100 Subject: [PATCH 2/2] style: clang-format processWaitingCommands cpp-linter checks whole files; line 38 (unchanged by the renames) was indented one level too deep for clang-format. Whitespace only. Co-Authored-By: Claude Opus 5.5 --- .../Synchrony/GameSynchronyState/processWaitingCommands.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenSHC/Synchrony/GameSynchronyState/processWaitingCommands.cpp b/src/OpenSHC/Synchrony/GameSynchronyState/processWaitingCommands.cpp index b0582911a6..1b309e4309 100644 --- a/src/OpenSHC/Synchrony/GameSynchronyState/processWaitingCommands.cpp +++ b/src/OpenSHC/Synchrony/GameSynchronyState/processWaitingCommands.cpp @@ -35,7 +35,7 @@ namespace Synchrony { this->DAT_CommandActionPlan = Commands::GCS_EXECUTE; this->DAT_CommandParameterOffset = 0; DAT_ProtocolDefinedData::instance - .commandFunctions[this->DAT_GameCommandArray[this->DAT_CurrentGameCommandID].commandType](); + .commandFunctions[this->DAT_GameCommandArray[this->DAT_CurrentGameCommandID].commandType](); ++_gameCommandID; this->DAT_GameCommandArray[this->DAT_CurrentGameCommandID].stateUnk = Commands::GCS_PROCESSED; ++_selected;