diff --git a/cmake/compiler-flags-gl.txt b/cmake/compiler-flags-gl.txt index 848d70de6..1f9281c73 100644 --- a/cmake/compiler-flags-gl.txt +++ b/cmake/compiler-flags-gl.txt @@ -7,3 +7,11 @@ src/OpenSHC/IO/ResourceManager/swapMapDataWithNextMap.cpp src/OpenSHC/UI/Rendering/WindowAndDirectDraw/takeScreenshot.cpp src/OpenSHC/IO/ResourceManager/readFirstPartOfCurrentResourceIntoMemory.cpp src/OpenSHC/IO/ResourceManager/readNextPartOfCurrentResourceIntoMemory.cpp +src/OpenSHC/Map/TileMapState/updateMoatCountdownTimers.cpp +src/OpenSHC/Map/TileMapState/recountTotalOwnedMoats.cpp +src/OpenSHC/Game/GameStateStructures/getSalesPrice.cpp +src/OpenSHC/Map/TileMapState/updateBuildingPlacementRotationPreview.cpp +src/OpenSHC/Map/Units/TribesState/playUnitSelectSpeech.cpp +src/OpenSHC/Audio/SFX/SFXState/playUnitSpeech.cpp +src/OpenSHC/Game/GameStateStructures/getSellResourceAmount.cpp +src/OpenSHC/Map/TileMapState/determineBuildingPlacementRotation.cpp \ No newline at end of file diff --git a/src/OpenSHC/Game/GameCore/exitToScenarioDescriptionMenu.cpp b/src/OpenSHC/Game/GameCore/exitToScenarioDescriptionMenu.cpp new file mode 100644 index 000000000..1c25e9d1d --- /dev/null +++ b/src/OpenSHC/Game/GameCore/exitToScenarioDescriptionMenu.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { +namespace Game { + + using OpenSHC::UI::Enums::MenuViewType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00471A80 + void GameCore::exitToScenarioDescriptionMenu() + { + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::removeLadyAndJester, this)(); + DAT_GameCore::instance.field22_0x64 = 0; + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_SCENARIO_DESCRIPTION, 0); + } + +} +} diff --git a/src/OpenSHC/Game/GameCore/isGameHaltingMenuOpen.cpp b/src/OpenSHC/Game/GameCore/isGameHaltingMenuOpen.cpp new file mode 100644 index 000000000..6c22d806a --- /dev/null +++ b/src/OpenSHC/Game/GameCore/isGameHaltingMenuOpen.cpp @@ -0,0 +1,31 @@ +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/Game/GameMode.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" + +namespace OpenSHC { +namespace Game { + + using OpenSHC::Game::GameMode; + using OpenSHC::UI::Enums::MenuModalType; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x0046BD20 + BOOLEnum GameCore::isGameHaltingMenuOpen() + { + if (DAT_GameSynchronyState::instance.currentGameMode != OpenSHC::Game::GM_SOLITARY + && DAT_GameSynchronyState::instance.currentGameMode != OpenSHC::Game::GM_SKIRMISH_SINGLE_PLAYER) { + return FALSE; + } + if (DAT_MenuTextInputState::instance.currentModalDialog != OpenSHC::UI::Enums::MMT_NO_MENU) { + return TRUE; + } + return DAT_MenuModalComposition1::instance.activeModalDialogID == OpenSHC::UI::Enums::MMT_IN_GAME_HELP_TEXT; + } + +} +} diff --git a/src/OpenSHC/Game/GameCore/setTabToSwitchTo.cpp b/src/OpenSHC/Game/GameCore/setTabToSwitchTo.cpp new file mode 100644 index 000000000..9a93c254c --- /dev/null +++ b/src/OpenSHC/Game/GameCore/setTabToSwitchTo.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" + +namespace OpenSHC { +namespace Game { + + using OpenSHC::UI::Enums::MenuViewType; + + // FUNCTION: STRONGHOLDCRUSADER 0x0046B300 + void GameCore::setTabToSwitchTo() + { + if (this->currentMenuViewType == OpenSHC::UI::Enums::MVT_BUILD_MENU) { + this->secondaryActiveMenuTabToSwitchTo = this->buildmenuMenuTabToSwitchTo; + } + if (this->currentMenuViewType == OpenSHC::UI::Enums::MVT_MAP_EDITOR_LANDSCAPING) { + this->secondaryActiveMenuTabToSwitchTo.tabType = this->landscapingmenuMenuTabToSwitchTo; + } + } + +} +} diff --git a/src/OpenSHC/Game/GameCore/setViewOnExitUnk.cpp b/src/OpenSHC/Game/GameCore/setViewOnExitUnk.cpp new file mode 100644 index 000000000..7a5e75fbd --- /dev/null +++ b/src/OpenSHC/Game/GameCore/setViewOnExitUnk.cpp @@ -0,0 +1,13 @@ +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" + +namespace OpenSHC { +namespace Game { + + using OpenSHC::UI::Enums::MenuViewType; + + // FUNCTION: STRONGHOLDCRUSADER 0x0046B2F0 + void GameCore::setViewOnExitUnk() { this->currentMenuViewType = (MenuViewType)2; } + +} +} diff --git a/src/OpenSHC/Game/GameCore/swapBuildMenuTab.cpp b/src/OpenSHC/Game/GameCore/swapBuildMenuTab.cpp new file mode 100644 index 000000000..f3711c65c --- /dev/null +++ b/src/OpenSHC/Game/GameCore/swapBuildMenuTab.cpp @@ -0,0 +1,20 @@ +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/UI/Enums/BuildingsAndStatusMenuTabType.hpp" + +namespace OpenSHC { +namespace Game { + + using OpenSHC::UI::Enums::BuildingsAndStatusMenuTabType; + + // FUNCTION: STRONGHOLDCRUSADER 0x0046B320 + void GameCore::swapBuildMenuTab() + { + if (this->buildmenuMenuTabToSwitchTo.tabType == OpenSHC::UI::Enums::BASMTT_SIEGETENT_SHIELD) { + this->buildmenuMenuTabToSwitchTo.tabType = OpenSHC::UI::Enums::BASMTT_SIEGETENT_BATTERINGRAM; + return; + } + this->buildmenuMenuTabToSwitchTo = this->secondaryActiveMenuTabToSwitchTo; + } + +} +} diff --git a/src/OpenSHC/Game/GameCore/switchToScenarioDescriptionMenuView.cpp b/src/OpenSHC/Game/GameCore/switchToScenarioDescriptionMenuView.cpp new file mode 100644 index 000000000..a001da5b1 --- /dev/null +++ b/src/OpenSHC/Game/GameCore/switchToScenarioDescriptionMenuView.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { +namespace Game { + + using OpenSHC::UI::Enums::MenuViewType; + + // FUNCTION: STRONGHOLDCRUSADER 0x004719E0 + void GameCore::switchToScenarioDescriptionMenuView() + { + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::removeJesterAndLadyUnitsInCertainMissions, this)(); + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_SCENARIO_DESCRIPTION, 0); + DAT_GameCore::instance.field22_0x64 = 0; + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/activateTraderState.cpp b/src/OpenSHC/Game/GameStateStructures/activateTraderState.cpp new file mode 100644 index 000000000..b5d60d31a --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/activateTraderState.cpp @@ -0,0 +1,14 @@ +#include "../GameStateStructures.func.hpp" + +namespace OpenSHC { +namespace Game { + + // FUNCTION: STRONGHOLDCRUSADER 0x004586D0 + void GameStateStructures::activateTraderState() + { + this->mapAndTime.traderRelated2 = 2; + this->mapAndTime.traderRelatedCounter1 = 0; + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/calculateTaxBribeExpenseForPlayer.cpp b/src/OpenSHC/Game/GameStateStructures/calculateTaxBribeExpenseForPlayer.cpp new file mode 100644 index 000000000..c76ecac30 --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/calculateTaxBribeExpenseForPlayer.cpp @@ -0,0 +1,17 @@ +#include "../GameStateStructures.func.hpp" + +namespace OpenSHC { +namespace Game { + + // FUNCTION: STRONGHOLDCRUSADER 0x00459140 + int GameStateStructures::calculateTaxBribeExpenseForPlayer(int playerIndex, int taxStep, int currentPopulation) + { + int bribeExpense = ((5 - taxStep) * currentPopulation) / 2; + if (this->playerDataArray[playerIndex].currentResources[OpenSHC::Game::Resources::RT_GOLD] <= 0) { + bribeExpense = 0; + } + return bribeExpense; + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/clearTribeHotKey.cpp b/src/OpenSHC/Game/GameStateStructures/clearTribeHotKey.cpp new file mode 100644 index 000000000..3c7ca31ed --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/clearTribeHotKey.cpp @@ -0,0 +1,20 @@ +#include "../GameStateStructures.func.hpp" + +#include "OpenSHC/Game/State/UnitSelectionHotKeyEntry.hpp" + +namespace OpenSHC { +namespace Game { + + using OpenSHC::Game::State::UnitSelectionHotKeyEntry; + + // FUNCTION: STRONGHOLDCRUSADER 0x00459BB0 + void GameStateStructures::clearTribeHotKey(int hotkeyID) + { + for (int i = 0; i < 2500; ++i) { + this->hotkeyTribes[hotkeyID].units[i].id = -1; + this->hotkeyTribes[hotkeyID].units[i].uid = -1; + } + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/destroyPlayerCompletely.cpp b/src/OpenSHC/Game/GameStateStructures/destroyPlayerCompletely.cpp new file mode 100644 index 000000000..2087fbaad --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/destroyPlayerCompletely.cpp @@ -0,0 +1,28 @@ +#include "../GameStateStructures.func.hpp" + +#include "OpenSHC/Map/Buildings/BuildingsState.func.hpp" +#include "OpenSHC/Map/Entities/EntityState.func.hpp" +#include "OpenSHC/Map/TileMapState.func.hpp" +#include "OpenSHC/Map/Units/UnitsState.func.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_EntityState.hpp" +#include "OpenSHC/Globals/DAT_TileMapState.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Game { + + // FUNCTION: STRONGHOLDCRUSADER 0x00457B40 + void GameStateStructures::destroyPlayerCompletely(int playerID) + { + MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::killUnits, DAT_UnitsState::ptr)(playerID); + MACRO_CALL_MEMBER(OpenSHC::Map::Buildings::BuildingsState_Func::destroyBuildings, DAT_BuildingsState::ptr)( + playerID); + MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::destroyWallsOfPlayer, DAT_TileMapState::ptr)(playerID); + MACRO_CALL_MEMBER(OpenSHC::Map::Entities::EntityState_Func::destroyEntitiesPart2, DAT_EntityState::ptr)( + playerID); + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/fillWith0xFF.cpp b/src/OpenSHC/Game/GameStateStructures/fillWith0xFF.cpp new file mode 100644 index 000000000..17d2d6213 --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/fillWith0xFF.cpp @@ -0,0 +1,22 @@ +#include "../GameStateStructures.func.hpp" + +#include "OpenSHC/Game/GameStateStructures.hpp" + +namespace OpenSHC { +namespace Game { + + using OpenSHC::Game::GameStateStructures; + + // FUNCTION: STRONGHOLDCRUSADER 0x00459BE0 + void GameStateStructures::fillWith0xFF() + { + for (int hotkeyID = 0; hotkeyID < 10; ++hotkeyID) { + for (int i = 0; i < 2500; ++i) { + this->hotkeyTribes[hotkeyID].units[i].id = -1; + this->hotkeyTribes[hotkeyID].units[i].uid = -1; + } + } + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/findNextPlayerWithMarketplace.cpp b/src/OpenSHC/Game/GameStateStructures/findNextPlayerWithMarketplace.cpp new file mode 100644 index 000000000..a0ab37c21 --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/findNextPlayerWithMarketplace.cpp @@ -0,0 +1,22 @@ +#include "../GameStateStructures.func.hpp" + +#include "OpenSHC/Game/Player/PlayerData.hpp" + +namespace OpenSHC { +namespace Game { + + using OpenSHC::Game::Player::PlayerData; + + // FUNCTION: STRONGHOLDCRUSADER 0x00458700 + int GameStateStructures::findNextPlayerWithMarketplace(int playerID) + { + for (int nextPlayerID = playerID + 1; nextPlayerID < 9; ++nextPlayerID) { + if (this->playerDataArray[nextPlayerID].marketplace.id > 0) { + return nextPlayerID; + } + } + return 0; + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/getBatchBuyPrice.cpp b/src/OpenSHC/Game/GameStateStructures/getBatchBuyPrice.cpp new file mode 100644 index 000000000..736371e18 --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/getBatchBuyPrice.cpp @@ -0,0 +1,13 @@ +#include "../GameStateStructures.func.hpp" + +namespace OpenSHC { +namespace Game { + + // FUNCTION: STRONGHOLDCRUSADER 0x00458890 + int GameStateStructures::getBatchBuyPrice(undefined4 playerID, int resourceType) + { + return this->mapAndTime.buyAndSalesPriceArray[resourceType].buyPrice; + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/getBuyPriceForOneUnit.cpp b/src/OpenSHC/Game/GameStateStructures/getBuyPriceForOneUnit.cpp new file mode 100644 index 000000000..de9b24016 --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/getBuyPriceForOneUnit.cpp @@ -0,0 +1,13 @@ +#include "../GameStateStructures.func.hpp" + +namespace OpenSHC { +namespace Game { + + // FUNCTION: STRONGHOLDCRUSADER 0x004588D0 + int GameStateStructures::getBuyPriceForOneUnit(int resourceType) + { + return this->mapAndTime.buyAndSalesPriceArray[resourceType].buyPrice / 5; + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/getNumberToDisplayBribeIncome.cpp b/src/OpenSHC/Game/GameStateStructures/getNumberToDisplayBribeIncome.cpp new file mode 100644 index 000000000..7c636b95c --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/getNumberToDisplayBribeIncome.cpp @@ -0,0 +1,19 @@ +#include "../GameStateStructures.func.hpp" + +namespace OpenSHC { +namespace Game { + + // FUNCTION: STRONGHOLDCRUSADER 0x004591B0 + int GameStateStructures::getNumberToDisplayBribeIncome(int playerIndex, int taxStep, int currentPopulation) + { + int bribeIncome = 0; + if (taxStep < 3) { + bribeIncome = MACRO_CALL_MEMBER(OpenSHC::Game::GameStateStructures_Func::calculateTaxBribeExpenseForPlayer, + this)(playerIndex, taxStep, currentPopulation) + * 4; + } + return bribeIncome / 10; + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/getNumberToDisplayPlayerTaxIncome.cpp b/src/OpenSHC/Game/GameStateStructures/getNumberToDisplayPlayerTaxIncome.cpp new file mode 100644 index 000000000..db54b1f3f --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/getNumberToDisplayPlayerTaxIncome.cpp @@ -0,0 +1,19 @@ +#include "../GameStateStructures.func.hpp" + +namespace OpenSHC { +namespace Game { + + // FUNCTION: STRONGHOLDCRUSADER 0x00459170 + int GameStateStructures::getNumberToDisplayPlayerTaxIncome(int playerIndex, int taxStep, int currentPopulation) + { + int taxIncome = 0; + if (taxStep > 3) { + taxIncome = MACRO_CALL_MEMBER(OpenSHC::Game::GameStateStructures_Func::calculateTaxIncomeForPlayer, this)( + playerIndex, taxStep, currentPopulation) + * 4; + } + return taxIncome / 10; + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/getSalePriceOfGood.cpp b/src/OpenSHC/Game/GameStateStructures/getSalePriceOfGood.cpp new file mode 100644 index 000000000..81a9dc7d6 --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/getSalePriceOfGood.cpp @@ -0,0 +1,17 @@ +#include "../GameStateStructures.func.hpp" + +#include "OpenSHC/Game/Resources/ResourceType.hpp" + +namespace OpenSHC { +namespace Game { + + using OpenSHC::Game::Resources::ResourceType; + + // FUNCTION: STRONGHOLDCRUSADER 0x004588F0 + int GameStateStructures::getSalePriceOfGood(ResourceType resourceType) + { + return this->mapAndTime.buyAndSalesPriceArray[resourceType].salesPrice / 5; + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/getSalesPrice.cpp b/src/OpenSHC/Game/GameStateStructures/getSalesPrice.cpp new file mode 100644 index 000000000..9ffd6215f --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/getSalesPrice.cpp @@ -0,0 +1,15 @@ +#include "../GameStateStructures.func.hpp" + +namespace OpenSHC { +namespace Game { + + // FUNCTION: STRONGHOLDCRUSADER 0x0045B7F0 + int GameStateStructures::getSalesPrice(int playerID, int resourceType) + { + return (this->mapAndTime.buyAndSalesPriceArray[resourceType].salesPrice / 5) + * MACRO_CALL_MEMBER(OpenSHC::Game::GameStateStructures_Func::getSellResourceAmount, this)( + playerID, resourceType); + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/getTeamsDifferent.cpp b/src/OpenSHC/Game/GameStateStructures/getTeamsDifferent.cpp new file mode 100644 index 000000000..67a1aeab3 --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/getTeamsDifferent.cpp @@ -0,0 +1,23 @@ +#include "../GameStateStructures.func.hpp" + +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Game { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004596D0 + BOOLEnum GameStateStructures::getTeamsDifferent(int firstPlayerId, int secondPlayerId) + { + if (firstPlayerId == 0) { + return FALSE; + } + if (secondPlayerId == 0) { + return FALSE; + } + return this->mapAndTime.playerTeams[firstPlayerId] != this->mapAndTime.playerTeams[secondPlayerId]; + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/isFullIDEqualsToMinus1.cpp b/src/OpenSHC/Game/GameStateStructures/isFullIDEqualsToMinus1.cpp new file mode 100644 index 000000000..ec6919762 --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/isFullIDEqualsToMinus1.cpp @@ -0,0 +1,19 @@ +#include "../GameStateStructures.func.hpp" + +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Game { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004563B0 + BOOLEnum GameStateStructures::isFullIDEqualsToMinus1(int playerID) + { + return DAT_GameSynchronyState::instance.currentPlayerFullIDArray[playerID] == -1; + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/isResourceTypeTradeable.cpp b/src/OpenSHC/Game/GameStateStructures/isResourceTypeTradeable.cpp new file mode 100644 index 000000000..606cd3d2e --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/isResourceTypeTradeable.cpp @@ -0,0 +1,22 @@ +#include "../GameStateStructures.func.hpp" + +#include "OpenSHC/Game/Resources/ResourceType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Game { + + using OpenSHC::Game::Resources::ResourceType; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00458740 + BOOLEnum GameStateStructures::isResourceTypeTradeable(ResourceType resourceType) + { + if (resourceType == OpenSHC::Game::Resources::RT_PITCH) { + resourceType = OpenSHC::Game::Resources::RT_PARTIALPITCH; + } + return this->mapAndTime.isResourceTradeable[resourceType] != 0; + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/isSameTeam.cpp b/src/OpenSHC/Game/GameStateStructures/isSameTeam.cpp new file mode 100644 index 000000000..d93bb7546 --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/isSameTeam.cpp @@ -0,0 +1,17 @@ +#include "../GameStateStructures.func.hpp" + +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Game { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00401090 + BOOLEnum GameStateStructures::isSameTeam(int playerID1, int playerID2) + { + return this->mapAndTime.playerTeams[playerID1] == this->mapAndTime.playerTeams[playerID2]; + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/resetSomethingBuildingRelatedForAllPlayers.cpp b/src/OpenSHC/Game/GameStateStructures/resetSomethingBuildingRelatedForAllPlayers.cpp new file mode 100644 index 000000000..ec872c12d --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/resetSomethingBuildingRelatedForAllPlayers.cpp @@ -0,0 +1,18 @@ +#include "../GameStateStructures.func.hpp" + +namespace OpenSHC { +namespace Game { + + // FUNCTION: STRONGHOLDCRUSADER 0x0045AF00 + void GameStateStructures::resetSomethingBuildingRelatedForAllPlayers() + { + for (int playerID = 1; playerID < 9; ++playerID) { + for (int category = 0; category < 20; ++category) { + MACRO_CALL_MEMBER(OpenSHC::Game::GameStateStructures_Func::validateBuildingCategoryReference, this)( + playerID, category); + } + } + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/resetTraderState.cpp b/src/OpenSHC/Game/GameStateStructures/resetTraderState.cpp new file mode 100644 index 000000000..534503c1d --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/resetTraderState.cpp @@ -0,0 +1,14 @@ +#include "../GameStateStructures.func.hpp" + +namespace OpenSHC { +namespace Game { + + // FUNCTION: STRONGHOLDCRUSADER 0x004586F0 + void GameStateStructures::resetTraderState() + { + this->mapAndTime.traderRelated2 = 0; + this->mapAndTime.traderRelatedCounter1 = 0; + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/switchPlayerOwnership.cpp b/src/OpenSHC/Game/GameStateStructures/switchPlayerOwnership.cpp new file mode 100644 index 000000000..179dd6b69 --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/switchPlayerOwnership.cpp @@ -0,0 +1,23 @@ +#include "../GameStateStructures.func.hpp" + +#include "OpenSHC/AI/AICState.func.hpp" + +#include "OpenSHC/Globals/DAT_AICState.hpp" + +namespace OpenSHC { +namespace Game { + + // FUNCTION: STRONGHOLDCRUSADER 0x0045B460 + void GameStateStructures::switchPlayerOwnership(int playerID) + { + for (int fromPlayer = 1; fromPlayer < 9; ++fromPlayer) { + if (fromPlayer != playerID) { + MACRO_CALL_MEMBER(OpenSHC::Game::GameStateStructures_Func::changePlayerOwnership, this)( + fromPlayer, playerID); + } + } + MACRO_CALL_MEMBER(OpenSHC::AI::AICState_Func::recomputeAIZonerLayer, DAT_AICState::ptr)(); + } + +} +} diff --git a/src/OpenSHC/Game/UpdateUnitValueLoss.cpp b/src/OpenSHC/Game/UpdateUnitValueLoss.cpp new file mode 100644 index 000000000..3a93a4d11 --- /dev/null +++ b/src/OpenSHC/Game/UpdateUnitValueLoss.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/Globals/DAT_CurrentPlayerUnitLosses.hpp" + +namespace OpenSHC { +namespace Game { + + // FUNCTION: STRONGHOLDCRUSADER 0x0044aa70 + void UpdateUnitValueLoss(int value) + { + if (value > 0) { + DAT_CurrentPlayerUnitLosses::instance += value; + } + } + +} // namespace Game +} // namespace OpenSHC diff --git a/src/OpenSHC/Global/PrintToDestination.cpp b/src/OpenSHC/Global/PrintToDestination.cpp new file mode 100644 index 000000000..b8e97a0bf --- /dev/null +++ b/src/OpenSHC/Global/PrintToDestination.cpp @@ -0,0 +1,14 @@ +#include "OpenSHC/Global.func.hpp" +#include "OpenSHC/OS.func.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x0045D060 +void Global::PrintToDestination(wchar_t* destination, wchar_t* format, ...) +{ + va_list args; + va_start(args, format); + MACRO_CALL(OpenSHC::OS_Func::__vswprintf)(destination, format, args); +} + +} diff --git a/src/OpenSHC/Map/Buildings/UpdateBadBuildingCessPitOrDancingBearUnk.cpp b/src/OpenSHC/Map/Buildings/UpdateBadBuildingCessPitOrDancingBearUnk.cpp new file mode 100644 index 000000000..ef4df72b3 --- /dev/null +++ b/src/OpenSHC/Map/Buildings/UpdateBadBuildingCessPitOrDancingBearUnk.cpp @@ -0,0 +1,17 @@ +#include "OpenSHC/Map/Buildings.func.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_CurrentBuildingID.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x00418F70 + void Buildings::UpdateBadBuildingCessPitOrDancingBearUnk() + { + DAT_BuildingsState::instance.buildings[DAT_CurrentBuildingID::instance].renderAnimation = 0; + DAT_BuildingsState::instance.buildings[DAT_CurrentBuildingID::instance].displayOwnerFlag = 0; + } + +} +} diff --git a/src/OpenSHC/Map/Buildings/UpdateBadBuildingRackFlogging.cpp b/src/OpenSHC/Map/Buildings/UpdateBadBuildingRackFlogging.cpp new file mode 100644 index 000000000..42734366c --- /dev/null +++ b/src/OpenSHC/Map/Buildings/UpdateBadBuildingRackFlogging.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Game/GameStateStructures.func.hpp" +#include "OpenSHC/Map/Buildings.func.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_CurrentBuildingID.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x00419340 + void Buildings::UpdateBadBuildingRackFlogging() + { + DAT_BuildingsState::instance.buildings[DAT_CurrentBuildingID::instance].renderAnimation = 0; + DAT_BuildingsState::instance.buildings[DAT_CurrentBuildingID::instance].displayOwnerFlag = 0; + MACRO_CALL_MEMBER(OpenSHC::Game::GameStateStructures_Func::addBuildingInRegistry, DAT_GameState::ptr)( + DAT_CurrentBuildingID::instance); + } + +} +} diff --git a/src/OpenSHC/Map/Buildings/UpdateBuildingShared1.cpp b/src/OpenSHC/Map/Buildings/UpdateBuildingShared1.cpp new file mode 100644 index 000000000..1931c7dea --- /dev/null +++ b/src/OpenSHC/Map/Buildings/UpdateBuildingShared1.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/Map/Buildings.func.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_CurrentBuildingID.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x004180E0 + void Buildings::UpdateBuildingShared1() + { + DAT_BuildingsState::instance.buildings[DAT_CurrentBuildingID::instance].renderAnimation = 0; + } + +} +} diff --git a/src/OpenSHC/Map/Buildings/UpdateGoodBuildingGarden.cpp b/src/OpenSHC/Map/Buildings/UpdateGoodBuildingGarden.cpp new file mode 100644 index 000000000..6e7fc0b94 --- /dev/null +++ b/src/OpenSHC/Map/Buildings/UpdateGoodBuildingGarden.cpp @@ -0,0 +1,24 @@ +#include "OpenSHC/AI/AICState.func.hpp" +#include "OpenSHC/Game/GameStateStructures.func.hpp" +#include "OpenSHC/Map/Buildings.func.hpp" + +#include "OpenSHC/Globals/DAT_AICState.hpp" +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_CurrentBuildingID.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x00418880 + void Buildings::UpdateGoodBuildingGarden() + { + DAT_BuildingsState::instance.buildings[DAT_CurrentBuildingID::instance].renderAnimation = 0; + MACRO_CALL_MEMBER(OpenSHC::AI::AICState_Func::addBuildingToTargetableBuildings, DAT_AICState::ptr)( + DAT_CurrentBuildingID::instance); + MACRO_CALL_MEMBER(OpenSHC::Game::GameStateStructures_Func::addBuildingInRegistry, DAT_GameState::ptr)( + DAT_CurrentBuildingID::instance); + } + +} +} diff --git a/src/OpenSHC/Map/Buildings/UpdateParadeGround2.cpp b/src/OpenSHC/Map/Buildings/UpdateParadeGround2.cpp new file mode 100644 index 000000000..4ed55305f --- /dev/null +++ b/src/OpenSHC/Map/Buildings/UpdateParadeGround2.cpp @@ -0,0 +1,18 @@ +#include "OpenSHC/Map/Buildings.func.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_CurrentBuildingID.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x004184A0 + void Buildings::UpdateParadeGround2() + { + DAT_BuildingsState::instance.buildings[DAT_CurrentBuildingID::instance].renderAnimation = 1; + DAT_BuildingsState::instance.buildings[DAT_CurrentBuildingID::instance].animationIncrement = 1; + DAT_BuildingsState::instance.buildings[DAT_CurrentBuildingID::instance].animationFrame = 0x20; + } + +} +} diff --git a/src/OpenSHC/Map/Buildings/UpdateParadeGround3.cpp b/src/OpenSHC/Map/Buildings/UpdateParadeGround3.cpp new file mode 100644 index 000000000..e310a5659 --- /dev/null +++ b/src/OpenSHC/Map/Buildings/UpdateParadeGround3.cpp @@ -0,0 +1,18 @@ +#include "OpenSHC/Map/Buildings.func.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_CurrentBuildingID.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x004184D0 + void Buildings::UpdateParadeGround3() + { + DAT_BuildingsState::instance.buildings[DAT_CurrentBuildingID::instance].renderAnimation = 1; + DAT_BuildingsState::instance.buildings[DAT_CurrentBuildingID::instance].animationIncrement = 1; + DAT_BuildingsState::instance.buildings[DAT_CurrentBuildingID::instance].animationFrame = 0x1f; + } + +} +} diff --git a/src/OpenSHC/Map/Buildings/UpdateParadeGround4.cpp b/src/OpenSHC/Map/Buildings/UpdateParadeGround4.cpp new file mode 100644 index 000000000..688d69039 --- /dev/null +++ b/src/OpenSHC/Map/Buildings/UpdateParadeGround4.cpp @@ -0,0 +1,18 @@ +#include "OpenSHC/Map/Buildings.func.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_CurrentBuildingID.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x00418500 + void Buildings::UpdateParadeGround4() + { + DAT_BuildingsState::instance.buildings[DAT_CurrentBuildingID::instance].renderAnimation = 1; + DAT_BuildingsState::instance.buildings[DAT_CurrentBuildingID::instance].animationIncrement = 1; + DAT_BuildingsState::instance.buildings[DAT_CurrentBuildingID::instance].animationFrame = 0x21; + } + +} +} diff --git a/src/OpenSHC/Map/Buildings/UpdatePlacedSiegeTower.cpp b/src/OpenSHC/Map/Buildings/UpdatePlacedSiegeTower.cpp new file mode 100644 index 000000000..180c32313 --- /dev/null +++ b/src/OpenSHC/Map/Buildings/UpdatePlacedSiegeTower.cpp @@ -0,0 +1,26 @@ +#include "OpenSHC/Map/Buildings.func.hpp" +#include "OpenSHC/Map/Buildings/BuildingLogicalState.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_CurrentBuildingID.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Buildings::BuildingLogicalState; + + // FUNCTION: STRONGHOLDCRUSADER 0x004188C0 + void Buildings::UpdatePlacedSiegeTower() + { + int const unitID = DAT_BuildingsState::instance.buildings[DAT_CurrentBuildingID::instance].unitRefID; + if (unitID == 0 + || DAT_BuildingsState::instance.buildings[DAT_CurrentBuildingID::instance].unitRefUID + != DAT_UnitsState::instance.units[unitID].uid) { + DAT_BuildingsState::instance.buildings[DAT_CurrentBuildingID::instance].logicalState + = OpenSHC::Map::Buildings::BLS_REMOVE; + } + } + +} +} diff --git a/src/OpenSHC/Map/Entities/EntityState/activateProjectileEntity.cpp b/src/OpenSHC/Map/Entities/EntityState/activateProjectileEntity.cpp new file mode 100644 index 000000000..da1f3b8a5 --- /dev/null +++ b/src/OpenSHC/Map/Entities/EntityState/activateProjectileEntity.cpp @@ -0,0 +1,25 @@ +#include "../EntityState.func.hpp" + +#include "OpenSHC/Map/Entities/EntityType.hpp" +#include "OpenSHC/Map/Entities/EntityTypeShort.hpp" + +namespace OpenSHC { +namespace Map { + namespace Entities { + + using OpenSHC::Map::Entities::EntityType; + using OpenSHC::Map::Entities::EntityTypeShort; + + // FUNCTION: STRONGHOLDCRUSADER 0x004039B0 + int EntityState::activateProjectileEntity(int entityID) + { + this->entityArray[entityID].logicalState = 2; + this->entityArray[entityID].field72_0xa8 = 1; + MACRO_CALL_MEMBER(OpenSHC::Map::Entities::EntityState_Func::setProjectileEntityValues2, this)( + entityID, (EntityType)this->entityArray[entityID].entityType2); + return entityID; + } + + } +} +} diff --git a/src/OpenSHC/Map/Entities/EntityState/deleteEntity.cpp b/src/OpenSHC/Map/Entities/EntityState/deleteEntity.cpp new file mode 100644 index 000000000..cd5f32d59 --- /dev/null +++ b/src/OpenSHC/Map/Entities/EntityState/deleteEntity.cpp @@ -0,0 +1,22 @@ +#include "../EntityState.func.hpp" + +#include "OpenSHC/IO/LowLevelMemory.func.hpp" + +#include "OpenSHC/Globals/DAT_LowLevelMemory.hpp" + +namespace OpenSHC { +namespace Map { + namespace Entities { + + // FUNCTION: STRONGHOLDCRUSADER 0x004039F0 + void EntityState::deleteEntity(uint entityID) + { + MACRO_CALL_MEMBER(OpenSHC::Map::Entities::EntityState_Func::doSomethingWithOtherEntitiesOnTile, this)( + entityID); + MACRO_CALL_MEMBER(OpenSHC::IO::LowLevelMemory_Func::fillMemory_ByteValue, DAT_LowLevelMemory::ptr)( + sizeof(Entity), 0, &this->entityArray[entityID]); + } + + } +} +} diff --git a/src/OpenSHC/Map/Entities/EntityState/destroyEntitiesPart2.cpp b/src/OpenSHC/Map/Entities/EntityState/destroyEntitiesPart2.cpp new file mode 100644 index 000000000..3d2d332fa --- /dev/null +++ b/src/OpenSHC/Map/Entities/EntityState/destroyEntitiesPart2.cpp @@ -0,0 +1,19 @@ +#include "../EntityState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Entities { + + // FUNCTION: STRONGHOLDCRUSADER 0x00401B60 + void EntityState::destroyEntitiesPart2(int playerID) + { + for (int entityID = 1; entityID < 3000; ++entityID) { + if (this->entityArray[entityID].logicalState == 2 && this->entityArray[entityID].owner == playerID) { + this->entityArray[entityID].logicalState = 3; + } + } + } + + } +} +} diff --git a/src/OpenSHC/Map/Entities/EntityState/getFireEntityIDAtTile.cpp b/src/OpenSHC/Map/Entities/EntityState/getFireEntityIDAtTile.cpp new file mode 100644 index 000000000..689d70f86 --- /dev/null +++ b/src/OpenSHC/Map/Entities/EntityState/getFireEntityIDAtTile.cpp @@ -0,0 +1,27 @@ +#include "../EntityState.func.hpp" + +#include "OpenSHC/Map/Entities/EntityType.hpp" + +#include "OpenSHC/Globals/DAT_TileMapState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Entities { + + using OpenSHC::Map::Entities::EntityType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00401540 + int EntityState::getFireEntityIDAtTile(int tile) + { + for (int entityID = DAT_TileMapState::instance.EntityLayer[tile]; entityID != 0; + entityID = this->entityArray[entityID].nextEntityOnThisTileByID) { + if (this->entityArray[entityID].entityType == OpenSHC::Map::Entities::ET_FIRE) { + return entityID; + } + } + return 0; + } + + } +} +} diff --git a/src/OpenSHC/Map/Entities/EntityState/markEntityDestroyed.cpp b/src/OpenSHC/Map/Entities/EntityState/markEntityDestroyed.cpp new file mode 100644 index 000000000..d5deeb7cf --- /dev/null +++ b/src/OpenSHC/Map/Entities/EntityState/markEntityDestroyed.cpp @@ -0,0 +1,18 @@ +#include "../EntityState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Entities { + + // FUNCTION: STRONGHOLDCRUSADER 0x00401400 + void EntityState::markEntityDestroyed(int entityID) + { + if (entityID > 0) { + this->entityArray[entityID].logicalState = 3; + this->entityArray[entityID].someCounter_OR_hitGround = 10; + } + } + + } +} +} diff --git a/src/OpenSHC/Map/Entities/EntityState/reassignEntitiesOwner.cpp b/src/OpenSHC/Map/Entities/EntityState/reassignEntitiesOwner.cpp new file mode 100644 index 000000000..71a8eed13 --- /dev/null +++ b/src/OpenSHC/Map/Entities/EntityState/reassignEntitiesOwner.cpp @@ -0,0 +1,20 @@ +#include "../EntityState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Entities { + + // FUNCTION: STRONGHOLDCRUSADER 0x00401AE0 + void EntityState::reassignEntitiesOwner(int fromPlayerID, undefined4 toPlayerID) + { + for (int entityID = 1; entityID < 3000; ++entityID) { + if (this->entityArray[entityID].logicalState == 2 + && this->entityArray[entityID].owner == fromPlayerID) { + this->entityArray[entityID].owner = toPlayerID; + } + } + } + + } +} +} diff --git a/src/OpenSHC/Map/Entities/EntityState/tickEntityDecayCounter.cpp b/src/OpenSHC/Map/Entities/EntityState/tickEntityDecayCounter.cpp new file mode 100644 index 000000000..cbf35f6ba --- /dev/null +++ b/src/OpenSHC/Map/Entities/EntityState/tickEntityDecayCounter.cpp @@ -0,0 +1,19 @@ +#include "../EntityState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Entities { + + // FUNCTION: STRONGHOLDCRUSADER 0x00401430 + void EntityState::tickEntityDecayCounter(int entityID) + { + if (this->entityArray[entityID].unkMinusOne >= 31) { + this->entityArray[entityID].logicalState = 3; + return; + } + this->entityArray[entityID].unkMinusOne += 1; + } + + } +} +} diff --git a/src/OpenSHC/Map/Entities/IgniteFireAtMiniTile_Convenience.cpp b/src/OpenSHC/Map/Entities/IgniteFireAtMiniTile_Convenience.cpp new file mode 100644 index 000000000..6083bfd20 --- /dev/null +++ b/src/OpenSHC/Map/Entities/IgniteFireAtMiniTile_Convenience.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/Map/Entities.func.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x00407130 + uint Entities::IgniteFireAtMiniTile_Convenience( + int playerID, int miniTileX, int miniTileY, int tileHeightMin8, int two) + { + return MACRO_CALL(OpenSHC::Map::Entities_Func::IgniteFireAtMiniTile)( + playerID, miniTileX, miniTileY, tileHeightMin8, two, 0); + } + +} +} diff --git a/src/OpenSHC/Map/Entities/SetPlaceOnFire.cpp b/src/OpenSHC/Map/Entities/SetPlaceOnFire.cpp new file mode 100644 index 000000000..60ebf70f4 --- /dev/null +++ b/src/OpenSHC/Map/Entities/SetPlaceOnFire.cpp @@ -0,0 +1,13 @@ +#include "OpenSHC/Map/Entities.func.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x00407160 + void Entities::SetPlaceOnFire(int playerID, int x, int y, int height, int param_5) + { + MACRO_CALL(OpenSHC::Map::Entities_Func::AFireSpreadFunction)(playerID, x, y, height, param_5, 0); + } + +} +} diff --git a/src/OpenSHC/Map/Entities/UpdateBrazierEntity.cpp b/src/OpenSHC/Map/Entities/UpdateBrazierEntity.cpp new file mode 100644 index 000000000..985a7a94f --- /dev/null +++ b/src/OpenSHC/Map/Entities/UpdateBrazierEntity.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/Map/Entities.func.hpp" + +#include "OpenSHC/Globals/DAT_CurrentEntityID.hpp" +#include "OpenSHC/Globals/DAT_EntityState.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x00402AB0 + void Entities::UpdateBrazierEntity() + { + DAT_EntityState::instance.entityArray[DAT_CurrentEntityID::instance].graphicType2 + = ((byte)DAT_EntityState::instance.entityArray[DAT_CurrentEntityID::instance].unknownAnimationFrameRelated + & 7) + + DAT_EntityState::instance.entityArray[DAT_CurrentEntityID::instance].graphicType2RelatedOffset; + } + +} +} diff --git a/src/OpenSHC/Map/LandscapeState/Construct_LandscapeState.cpp b/src/OpenSHC/Map/LandscapeState/Construct_LandscapeState.cpp new file mode 100644 index 000000000..2a59d941c --- /dev/null +++ b/src/OpenSHC/Map/LandscapeState/Construct_LandscapeState.cpp @@ -0,0 +1,20 @@ +#include "OpenSHC/Map/LandscapeState.func.hpp" +#include "OpenSHC/Map/LandscapeState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::LandscapeState; + + // FUNCTION: STRONGHOLDCRUSADER 0x004F3930 + LandscapeState* LandscapeState::Construct_LandscapeState() + { + this->creationTime = timeGetTime(); + MACRO_CALL_MEMBER(OpenSHC::Map::LandscapeState_Func::clearRocksAndTrees, this)(); + MACRO_CALL_MEMBER(OpenSHC::Map::LandscapeState_Func::resetWind, this)(); + this->field1_0x4 = 1; + return this; + } + +} +} diff --git a/src/OpenSHC/Map/LandscapeState/getRandomRockImageOffset.cpp b/src/OpenSHC/Map/LandscapeState/getRandomRockImageOffset.cpp new file mode 100644 index 000000000..0de5302e0 --- /dev/null +++ b/src/OpenSHC/Map/LandscapeState/getRandomRockImageOffset.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/Map/LandscapeState.func.hpp" + +#include "OpenSHC/Globals/DAT_OrganismDefinedData.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x004F2A10 + int LandscapeState::getRandomRockImageOffset(int index) + { + return DAT_OrganismDefinedData::instance.RandomRockImageGMImageOffsets[index]; + } + +} +} diff --git a/src/OpenSHC/Map/LandscapeState/isTreeAdult.cpp b/src/OpenSHC/Map/LandscapeState/isTreeAdult.cpp new file mode 100644 index 000000000..31d161784 --- /dev/null +++ b/src/OpenSHC/Map/LandscapeState/isTreeAdult.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/Map/LandscapeState.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004F2FE0 + BOOLEnum LandscapeState::isTreeAdult(int treeID, int treeUID) + { + if (this->trees[treeID].uid != treeUID) { + return FALSE; + } + return (short)this->trees[treeID].treeAdultHoodStageRelatedVisual3 > 0; + } + +} +} diff --git a/src/OpenSHC/Map/LandscapeState/isTreeAliveAndMatchingUID.cpp b/src/OpenSHC/Map/LandscapeState/isTreeAliveAndMatchingUID.cpp new file mode 100644 index 000000000..b9020ddaa --- /dev/null +++ b/src/OpenSHC/Map/LandscapeState/isTreeAliveAndMatchingUID.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/Map/LandscapeState.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004F2FB0 + BOOLEnum LandscapeState::isTreeAliveAndMatchingUID(int treeID, int treeUID) + { + if (this->trees[treeID].uid != treeUID) { + return FALSE; + } + return this->trees[treeID].zeroUpTo2 == 0; + } + +} +} diff --git a/src/OpenSHC/Map/LandscapeState/resetWind.cpp b/src/OpenSHC/Map/LandscapeState/resetWind.cpp new file mode 100644 index 000000000..d7c186a31 --- /dev/null +++ b/src/OpenSHC/Map/LandscapeState/resetWind.cpp @@ -0,0 +1,17 @@ +#include "OpenSHC/Map/LandscapeState.func.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x004F3700 + void LandscapeState::resetWind() + { + this->wind.value = 0; + this->wind.index = 0; + this->wind.countdown = 0; + this->wind.field4_0x10 = 0; + this->wind.counter = 0; + } + +} +} diff --git a/src/OpenSHC/Map/LandscapeState/upgradeTreesAndRocksForMapVersion.cpp b/src/OpenSHC/Map/LandscapeState/upgradeTreesAndRocksForMapVersion.cpp new file mode 100644 index 000000000..079764c01 --- /dev/null +++ b/src/OpenSHC/Map/LandscapeState/upgradeTreesAndRocksForMapVersion.cpp @@ -0,0 +1,23 @@ +#include "OpenSHC/Map/LandscapeState.func.hpp" +#include "OpenSHC/Map/Version.func.hpp" +#include "OpenSHC/IO/PackagedFileMagicNum.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::IO::PackagedFileMagicNum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004F3D30 + void LandscapeState::upgradeTreesAndRocksForMapVersion( + PackagedFileMagicNum receivedMapVersion, PackagedFileMagicNum packagerMapVersion) + { + MACRO_CALL(OpenSHC::Map::Version_Func::UpdateTreesOfCertainTypes)(); + MACRO_CALL(OpenSHC::Map::Version_Func::UpdateFixTrees2)(); + MACRO_CALL(OpenSHC::Map::Version_Func::UpgradeRemoveCertainRockTypesUnk)(); + if (receivedMapVersion != packagerMapVersion && (int)receivedMapVersion < 165) { + MACRO_CALL(OpenSHC::Map::Version_Func::UpgradeRemoveRocksBeyond1000)(); + } + } + +} +} diff --git a/src/OpenSHC/Map/MapPropertiesState/isMercRecruitableForBuildingType.cpp b/src/OpenSHC/Map/MapPropertiesState/isMercRecruitableForBuildingType.cpp new file mode 100644 index 000000000..923c13dda --- /dev/null +++ b/src/OpenSHC/Map/MapPropertiesState/isMercRecruitableForBuildingType.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Map/MapPropertiesState.func.hpp" +#include "OpenSHC/Game/GameMode2.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Game::GameMode2; + + // FUNCTION: STRONGHOLDCRUSADER 0x004BB0B0 + int MapPropertiesState::isMercRecruitableForBuildingType(int buildingType) + { + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_EDITOR) { + return 1; + } + return this->buildingAvailabilityArray2[buildingType]; + } + +} +} diff --git a/src/OpenSHC/Map/MapPropertiesState/isValueInRangeOneToTwenty.cpp b/src/OpenSHC/Map/MapPropertiesState/isValueInRangeOneToTwenty.cpp new file mode 100644 index 000000000..65774e04e --- /dev/null +++ b/src/OpenSHC/Map/MapPropertiesState/isValueInRangeOneToTwenty.cpp @@ -0,0 +1,13 @@ +#include "OpenSHC/Map/MapPropertiesState.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004B77E0 + BOOLEnum MapPropertiesState::isValueInRangeOneToTwenty(int value) { return value - 1 < 20; } + +} +} diff --git a/src/OpenSHC/Map/MapPropertiesState/mapHasCertainEvent.cpp b/src/OpenSHC/Map/MapPropertiesState/mapHasCertainEvent.cpp new file mode 100644 index 000000000..72ce8fc62 --- /dev/null +++ b/src/OpenSHC/Map/MapPropertiesState/mapHasCertainEvent.cpp @@ -0,0 +1,22 @@ +#include "OpenSHC/Map/MapPropertiesState.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004B7890 + BOOLEnum MapPropertiesState::mapHasCertainEvent() + { + for (int i = 0; i < this->eventsCount; ++i) { + switch (this->scenarioEvents[i].header.tl_type) { + case 1: + return TRUE; + } + } + return FALSE; + } + +} +} diff --git a/src/OpenSHC/Map/MapPropertiesState/openEventTriggerMenu.cpp b/src/OpenSHC/Map/MapPropertiesState/openEventTriggerMenu.cpp new file mode 100644 index 000000000..3b9d64631 --- /dev/null +++ b/src/OpenSHC/Map/MapPropertiesState/openEventTriggerMenu.cpp @@ -0,0 +1,27 @@ +#include "OpenSHC/Game/ScenarioEvents/InGameEventUnionVersion.func.hpp" +#include "OpenSHC/Map/MapPropertiesState.func.hpp" +#include "OpenSHC/UI/MenuTextInputState.func.hpp" +#include "OpenSHC/Game/ScenarioEvents/InGameEventUnionVersion.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" + +#include "OpenSHC/Globals/DAT_MapPropertiesState.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Game::ScenarioEvents::InGameEventUnionVersion; + using OpenSHC::UI::Enums::MenuModalType; + + // FUNCTION: STRONGHOLDCRUSADER 0x004BB9F0 + void MapPropertiesState::openEventTriggerMenu(undefined4 eventType) + { + this->eventType = eventType; + MACRO_CALL_MEMBER(OpenSHC::Game::ScenarioEvents::InGameEventUnionVersion_Func::resetEvent, + (InGameEventUnionVersion*)&DAT_MapPropertiesState::instance.invasionEvent)(); + MACRO_CALL_MEMBER(OpenSHC::UI::MenuTextInputState_Func::activateModalDialogAndClearText, + DAT_MenuTextInputState::ptr)(OpenSHC::UI::Enums::MMT_TRIGGER_EVENT_OR_INVASION); + } + +} +} diff --git a/src/OpenSHC/Map/MapPropertiesState/sumInvasionEventUnitCount.cpp b/src/OpenSHC/Map/MapPropertiesState/sumInvasionEventUnitCount.cpp new file mode 100644 index 000000000..f9be50466 --- /dev/null +++ b/src/OpenSHC/Map/MapPropertiesState/sumInvasionEventUnitCount.cpp @@ -0,0 +1,20 @@ +#include "OpenSHC/Map/MapPropertiesState.func.hpp" + +#include "OpenSHC/Globals/DAT_MapPropertiesState.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x004BBA20 + int MapPropertiesState::sumInvasionEventUnitCount() + { + int sum = 0; + for (int i = 0; i < 25; ++i) { + sum += DAT_MapPropertiesState::instance.invasionEventContent.unitCountsPerUnitType[i]; + } + this->DAT_InvasionEventItemUnitCountSum = sum; + return sum; + } + +} +} diff --git a/src/OpenSHC/Map/Navigation/DirectionAlgorithmState/computeHealthPercentage.cpp b/src/OpenSHC/Map/Navigation/DirectionAlgorithmState/computeHealthPercentage.cpp new file mode 100644 index 000000000..bec1da57d --- /dev/null +++ b/src/OpenSHC/Map/Navigation/DirectionAlgorithmState/computeHealthPercentage.cpp @@ -0,0 +1,18 @@ +#include "../DirectionAlgorithmState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Navigation { + + // FUNCTION: STRONGHOLDCRUSADER 0x004092C0 + int DirectionAlgorithmState::computeHealthPercentage(int health, int maxHealth) + { + if (maxHealth == 0) { + return 100; + } + return (health * 100) / maxHealth; + } + + } +} +} diff --git a/src/OpenSHC/Map/Navigation/PathFindingState/bindPathPlanToAlgorithmStateAndReset.cpp b/src/OpenSHC/Map/Navigation/PathFindingState/bindPathPlanToAlgorithmStateAndReset.cpp new file mode 100644 index 000000000..def1d655f --- /dev/null +++ b/src/OpenSHC/Map/Navigation/PathFindingState/bindPathPlanToAlgorithmStateAndReset.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/Map/Navigation/PathFindingState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Navigation { + + // FUNCTION: STRONGHOLDCRUSADER 0x00496EA0 + void PathFindingState::bindPathPlanToAlgorithmStateAndReset(byte* pPathPlan) + { + this->searchQueue.ptrPathPlan = pPathPlan; + this->searchQueue.pathPlanIndex = 0; + } + + } +} +} diff --git a/src/OpenSHC/Map/Navigation/PathFindingState/clearAllClimbData.cpp b/src/OpenSHC/Map/Navigation/PathFindingState/clearAllClimbData.cpp new file mode 100644 index 000000000..80fbfda87 --- /dev/null +++ b/src/OpenSHC/Map/Navigation/PathFindingState/clearAllClimbData.cpp @@ -0,0 +1,18 @@ +#include "OpenSHC/Map/Navigation/PathFindingState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Navigation { + + // FUNCTION: STRONGHOLDCRUSADER 0x004A94E0 + void PathFindingState::clearAllClimbData() + { + this->numberOfClimbTeleports = 0; + for (int climbID = 0; climbID < 200; ++climbID) { + MACRO_CALL_MEMBER(OpenSHC::Map::Navigation::PathFindingState_Func::clearClimbData, this)(climbID); + } + } + + } +} +} diff --git a/src/OpenSHC/Map/Navigation/PathFindingState/clearClimbData.cpp b/src/OpenSHC/Map/Navigation/PathFindingState/clearClimbData.cpp new file mode 100644 index 000000000..693e80c9d --- /dev/null +++ b/src/OpenSHC/Map/Navigation/PathFindingState/clearClimbData.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/IO/LowLevelMemory.func.hpp" +#include "OpenSHC/Map/Navigation/PathFindingState.func.hpp" + +#include "OpenSHC/Globals/DAT_LowLevelMemory.hpp" + +namespace OpenSHC { +namespace Map { + namespace Navigation { + + // FUNCTION: STRONGHOLDCRUSADER 0x004A4B80 + void PathFindingState::clearClimbData(int climbID) + { + MACRO_CALL_MEMBER(OpenSHC::IO::LowLevelMemory_Func::fillMemory_ByteValue, DAT_LowLevelMemory::ptr)( + sizeof(this->climbData[climbID]), 0, &this->climbData[climbID]); + } + + } +} +} diff --git a/src/OpenSHC/Map/Navigation/PathFindingState/getComputationalTileIndex.cpp b/src/OpenSHC/Map/Navigation/PathFindingState/getComputationalTileIndex.cpp new file mode 100644 index 000000000..b5329ac1f --- /dev/null +++ b/src/OpenSHC/Map/Navigation/PathFindingState/getComputationalTileIndex.cpp @@ -0,0 +1,12 @@ +#include "OpenSHC/Map/Navigation/PathFindingState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Navigation { + + // FUNCTION: STRONGHOLDCRUSADER 0x00496E20 + undefined4 PathFindingState::getComputationalTileIndex() { return this->searchQueue.writeIndex; } + + } // namespace Navigation +} // namespace Map +} // namespace OpenSHC diff --git a/src/OpenSHC/Map/Navigation/PathFindingState/getTileInSearchQueue.cpp b/src/OpenSHC/Map/Navigation/PathFindingState/getTileInSearchQueue.cpp new file mode 100644 index 000000000..1b76cae82 --- /dev/null +++ b/src/OpenSHC/Map/Navigation/PathFindingState/getTileInSearchQueue.cpp @@ -0,0 +1,12 @@ +#include "OpenSHC/Map/Navigation/PathFindingState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Navigation { + + // FUNCTION: STRONGHOLDCRUSADER 0x00496E30 + int PathFindingState::getTileInSearchQueue(int index) { return this->searchQueue.tilesQueue[index]; } + + } +} +} diff --git a/src/OpenSHC/Map/Navigation/PathFindingState/getYSmallerThanYLimit.cpp b/src/OpenSHC/Map/Navigation/PathFindingState/getYSmallerThanYLimit.cpp new file mode 100644 index 000000000..7e1e89c5a --- /dev/null +++ b/src/OpenSHC/Map/Navigation/PathFindingState/getYSmallerThanYLimit.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/Map/Navigation/PathFindingState.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Map { + namespace Navigation { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x0049B1C0 + BOOLEnum PathFindingState::getYSmallerThanYLimit() { return this->mappingYRelated <= this->yLimit; } + + } +} +} diff --git a/src/OpenSHC/Map/Navigation/PathFindingState/retraceAndCommitPathPlan.cpp b/src/OpenSHC/Map/Navigation/PathFindingState/retraceAndCommitPathPlan.cpp new file mode 100644 index 000000000..592967e90 --- /dev/null +++ b/src/OpenSHC/Map/Navigation/PathFindingState/retraceAndCommitPathPlan.cpp @@ -0,0 +1,18 @@ +#include "OpenSHC/Map/Navigation/PathFindingState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Navigation { + + // FUNCTION: STRONGHOLDCRUSADER 0x004A9DD0 + undefined4 PathFindingState::retraceAndCommitPathPlan() + { + this->searchQueue.pathPlanIndex = 0; + MACRO_CALL_MEMBER(OpenSHC::Map::Navigation::PathFindingState_Func::traceAndCommitPathPlan, this)( + this->unitX, this->unitY, this->destinationX, this->destinationY, 0); + return this->searchQueue.pathPlanIndex; + } + + } +} +} diff --git a/src/OpenSHC/Map/Navigation/PathFindingState/updatePathLinkageLayerForEachBuildingAtEachTile.cpp b/src/OpenSHC/Map/Navigation/PathFindingState/updatePathLinkageLayerForEachBuildingAtEachTile.cpp new file mode 100644 index 000000000..4d656c28f --- /dev/null +++ b/src/OpenSHC/Map/Navigation/PathFindingState/updatePathLinkageLayerForEachBuildingAtEachTile.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Map/Navigation/PathFindingState.func.hpp" + +#include "OpenSHC/Globals/DAT_ViewportRenderState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Navigation { + + // FUNCTION: STRONGHOLDCRUSADER 0x004A5F60 + void PathFindingState::updatePathLinkageLayerForEachBuildingAtEachTile() + { + for (int tileIndex = 0; tileIndex < 80400; ++tileIndex) { + MACRO_CALL_MEMBER( + OpenSHC::Map::Navigation::PathFindingState_Func::updatePathLinkageLayerBasedOnBuildingsUnk, this)( + DAT_ViewportRenderState::instance.tileTranslationMatrix_YComponent[tileIndex], tileIndex); + } + } + + } +} +} diff --git a/src/OpenSHC/Map/TileMapState/clearMoatData.cpp b/src/OpenSHC/Map/TileMapState/clearMoatData.cpp new file mode 100644 index 000000000..b98790b2e --- /dev/null +++ b/src/OpenSHC/Map/TileMapState/clearMoatData.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/IO/LowLevelMemory.func.hpp" +#include "OpenSHC/Map/TileMapState.func.hpp" + +#include "OpenSHC/Globals/DAT_LowLevelMemory.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x005002D0 + void TileMapState::clearMoatData(uint moatID) + { + if (moatID > 15999) { + return; + } + MACRO_CALL_MEMBER(OpenSHC::IO::LowLevelMemory_Func::fillMemory_ByteValue, DAT_LowLevelMemory::ptr)( + sizeof(this->moats[moatID]), 0, &this->moats[moatID]); + this->moatTileCount -= 1; + } + +} +} diff --git a/src/OpenSHC/Map/TileMapState/forceFullTileMapRedraw.cpp b/src/OpenSHC/Map/TileMapState/forceFullTileMapRedraw.cpp new file mode 100644 index 000000000..50d530182 --- /dev/null +++ b/src/OpenSHC/Map/TileMapState/forceFullTileMapRedraw.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/Map/TileMapState.func.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x005017A0 + void TileMapState::forceFullTileMapRedraw() + { + this->forceUpdateLogicalAndMiscDisplayLayers = 1; + this->forceUpdateTextureTilemap = 1; + this->forceUpdateGFXLayers = 1; + MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::setChangedLayerToThreeAndMapping0x40x40, this)(); + } + +} +} diff --git a/src/OpenSHC/Map/TileMapState/getUnownedMoatCount.cpp b/src/OpenSHC/Map/TileMapState/getUnownedMoatCount.cpp new file mode 100644 index 000000000..ffc44e507 --- /dev/null +++ b/src/OpenSHC/Map/TileMapState/getUnownedMoatCount.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/Map/TileMapState.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x00500210 + int TileMapState::getUnownedMoatCount() + { + int unownedMoatCount = 0; + for (int i = 1; i < 16000; ++i) { + if (this->moats[i].owner == 0) { + unownedMoatCount += 1; + } + } + return unownedMoatCount; + } + +} // namespace Map +} // namespace OpenSHC diff --git a/src/OpenSHC/Map/TileMapState/processDamageToBuildingThunk.cpp b/src/OpenSHC/Map/TileMapState/processDamageToBuildingThunk.cpp new file mode 100644 index 000000000..9a0c3244a --- /dev/null +++ b/src/OpenSHC/Map/TileMapState/processDamageToBuildingThunk.cpp @@ -0,0 +1,19 @@ +#include "../TileMapState.func.hpp" + +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00409300 + BOOLEnum TileMapState::processDamageToBuildingThunk(int targetedTile, uint targetedTileX, uint targetedTileY, + int damage, int param_5, int playerID, BOOLEnum aiBuildDelayRelated) + { + return MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::processDamageToBuilding, this)( + targetedTile, targetedTileX, targetedTileY, damage, param_5, playerID, aiBuildDelayRelated, 0); + } + +} +} diff --git a/src/OpenSHC/Map/TileMapState/processEntityDamageToBuildingCollateralThunk.cpp b/src/OpenSHC/Map/TileMapState/processEntityDamageToBuildingCollateralThunk.cpp new file mode 100644 index 000000000..1f8d85fee --- /dev/null +++ b/src/OpenSHC/Map/TileMapState/processEntityDamageToBuildingCollateralThunk.cpp @@ -0,0 +1,15 @@ +#include "../TileMapState.func.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x00401060 + void TileMapState::processEntityDamageToBuildingCollateralThunk( + int tile, uint x_2, uint y_2, int damage, int playerID, undefined4 unused) + { + MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::processEntityDamageToBuildingCollateral, this)( + tile, x_2, y_2, damage, playerID, unused, 0); + } + +} +} diff --git a/src/OpenSHC/Map/TileMapState/processMapOrientationChange.cpp b/src/OpenSHC/Map/TileMapState/processMapOrientationChange.cpp new file mode 100644 index 000000000..3c4450873 --- /dev/null +++ b/src/OpenSHC/Map/TileMapState/processMapOrientationChange.cpp @@ -0,0 +1,17 @@ +#include "OpenSHC/Map/TileMapState.func.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x00512920 + void TileMapState::processMapOrientationChange() + { + if ((int)this->DAT_FutureMapOrientation < 8) { + MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::changeMapOrientation, this)( + this->DAT_FutureMapOrientation); + this->DAT_FutureMapOrientation = 8; + } + } + +} +} diff --git a/src/OpenSHC/Map/TileMapState/recountTotalOwnedMoats.cpp b/src/OpenSHC/Map/TileMapState/recountTotalOwnedMoats.cpp new file mode 100644 index 000000000..a4bb5f1a7 --- /dev/null +++ b/src/OpenSHC/Map/TileMapState/recountTotalOwnedMoats.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/Map/TileMapState.func.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x005000A0 + void TileMapState::recountTotalOwnedMoats() + { + this->currentMoatCount = 0; + for (int i = 1; i < 16000; ++i) { + if (this->moats[i].owner != 0) { + // not a count: one past the highest owned moat index, used as loop bound + this->currentMoatCount = i + 1; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/TileMapState/resetMoatArray.cpp b/src/OpenSHC/Map/TileMapState/resetMoatArray.cpp new file mode 100644 index 000000000..ee652655d --- /dev/null +++ b/src/OpenSHC/Map/TileMapState/resetMoatArray.cpp @@ -0,0 +1,23 @@ +#include "OpenSHC/IO/LowLevelMemory.func.hpp" +#include "OpenSHC/Map/TileMapState.func.hpp" +#include "OpenSHC/Map/Moat.hpp" + +#include "OpenSHC/Globals/DAT_LowLevelMemory.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Moat; + + // FUNCTION: STRONGHOLDCRUSADER 0x00500680 + void TileMapState::resetMoatArray() + { + for (int i = 0; i < 16000; ++i) { + MACRO_CALL_MEMBER(OpenSHC::IO::LowLevelMemory_Func::fillMemory_ByteValue, DAT_LowLevelMemory::ptr)( + sizeof(this->moats[i]), 0, &this->moats[i]); + } + this->moatTileCount = 0; + } + +} +} diff --git a/src/OpenSHC/Map/TileMapState/resetPitchDitchArray.cpp b/src/OpenSHC/Map/TileMapState/resetPitchDitchArray.cpp new file mode 100644 index 000000000..c42ebcba0 --- /dev/null +++ b/src/OpenSHC/Map/TileMapState/resetPitchDitchArray.cpp @@ -0,0 +1,23 @@ +#include "OpenSHC/IO/LowLevelMemory.func.hpp" +#include "OpenSHC/Map/TileMapState.func.hpp" +#include "OpenSHC/Map/PitchDitch.hpp" + +#include "OpenSHC/Globals/DAT_LowLevelMemory.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::PitchDitch; + + // FUNCTION: STRONGHOLDCRUSADER 0x005007D0 + void TileMapState::resetPitchDitchArray() + { + this->maxPitchDitchCount = 4000; + for (int i = 0; i < 4000; ++i) { + MACRO_CALL_MEMBER(OpenSHC::IO::LowLevelMemory_Func::fillMemory_ByteValue, DAT_LowLevelMemory::ptr)( + sizeof(this->pitchDitches[i]), 0, &this->pitchDitches[i]); + } + } + +} +} diff --git a/src/OpenSHC/Map/TileMapState/setMapRotation.cpp b/src/OpenSHC/Map/TileMapState/setMapRotation.cpp new file mode 100644 index 000000000..2aa68190e --- /dev/null +++ b/src/OpenSHC/Map/TileMapState/setMapRotation.cpp @@ -0,0 +1,10 @@ +#include "../TileMapState.func.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x004F70E0 + void TileMapState::setMapRotation(undefined4 newRotation) { this->DAT_FutureMapOrientation = newRotation; } + +} +} diff --git a/src/OpenSHC/Map/TileMapState/setMoatOwnerForAllMatching.cpp b/src/OpenSHC/Map/TileMapState/setMoatOwnerForAllMatching.cpp new file mode 100644 index 000000000..59310e878 --- /dev/null +++ b/src/OpenSHC/Map/TileMapState/setMoatOwnerForAllMatching.cpp @@ -0,0 +1,17 @@ +#include "OpenSHC/Map/TileMapState.func.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x00500750 + void TileMapState::setMoatOwnerForAllMatching(int fromPlayerID, undefined4 toPlayerID) + { + for (int i = 1; i < 16000; ++i) { + if (this->moats[i].owner != 0 && this->moats[i].owner == fromPlayerID) { + this->moats[i].owner = toPlayerID; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/TileMapState/setMoatVisualStateAtTile.cpp b/src/OpenSHC/Map/TileMapState/setMoatVisualStateAtTile.cpp new file mode 100644 index 000000000..d69085c59 --- /dev/null +++ b/src/OpenSHC/Map/TileMapState/setMoatVisualStateAtTile.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/Map/TileMapState.func.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x00500720 + void TileMapState::setMoatVisualStateAtTile(int tile, undefined4 zeroOrTwo) + { + int const moatID = MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::returnOwnedMoatAtTile, this)(tile); + if (moatID != 0) { + this->moats[moatID].zeroOrTwo = zeroOrTwo; + } + } + +} +} diff --git a/src/OpenSHC/Map/TileMapState/spreadBrazierPlacementAlgorithm.cpp b/src/OpenSHC/Map/TileMapState/spreadBrazierPlacementAlgorithm.cpp new file mode 100644 index 000000000..3c1637395 --- /dev/null +++ b/src/OpenSHC/Map/TileMapState/spreadBrazierPlacementAlgorithm.cpp @@ -0,0 +1,17 @@ +#include "OpenSHC/Map/Navigation/PathFindingState.func.hpp" +#include "OpenSHC/Map/TileMapState.func.hpp" + +#include "OpenSHC/Globals/DAT_PathFindingState.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x005011A0 + void TileMapState::spreadBrazierPlacementAlgorithm(int playerID, uint x, uint y) + { + MACRO_CALL_MEMBER(OpenSHC::Map::Navigation::PathFindingState_Func::spreadAlgorithmForFlagsAndBraziersUnk, + DAT_PathFindingState::ptr)(playerID, x, y, 4, 1); + } + +} +} diff --git a/src/OpenSHC/Map/TileMapState/spreadFlagPlacementAlgorithm.cpp b/src/OpenSHC/Map/TileMapState/spreadFlagPlacementAlgorithm.cpp new file mode 100644 index 000000000..ffaf4fc83 --- /dev/null +++ b/src/OpenSHC/Map/TileMapState/spreadFlagPlacementAlgorithm.cpp @@ -0,0 +1,17 @@ +#include "OpenSHC/Map/Navigation/PathFindingState.func.hpp" +#include "OpenSHC/Map/TileMapState.func.hpp" + +#include "OpenSHC/Globals/DAT_PathFindingState.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x00501180 + int TileMapState::spreadFlagPlacementAlgorithm(int playerID, uint x, uint y) + { + return MACRO_CALL_MEMBER(OpenSHC::Map::Navigation::PathFindingState_Func::spreadAlgorithmForFlagsAndBraziersUnk, + DAT_PathFindingState::ptr)(playerID, x, y, 4, 0); + } + +} +} diff --git a/src/OpenSHC/Map/TileMapState/toggleFlatView.cpp b/src/OpenSHC/Map/TileMapState/toggleFlatView.cpp new file mode 100644 index 000000000..4edcf1b2b --- /dev/null +++ b/src/OpenSHC/Map/TileMapState/toggleFlatView.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/Map/TileMapState.func.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x004F70B0 + void TileMapState::toggleFlatView(int flatView) + { + if (flatView != this->flatViewToggleValue1) { + this->flatViewToggleValue1 = flatView; + this->flatViewToggleValue2 = flatView; + } + } + +} +} diff --git a/src/OpenSHC/Map/TileMapState/updateBuildingPlacementRotationPreview.cpp b/src/OpenSHC/Map/TileMapState/updateBuildingPlacementRotationPreview.cpp new file mode 100644 index 000000000..d125f4f13 --- /dev/null +++ b/src/OpenSHC/Map/TileMapState/updateBuildingPlacementRotationPreview.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/Map/TileMapState.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00504EE0 + void TileMapState::updateBuildingPlacementRotationPreview(int x, int y) + { + BOOLEnum const previousPlacementFail = this->buildingPlacementFail; + this->buildingPlacementFail = FALSE; + MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::determineBuildingPlacementRotation, this)(x, y); + this->buildingPlacementFail = previousPlacementFail; + } + +} +} diff --git a/src/OpenSHC/Map/TileMapState/updateMoatCountdownTimers.cpp b/src/OpenSHC/Map/TileMapState/updateMoatCountdownTimers.cpp new file mode 100644 index 000000000..d8f384ce1 --- /dev/null +++ b/src/OpenSHC/Map/TileMapState/updateMoatCountdownTimers.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Map/TileMapState.func.hpp" +#include "OpenSHC/Map/Moat.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Moat; + + // FUNCTION: STRONGHOLDCRUSADER 0x00500640 + void TileMapState::updateMoatCountdownTimers() + { + MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::recountTotalOwnedMoats, this)(); + for (int i = 0; i < this->currentMoatCount; ++i) { + if (this->moats[i].owner != 0 && this->moats[i].someCountDown > 0) { + this->moats[i].someCountDown -= 1; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/Trees/UpdateTree16.cpp b/src/OpenSHC/Map/Trees/UpdateTree16.cpp new file mode 100644 index 000000000..8a2cf2c94 --- /dev/null +++ b/src/OpenSHC/Map/Trees/UpdateTree16.cpp @@ -0,0 +1,18 @@ +#include "OpenSHC/Map/Trees.func.hpp" + +#include "OpenSHC/Globals/DAT_CurrentTreeID.hpp" +#include "OpenSHC/Globals/DAT_LandscapeState.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x004F28F0 + void Trees::UpdateTree16() + { + int const frame = (DAT_LandscapeState::instance.trees[DAT_CurrentTreeID::instance].rng1 & 7U) + 10; + DAT_LandscapeState::instance.trees[DAT_CurrentTreeID::instance].animationFrameUnk = frame; + DAT_LandscapeState::instance.trees[DAT_CurrentTreeID::instance].animationFrame2Unk = frame; + } + +} +} diff --git a/src/OpenSHC/Map/Units/CheckUnitProductionPaused.cpp b/src/OpenSHC/Map/Units/CheckUnitProductionPaused.cpp new file mode 100644 index 000000000..531176444 --- /dev/null +++ b/src/OpenSHC/Map/Units/CheckUnitProductionPaused.cpp @@ -0,0 +1,18 @@ +#include "OpenSHC/Map/Units.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00530D50 + BOOLEnum Units::CheckUnitProductionPaused(int unitID) + { + return DAT_UnitsState::instance.units[unitID].field166_0x2fe == 1; + } + +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/Constructor_TribesState.cpp b/src/OpenSHC/Map/Units/TribesState/Constructor_TribesState.cpp new file mode 100644 index 000000000..0e233370a --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/Constructor_TribesState.cpp @@ -0,0 +1,23 @@ +#include "../TribesState.func.hpp" + +#include "OpenSHC/Map/Units/TribesState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Map::Units::TribesState; + + // FUNCTION: STRONGHOLDCRUSADER 0x00521180 + TribesState* TribesState::Constructor_TribesState() + { + this->constructorTime = timeGetTime(); + this->clans = 0; + this->fcn_mtribe = 0; + this->field2_0x8 = 1; + return this; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/addUnitToSelected.cpp b/src/OpenSHC/Map/Units/TribesState/addUnitToSelected.cpp new file mode 100644 index 000000000..426837812 --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/addUnitToSelected.cpp @@ -0,0 +1,21 @@ +#include "../TribesState.func.hpp" + +#include "OpenSHC/Globals/DAT_UnitSelectionDefinedData.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x00522520 + void TribesState::addUnitToSelected(int unitID) + { + int const bitFlagsIndex = unitID / 16; + int const bitMaskIndex = unitID % 16; + ((short*)DAT_UnitsState::instance.selectedUnitsBitFlags)[bitFlagsIndex] + |= DAT_UnitSelectionDefinedData::instance.BitMaskHelper[bitMaskIndex]; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/clearTribe.cpp b/src/OpenSHC/Map/Units/TribesState/clearTribe.cpp new file mode 100644 index 000000000..676d8b6ee --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/clearTribe.cpp @@ -0,0 +1,20 @@ +#include "../TribesState.func.hpp" + +#include "OpenSHC/IO/LowLevelMemory.func.hpp" + +#include "OpenSHC/Globals/DAT_LowLevelMemory.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x00522BC0 + void TribesState::clearTribe(int tribeID) + { + MACRO_CALL_MEMBER(OpenSHC::IO::LowLevelMemory_Func::fillMemory_ByteValue, DAT_LowLevelMemory::ptr)( + sizeof(this->tribes[tribeID]), 0, &this->tribes[tribeID]); + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/giveUnitSelectionMoveInstructionNoMatchedSpeed.cpp b/src/OpenSHC/Map/Units/TribesState/giveUnitSelectionMoveInstructionNoMatchedSpeed.cpp new file mode 100644 index 000000000..7d9cb9f9f --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/giveUnitSelectionMoveInstructionNoMatchedSpeed.cpp @@ -0,0 +1,21 @@ +#include "../TribesState.func.hpp" + +#include "OpenSHC/Map/Units/Instructions/UnitMatchSpeedEnum.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Map::Units::Instructions::UnitMatchSpeedEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004B7700 + void TribesState::giveUnitSelectionMoveInstructionNoMatchedSpeed( + int tribeID, uint x, uint y, int rallyBool, int doRally) + { + MACRO_CALL_MEMBER(OpenSHC::Map::Units::TribesState_Func::giveTribeMoveInstruction, this)( + tribeID, x, y, rallyBool, doRally, Units::Instructions::UMSE_0); + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/markTribeAsAnimalTribe.cpp b/src/OpenSHC/Map/Units/TribesState/markTribeAsAnimalTribe.cpp new file mode 100644 index 000000000..28550b718 --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/markTribeAsAnimalTribe.cpp @@ -0,0 +1,12 @@ +#include "../TribesState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x00523730 + void TribesState::markTribeAsAnimalTribe(int tribeID) { this->tribes[tribeID].unkIsAnimalTribe = 1; } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/playArcherCommandSpeech.cpp b/src/OpenSHC/Map/Units/TribesState/playArcherCommandSpeech.cpp new file mode 100644 index 000000000..cfe4c6794 --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/playArcherCommandSpeech.cpp @@ -0,0 +1,25 @@ +#include "../TribesState.func.hpp" + +#include "OpenSHC/Audio/SFX/SFXState.func.hpp" +#include "OpenSHC/Map/Units/UnitType.hpp" + +#include "OpenSHC/Globals/DAT_SFXState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Map::Units::UnitType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00525090 + void TribesState::playArcherCommandSpeech(int selectionID) + { + MACRO_CALL_MEMBER(OpenSHC::Audio::SFX::SFXState_Func::playUnitSpeech, DAT_SFXState::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Map::Units::TribesState_Func::getMajorityArcherTypeEuropeanOrArabian, this)( + selectionID), + 0x1f); + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/playPatrolCommandSpeech.cpp b/src/OpenSHC/Map/Units/TribesState/playPatrolCommandSpeech.cpp new file mode 100644 index 000000000..a66d1a2d3 --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/playPatrolCommandSpeech.cpp @@ -0,0 +1,29 @@ +#include "../TribesState.func.hpp" + +#include "OpenSHC/Audio/SFX/SFXState.func.hpp" +#include "OpenSHC/Map/Units/UnitsState.func.hpp" +#include "OpenSHC/Map/Units/UnitType.hpp" + +#include "OpenSHC/Globals/DAT_SFXState.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Map::Units::UnitType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00522110 + void TribesState::playPatrolCommandSpeech(undefined4 selectionID) + { + MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::selectionContainsCombatUnit, DAT_UnitsState::ptr)( + 1); + MACRO_CALL_MEMBER(OpenSHC::Audio::SFX::SFXState_Func::playUnitSpeech, DAT_SFXState::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Map::Units::TribesState_Func::getMajoritySelectedUnitType, this)( + selectionID, (int*)&selectionID), + 0x29); + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/playTunnelerCommandSpeech.cpp b/src/OpenSHC/Map/Units/TribesState/playTunnelerCommandSpeech.cpp new file mode 100644 index 000000000..329a08b71 --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/playTunnelerCommandSpeech.cpp @@ -0,0 +1,23 @@ +#include "../TribesState.func.hpp" + +#include "OpenSHC/Audio/SFX/SFXState.func.hpp" +#include "OpenSHC/Map/Units/UnitType.hpp" + +#include "OpenSHC/Globals/DAT_SFXState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Map::Units::UnitType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00522150 + void TribesState::playTunnelerCommandSpeech() + { + MACRO_CALL_MEMBER(OpenSHC::Audio::SFX::SFXState_Func::playUnitSpeech, DAT_SFXState::ptr)( + OpenSHC::Map::Units::UT_TUNNELER, 0x27); + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/playUnitSelectSpeech.cpp b/src/OpenSHC/Map/Units/TribesState/playUnitSelectSpeech.cpp new file mode 100644 index 000000000..cf755333e --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/playUnitSelectSpeech.cpp @@ -0,0 +1,29 @@ +#include "../TribesState.func.hpp" + +#include "OpenSHC/Audio/SFX/SFXState.func.hpp" +#include "OpenSHC/Map/Units/UnitsState.func.hpp" +#include "OpenSHC/Map/Units/UnitType.hpp" + +#include "OpenSHC/Globals/DAT_SFXState.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Map::Units::UnitType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00521EB0 + void TribesState::playUnitSelectSpeech(undefined4 selectionID) + { + MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::selectionContainsCombatUnit, DAT_UnitsState::ptr)( + 1); + UnitType const unitType + = MACRO_CALL_MEMBER(OpenSHC::Map::Units::TribesState_Func::getMajoritySelectedUnitType, this)( + selectionID, (int*)&selectionID); + MACRO_CALL_MEMBER(OpenSHC::Audio::SFX::SFXState_Func::playUnitSpeech, DAT_SFXState::ptr)(unitType, 0xb); + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/playWorkCommandSpeech.cpp b/src/OpenSHC/Map/Units/TribesState/playWorkCommandSpeech.cpp new file mode 100644 index 000000000..372249e68 --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/playWorkCommandSpeech.cpp @@ -0,0 +1,29 @@ +#include "../TribesState.func.hpp" + +#include "OpenSHC/Audio/SFX/SFXState.func.hpp" +#include "OpenSHC/Map/Units/UnitsState.func.hpp" +#include "OpenSHC/Map/Units/UnitType.hpp" + +#include "OpenSHC/Globals/DAT_SFXState.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Map::Units::UnitType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00522160 + void TribesState::playWorkCommandSpeech(undefined4 selectionID) + { + MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::selectionContainsCombatUnit, DAT_UnitsState::ptr)( + 1); + MACRO_CALL_MEMBER(OpenSHC::Audio::SFX::SFXState_Func::playUnitSpeech, DAT_SFXState::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Map::Units::TribesState_Func::getMajoritySelectedUnitType, this)( + selectionID, (int*)&selectionID), + 0x24); + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/popUnitFromTribe.cpp b/src/OpenSHC/Map/Units/TribesState/popUnitFromTribe.cpp new file mode 100644 index 000000000..56dcd5ba3 --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/popUnitFromTribe.cpp @@ -0,0 +1,20 @@ +#include "../TribesState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x00525B70 + int TribesState::popUnitFromTribe(int tribeID) + { + int const unitID + = MACRO_CALL_MEMBER(OpenSHC::Map::Units::TribesState_Func::getUnitIDForIndexInTribe, this)(tribeID, 0); + if (unitID != 0) { + MACRO_CALL_MEMBER(OpenSHC::Map::Units::TribesState_Func::removeUnitFromTribe, this)(unitID, tribeID); + } + return unitID; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/queueUnitStance.cpp b/src/OpenSHC/Map/Units/TribesState/queueUnitStance.cpp new file mode 100644 index 000000000..7805620ba --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/queueUnitStance.cpp @@ -0,0 +1,25 @@ +#include "../TribesState.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandType.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Commands::GameCommandType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00522BF0 + void TribesState::queueUnitStance(undefined4 stanceID, undefined4 param_2) + { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = stanceID; + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = param_2; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)( + OpenSHC::Commands::GCT_UNIT_STANCE); + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/reassignOwnerForTribesOfBehaviorType2.cpp b/src/OpenSHC/Map/Units/TribesState/reassignOwnerForTribesOfBehaviorType2.cpp new file mode 100644 index 000000000..0aa70c718 --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/reassignOwnerForTribesOfBehaviorType2.cpp @@ -0,0 +1,23 @@ +#include "../TribesState.func.hpp" + +#include "OpenSHC/Globals/DAT_TribesState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x00521210 + void TribesState::reassignOwnerForTribesOfBehaviorType2(int fromPlayerID, int toPlayerID) + { + // the original reads DAT_TribesState::instance instead of this + for (int i = 1; i < 1250; ++i) { + if (DAT_TribesState::instance.tribes[i].tribeState == 2 + && DAT_TribesState::instance.tribes[i].owner == fromPlayerID) { + DAT_TribesState::instance.tribes[i].owner = toPlayerID; + } + } + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/setCamelSpawnXY.cpp b/src/OpenSHC/Map/Units/TribesState/setCamelSpawnXY.cpp new file mode 100644 index 000000000..2b5e21089 --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/setCamelSpawnXY.cpp @@ -0,0 +1,22 @@ +#include "../TribesState.func.hpp" + +#include "OpenSHC/Globals/DAT_GameState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x005233E0 + void TribesState::setCamelSpawnXY(undefined4 x, undefined4 y) + { + for (int i = 0; i < 4; ++i) { + if (DAT_GameState::instance.mapAndTime.camelSpawnXY[i].x == 0) { + DAT_GameState::instance.mapAndTime.camelSpawnXY[i].x = x; + DAT_GameState::instance.mapAndTime.camelSpawnXY[i].y = y; + } + } + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/setUnitStance.cpp b/src/OpenSHC/Map/Units/TribesState/setUnitStance.cpp new file mode 100644 index 000000000..57f79965e --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/setUnitStance.cpp @@ -0,0 +1,22 @@ +#include "../TribesState.func.hpp" + +#include "OpenSHC/Map/Units/Behavior/UnitStanceEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Map::Units::Behavior::UnitStanceEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00522C20 + void TribesState::setUnitStance(int tribeID, UnitStanceEnum unitStance) + { + this->tribes[tribeID].unitStance = unitStance; + DAT_GameCore::instance.countdown = 1; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/setWhetherTribeContainsAnyUnits.cpp b/src/OpenSHC/Map/Units/TribesState/setWhetherTribeContainsAnyUnits.cpp new file mode 100644 index 000000000..e80e4fd27 --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/setWhetherTribeContainsAnyUnits.cpp @@ -0,0 +1,22 @@ +#include "../TribesState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x005224E0 + int TribesState::setWhetherTribeContainsAnyUnits(int tribeID) + { + int i = 0; + for (; i < 200; ++i) { + if (this->tribes[tribeID].unitSelectionBitMasked[i] != 0) { + this->tribes[tribeID].highestID = i; + break; + } + } + return i; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/storeDeerXAndYinMapInfo.cpp b/src/OpenSHC/Map/Units/TribesState/storeDeerXAndYinMapInfo.cpp new file mode 100644 index 000000000..6710b8e19 --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/storeDeerXAndYinMapInfo.cpp @@ -0,0 +1,22 @@ +#include "../TribesState.func.hpp" + +#include "OpenSHC/Globals/DAT_GameState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x00523340 + void TribesState::storeDeerXAndYinMapInfo(undefined4 x, undefined4 y) + { + for (int i = 0; i < 4; ++i) { + if (DAT_GameState::instance.mapAndTime.deerSpawnLocationsXY[i].x == 0) { + DAT_GameState::instance.mapAndTime.deerSpawnLocationsXY[i].x = x; + DAT_GameState::instance.mapAndTime.deerSpawnLocationsXY[i].y = y; + } + } + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/storeLionXAndYInMapInfo.cpp b/src/OpenSHC/Map/Units/TribesState/storeLionXAndYInMapInfo.cpp new file mode 100644 index 000000000..f19d2aab6 --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/storeLionXAndYInMapInfo.cpp @@ -0,0 +1,26 @@ +#include "../TribesState.func.hpp" + +#include "OpenSHC/Map/Location/Point4ShortXY.hpp" + +#include "OpenSHC/Globals/DAT_GameState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Map::Location::Point4ShortXY; + + // FUNCTION: STRONGHOLDCRUSADER 0x00523370 + void TribesState::storeLionXAndYInMapInfo(undefined4 x, undefined4 y) + { + for (int i = 0; i < 4; ++i) { + if (DAT_GameState::instance.mapAndTime.lionLocationsXY[i].x == 0) { + DAT_GameState::instance.mapAndTime.lionLocationsXY[i].x = x; + DAT_GameState::instance.mapAndTime.lionLocationsXY[i].y = y; + } + } + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/tribeCorrespondsWithUID.cpp b/src/OpenSHC/Map/Units/TribesState/tribeCorrespondsWithUID.cpp new file mode 100644 index 000000000..d0d494051 --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/tribeCorrespondsWithUID.cpp @@ -0,0 +1,22 @@ +#include "../TribesState.func.hpp" + +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00522360 + BOOLEnum TribesState::tribeCorrespondsWithUID(int tribeID, uint tribeUID) + { + if (tribeUID == 0) { + return FALSE; + } + return this->tribes[tribeID].uid == tribeUID; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/upgradeMapTribesState.cpp b/src/OpenSHC/Map/Units/TribesState/upgradeMapTribesState.cpp new file mode 100644 index 000000000..ae5da3b87 --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/upgradeMapTribesState.cpp @@ -0,0 +1,25 @@ +#include "../TribesState.func.hpp" + +#include "OpenSHC/Map/Version.func.hpp" +#include "OpenSHC/IO/PackagedFileMagicNum.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::IO::PackagedFileMagicNum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00526370 + void TribesState::upgradeMapTribesState( + PackagedFileMagicNum receivedMapVersion, PackagedFileMagicNum packagerMapVersion) + { + MACRO_CALL(OpenSHC::Map::Version_Func::UpgradeMapTribesStateVersionTo_Unknown1)(); + MACRO_CALL(OpenSHC::Map::Version_Func::UpgradeMapTribesStateVersionTo_Unknown2)(); + if (receivedMapVersion != packagerMapVersion && (int)receivedMapVersion < 142) { + MACRO_CALL(OpenSHC::Map::Version_Func::UpgradeMapTribesStateVersionTo_142)(); + } + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TroopValueState/Constructor_TroopValueState.cpp b/src/OpenSHC/Map/Units/TroopValueState/Constructor_TroopValueState.cpp new file mode 100644 index 000000000..643d39b8a --- /dev/null +++ b/src/OpenSHC/Map/Units/TroopValueState/Constructor_TroopValueState.cpp @@ -0,0 +1,18 @@ +#include "OpenSHC/Map/Units/TroopValueState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Map::Units::TroopValueState; + + // FUNCTION: STRONGHOLDCRUSADER 0x0051D680 + TroopValueState* TroopValueState::Constructor_TroopValueState() + { + MACRO_CALL_MEMBER(OpenSHC::Map::Units::TroopValueState_Func::clearAttackInfo, this)(); + return this; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TroopValueState/attackInfoHasArch2Building.cpp b/src/OpenSHC/Map/Units/TroopValueState/attackInfoHasArch2Building.cpp new file mode 100644 index 000000000..57b4564f4 --- /dev/null +++ b/src/OpenSHC/Map/Units/TroopValueState/attackInfoHasArch2Building.cpp @@ -0,0 +1,25 @@ +#include "OpenSHC/Map/Units/TroopValueState.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_TroopValueState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x0051ACB0 + BOOLEnum TroopValueState::attackInfoHasArch2Building(int buildingID) + { + for (int i = 0; i < 1000; ++i) { + if (buildingID == DAT_TroopValueState::instance.attackInfo.arch2ValuesArray[i].buildingID) { + return TRUE; + } + } + return FALSE; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TroopValueState/attackInfoHasHigh2Building.cpp b/src/OpenSHC/Map/Units/TroopValueState/attackInfoHasHigh2Building.cpp new file mode 100644 index 000000000..4d36f5911 --- /dev/null +++ b/src/OpenSHC/Map/Units/TroopValueState/attackInfoHasHigh2Building.cpp @@ -0,0 +1,27 @@ +#include "OpenSHC/Map/Units/TroopValueState.func.hpp" +#include "OpenSHC/Map/AttackInfoSubArrayElement1.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_TroopValueState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Map::AttackInfoSubArrayElement1; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x0051AC80 + BOOLEnum TroopValueState::attackInfoHasHigh2Building(int buildingID) + { + for (int i = 0; i < 1000; ++i) { + if (buildingID == DAT_TroopValueState::instance.attackInfo.high2ValuesArray[i].buildingID) { + return TRUE; + } + } + return FALSE; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TroopValueState/clearAIInfoLayerOutsideStartZone.cpp b/src/OpenSHC/Map/Units/TroopValueState/clearAIInfoLayerOutsideStartZone.cpp new file mode 100644 index 000000000..bd2e1d533 --- /dev/null +++ b/src/OpenSHC/Map/Units/TroopValueState/clearAIInfoLayerOutsideStartZone.cpp @@ -0,0 +1,24 @@ +#include "OpenSHC/Map/Units/TroopValueState.func.hpp" + +#include "OpenSHC/Globals/DAT_TileMapState.hpp" +#include "OpenSHC/Globals/DAT_TroopValueState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x0051B680 + void TroopValueState::clearAIInfoLayerOutsideStartZone() + { + int const startArea = DAT_TroopValueState::instance.attackInfo.startCon; + for (int tile = 0; tile < 80400; ++tile) { + if (DAT_TileMapState::instance.AIInfoLayer[tile] != 0 + && (short)DAT_TileMapState::instance.PathConnectionLayer[tile] != startArea) { + DAT_TileMapState::instance.AIInfoLayer[tile] = 0; + } + } + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TroopValueState/getTileInTargetedBuildingTiles.cpp b/src/OpenSHC/Map/Units/TroopValueState/getTileInTargetedBuildingTiles.cpp new file mode 100644 index 000000000..57976529a --- /dev/null +++ b/src/OpenSHC/Map/Units/TroopValueState/getTileInTargetedBuildingTiles.cpp @@ -0,0 +1,25 @@ +#include "OpenSHC/Map/Units/TroopValueState.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_TroopValueState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00519960 + BOOLEnum TroopValueState::getTileInTargetedBuildingTiles(int tile) + { + for (int i = 0; i < DAT_TroopValueState::instance.attackInfo.targetedBuildingTilesArraySize; ++i) { + if (DAT_TroopValueState::instance.attackInfo.targetedBuildingTilesArray[i] == tile) { + return TRUE; + } + } + return FALSE; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TroopValueState/isAttackWaveComplete.cpp b/src/OpenSHC/Map/Units/TroopValueState/isAttackWaveComplete.cpp new file mode 100644 index 000000000..a4b1afeb0 --- /dev/null +++ b/src/OpenSHC/Map/Units/TroopValueState/isAttackWaveComplete.cpp @@ -0,0 +1,26 @@ +#include "OpenSHC/Map/Units/TroopValueState.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_TroopValueState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00518350 + BOOLEnum TroopValueState::isAttackWaveComplete() + { + for (int i = 0; i < 50; ++i) { + if (DAT_TroopValueState::instance.attackInfo.nof_tribes[i] != 0 + && DAT_TroopValueState::instance.attackInfo.value3Array01[i] != 6) { + return FALSE; + } + } + return TRUE; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/ComputeDamageFearFactorBonus.cpp b/src/OpenSHC/Map/Units/UnitsState/ComputeDamageFearFactorBonus.cpp new file mode 100644 index 000000000..8ae098d58 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/ComputeDamageFearFactorBonus.cpp @@ -0,0 +1,17 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/Globals/DAT_GameState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x005311F0 + int UnitsState::computeDamageFearFactorBonus(int damage, int playerID) + { + return ((DAT_GameState::instance.playerDataArray[playerID].fearFactorLevel + 20) * damage * 5) / 100; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/Constructor_UnitsState.cpp b/src/OpenSHC/Map/Units/UnitsState/Constructor_UnitsState.cpp new file mode 100644 index 000000000..a9e30900b --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/Constructor_UnitsState.cpp @@ -0,0 +1,25 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/Map/Units/UnitsState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Map::Units::UnitsState; + + // FUNCTION: STRONGHOLDCRUSADER 0x0053B8B0 + UnitsState* UnitsState::Constructor_UnitsState() + { + this->creationTime = timeGetTime(); + MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::clearAllUnits, this)(); + this->lastSelectedUnitID = 0; + this->unknownInitially0_01 = 0; + this->lostChimps = 0; + this->maxUnitCount = 2500; + return this; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/changeDestinationByLeftover.cpp b/src/OpenSHC/Map/Units/UnitsState/changeDestinationByLeftover.cpp new file mode 100644 index 000000000..43c6f0c60 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/changeDestinationByLeftover.cpp @@ -0,0 +1,18 @@ +#include "../UnitsState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x00533C70 + void UnitsState::changeDestinationByLeftover(int unitID) + { + if (this->units[unitID].leftover > 0) { + MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::changeDestinationByAmount, this)( + unitID, this->units[unitID].leftover); + } + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/checkIfCitizenUnitIsAliveBasedOnState.cpp b/src/OpenSHC/Map/Units/UnitsState/checkIfCitizenUnitIsAliveBasedOnState.cpp new file mode 100644 index 000000000..ebafe05f4 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/checkIfCitizenUnitIsAliveBasedOnState.cpp @@ -0,0 +1,21 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/Map/Units/States/UnitStateShort.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Map::Units::States::UnitState; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00530FD0 + BOOLEnum UnitsState::checkIfCitizenUnitIsAliveBasedOnState(int unitID) + { + return 0x6f <= this->units[unitID].state.generic && this->units[unitID].state.generic <= 0x74; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/checkUnitHasPropertyBasedOnUnitType.cpp b/src/OpenSHC/Map/Units/UnitsState/checkUnitHasPropertyBasedOnUnitType.cpp new file mode 100644 index 000000000..fdad9cc5e --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/checkUnitHasPropertyBasedOnUnitType.cpp @@ -0,0 +1,18 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/Globals/DAT_UnitPropertiesDefinedData.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x0052F0A0 + int UnitsState::checkUnitHasPropertyBasedOnUnitType(int unitID, int property) + { + return DAT_UnitPropertiesDefinedData::instance + .UnitClimbStateFlags[property][(short)this->units[unitID].unitType]; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/clearHiddenFlagAndUpdatePosition.cpp b/src/OpenSHC/Map/Units/UnitsState/clearHiddenFlagAndUpdatePosition.cpp new file mode 100644 index 000000000..14cd01859 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/clearHiddenFlagAndUpdatePosition.cpp @@ -0,0 +1,18 @@ +#include "../UnitsState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x0053E8D0 + void UnitsState::clearHiddenFlagAndUpdatePosition(int unitID) + { + if (this->units[unitID].unknownTestAgainst0_2 != 0) { + this->units[unitID].unknownTestAgainst0_2 = 0; + MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::commitPendingUnitPosition, this)(unitID); + } + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/deselectUnit.cpp b/src/OpenSHC/Map/Units/UnitsState/deselectUnit.cpp new file mode 100644 index 000000000..1ee997531 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/deselectUnit.cpp @@ -0,0 +1,18 @@ +#include "../UnitsState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x00535190 + void UnitsState::deselectUnit(int unitID) + { + if (this->units[unitID].isSelected != 0) { + this->units[unitID].isSelected = 0; + this->totalUnitsInSelection -= 1; + } + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/extendRallyPoint.cpp b/src/OpenSHC/Map/Units/UnitsState/extendRallyPoint.cpp new file mode 100644 index 000000000..dc5242d8a --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/extendRallyPoint.cpp @@ -0,0 +1,27 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandType.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Commands::GameCommandType; + + // FUNCTION: STRONGHOLDCRUSADER 0x005370C0 + void UnitsState::extendRallyPoint(int tribeID, int mouseX, int mouseY, int rallyCount) + { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = tribeID; + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = mouseX; + DAT_GameSynchronyState::instance.DAT_GameCommandParam2 = mouseY; + DAT_GameSynchronyState::instance.DAT_GameCommandParam3 = rallyCount; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)( + OpenSHC::Commands::GCT_UNIT_EXTEND_RALLY_POINT); + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/getArmySize.cpp b/src/OpenSHC/Map/Units/UnitsState/getArmySize.cpp new file mode 100644 index 000000000..67b63cbc3 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/getArmySize.cpp @@ -0,0 +1,18 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/Globals/DAT_GameState.hpp" + +namespace OpenSHC { + +namespace Map { + + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x00532f60 + int UnitsState::getArmySize(int playerID) { return DAT_GameState::ptr->playerDataArray[playerID].armySize; } + + } + +} + +} diff --git a/src/OpenSHC/Map/Units/UnitsState/getDestination2EqualsGivenCoordinates.cpp b/src/OpenSHC/Map/Units/UnitsState/getDestination2EqualsGivenCoordinates.cpp new file mode 100644 index 000000000..41f9370d7 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/getDestination2EqualsGivenCoordinates.cpp @@ -0,0 +1,22 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00533920 + BOOLEnum UnitsState::getDestination2EqualsGivenCoordinates(int unitID, int x, int y) + { + if (this->units[unitID].destinationX_2Unk != x) { + return TRUE; + } + return this->units[unitID].destinationY_2Unk != y; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/getFirstSelectedUnitID.cpp b/src/OpenSHC/Map/Units/UnitsState/getFirstSelectedUnitID.cpp new file mode 100644 index 000000000..03f65f7be --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/getFirstSelectedUnitID.cpp @@ -0,0 +1,26 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandType.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_TribesState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Commands::GameCommandType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00535DF0 + void UnitsState::getFirstSelectedUnitID(undefined4 param_1) + { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = param_1; + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = DAT_TribesState::instance.DAT_CurrentTribeID; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)( + (GameCommandType)0x48); + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/hasTunnelerNotFinishedDigging.cpp b/src/OpenSHC/Map/Units/UnitsState/hasTunnelerNotFinishedDigging.cpp new file mode 100644 index 000000000..525d63a1a --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/hasTunnelerNotFinishedDigging.cpp @@ -0,0 +1,19 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x005339F0 + BOOLEnum UnitsState::hasTunnelerNotFinishedDigging(int unitID) + { + return this->units[unitID].tunnelerFinishedDigging == 0; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/isComputerManagedNonPeasant.cpp b/src/OpenSHC/Map/Units/UnitsState/isComputerManagedNonPeasant.cpp new file mode 100644 index 000000000..12d1c7acb --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/isComputerManagedNonPeasant.cpp @@ -0,0 +1,29 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/Map/Units/UnitType.hpp" +#include "OpenSHC/Map/Units/UnitTypeShort.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_UnitPropertiesDefinedData.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Map::Units::UnitType; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00530080 + BOOLEnum UnitsState::isComputerManagedNonPeasant(int unitID) + { + // the unit type is loaded zero-extended but used as a signed short afterwards + short const unitType = (ushort)this->units[unitID].unitType; + if (unitType == OpenSHC::Map::Units::UT_PEASANT) { + return FALSE; + } + return DAT_UnitPropertiesDefinedData::instance.COMPUTER_MANAGED[unitType] != 0; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/makeUnitStopWalkingByClearingPathProgressState.cpp b/src/OpenSHC/Map/Units/UnitsState/makeUnitStopWalkingByClearingPathProgressState.cpp new file mode 100644 index 000000000..13ceb1747 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/makeUnitStopWalkingByClearingPathProgressState.cpp @@ -0,0 +1,18 @@ +#include "../UnitsState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x0052F070 + void UnitsState::makeUnitStopWalkingByClearingPathProgressState(int unitID) + { + this->units[unitID].currentIndexInPathPlan = 0; + this->units[unitID].totalSizeOfPathPlan = 0; + this->units[unitID].unknownMovementRelated_0x2d2 = 0; + this->units[unitID].climbDataID = 0; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/queueClickNavigateMenuOrEscape.cpp b/src/OpenSHC/Map/Units/UnitsState/queueClickNavigateMenuOrEscape.cpp new file mode 100644 index 000000000..aa4e4019f --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/queueClickNavigateMenuOrEscape.cpp @@ -0,0 +1,25 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandType.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Commands::GameCommandType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00536CC0 + void UnitsState::queueClickNavigateMenuOrEscape(undefined4 param_1) + { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = -2; + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = param_1; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)( + OpenSHC::Commands::GCT_ESCAPE); + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/queueDisbandAndAttackCommand2Params.cpp b/src/OpenSHC/Map/Units/UnitsState/queueDisbandAndAttackCommand2Params.cpp new file mode 100644 index 000000000..3784a584d --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/queueDisbandAndAttackCommand2Params.cpp @@ -0,0 +1,25 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandType.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Commands::GameCommandType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00537100 + void UnitsState::queueDisbandAndAttackCommand2Params(undefined4 param_1, undefined4 param_2) + { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = param_1; + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = param_2; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)( + OpenSHC::Commands::GCT_DISBAND_AND_ATTACK_UNITS); + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/queueDisbandAndAttackCommand3Params.cpp b/src/OpenSHC/Map/Units/UnitsState/queueDisbandAndAttackCommand3Params.cpp new file mode 100644 index 000000000..c650ba8ec --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/queueDisbandAndAttackCommand3Params.cpp @@ -0,0 +1,26 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandType.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Commands::GameCommandType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00537130 + void UnitsState::queueDisbandAndAttackCommand3Params(undefined4 param_1, undefined4 param_2, undefined4 param_3) + { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = param_1; + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = param_2; + DAT_GameSynchronyState::instance.DAT_GameCommandParam2 = param_3; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)( + OpenSHC::Commands::GCT_DISBAND_AND_ATTACK_UNITS); + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/queueDisbandAndAttackCommand4Params.cpp b/src/OpenSHC/Map/Units/UnitsState/queueDisbandAndAttackCommand4Params.cpp new file mode 100644 index 000000000..5588cd672 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/queueDisbandAndAttackCommand4Params.cpp @@ -0,0 +1,28 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandType.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Commands::GameCommandType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00537160 + void UnitsState::queueDisbandAndAttackCommand4Params( + undefined4 param_1, undefined4 param_2, undefined4 param_3, undefined4 param_4) + { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = param_1; + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = param_2; + DAT_GameSynchronyState::instance.DAT_GameCommandParam2 = param_3; + DAT_GameSynchronyState::instance.DAT_GameCommandParam3 = param_4; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)( + OpenSHC::Commands::GCT_DISBAND_AND_ATTACK_UNITS); + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/queueUnitTypeCommand.cpp b/src/OpenSHC/Map/Units/UnitsState/queueUnitTypeCommand.cpp new file mode 100644 index 000000000..e0a68b527 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/queueUnitTypeCommand.cpp @@ -0,0 +1,25 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandType.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Commands::GameCommandType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00536C90 + void UnitsState::queueUnitTypeCommand(undefined4 unitType) + { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = -1; + DAT_GameSynchronyState::instance.DAT_GameCommandParam1 = unitType; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)( + OpenSHC::Commands::GCT_ESCAPE); + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/relayTribeInstruction.cpp b/src/OpenSHC/Map/Units/UnitsState/relayTribeInstruction.cpp new file mode 100644 index 000000000..13ff54760 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/relayTribeInstruction.cpp @@ -0,0 +1,23 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/Map/Units/TribesState.func.hpp" +#include "OpenSHC/Map/Units/UnitInstructionType.hpp" + +#include "OpenSHC/Globals/DAT_TribesState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Map::Units::UnitInstructionType; + + // FUNCTION: STRONGHOLDCRUSADER 0x005371E0 + void UnitsState::relayTribeInstruction( + int tribeID, UnitInstructionType instructionType, int targetID_1, int targetID_2, int param_5) + { + MACRO_CALL_MEMBER(OpenSHC::Map::Units::TribesState_Func::giveTribeAnInstruction, DAT_TribesState::ptr)( + tribeID, instructionType, targetID_1, targetID_2, param_5); + } + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/returnFalseStub.cpp b/src/OpenSHC/Map/Units/UnitsState/returnFalseStub.cpp new file mode 100644 index 000000000..574639d12 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/returnFalseStub.cpp @@ -0,0 +1,16 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00533090 + BOOLEnum UnitsState::returnFalseStub(int unitID) { return FALSE; } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/saveUnitStateBeforeInterruption.cpp b/src/OpenSHC/Map/Units/UnitsState/saveUnitStateBeforeInterruption.cpp new file mode 100644 index 000000000..90eb0cbb5 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/saveUnitStateBeforeInterruption.cpp @@ -0,0 +1,18 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/Map/Units/States/UnitStateUnion.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x00533F90 + void UnitsState::saveUnitStateBeforeInterruption(int unitID) + { + this->units[unitID].tunnelerFinishedDigging = 5; + this->units[unitID].state_3 = this->units[unitID].state; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/selectionContainsEngineersOnly.cpp b/src/OpenSHC/Map/Units/UnitsState/selectionContainsEngineersOnly.cpp new file mode 100644 index 000000000..6ea0e23be --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/selectionContainsEngineersOnly.cpp @@ -0,0 +1,33 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/Map/Units/UnitsState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Map::Units::UnitsState; + + // FUNCTION: STRONGHOLDCRUSADER 0x00535520 + int UnitsState::selectionContainsEngineersOnly() + { + int result = FALSE; + // I tried simplifying this with an early-return but didn't work + if (this->selectionEngineers != 0) { + // This really is field pointer increment style. I tried a for loop over the fields as a int[] + // but that didn't work + int* pUnitSelection = (int*)&this->selectionEuropeanArchers; + for (int index = 0; index <= 26; index++) { + if ((index != 7) && (*pUnitSelection != 0)) { + return FALSE; + } + pUnitSelection++; + } + result = TRUE; + } + return result; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/selectionContainsOnlyArabAssassins.cpp b/src/OpenSHC/Map/Units/UnitsState/selectionContainsOnlyArabAssassins.cpp new file mode 100644 index 000000000..90ac84543 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/selectionContainsOnlyArabAssassins.cpp @@ -0,0 +1,33 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00535810 + BOOLEnum UnitsState::selectionContainsOnlyArabAssassins() + { + BOOLEnum result = FALSE; + // I tried simplifying this with an early-return but didn't work + if (this->selectionArabAssassin != 0) { + // This really is field pointer increment style. I tried a for loop over the fields as a int[] + // but that didn't work + int* pUnitSelection = (int*)&this->selectionEuropeanArchers; + for (int index = 0; index <= 26; index++) { + if ((index != 22) && (*pUnitSelection != 0)) { + return FALSE; + } + pUnitSelection++; + } + result = TRUE; + } + return result; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/selectionContainsShieldmenOnly.cpp b/src/OpenSHC/Map/Units/UnitsState/selectionContainsShieldmenOnly.cpp new file mode 100644 index 000000000..822835f25 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/selectionContainsShieldmenOnly.cpp @@ -0,0 +1,29 @@ +#include "../UnitsState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x00535840 + int UnitsState::selectionContainsShieldmenOnly() + { + int result = FALSE; + // I tried simplifying this with an early-return but didn't work + if (this->selectionShield != 0) { + // This really is field pointer increment style. I tried a for loop over the fields as a int[] + // but that didn't work + int* pUnitSelection = (int*)&this->selectionEuropeanArchers; + for (int index = 0; index <= 26; index++) { + if ((index != 15) && (*pUnitSelection != 0)) { + return FALSE; + } + pUnitSelection++; + } + result = TRUE; + } + return result; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/selectionContainsTunnelersOnly.cpp b/src/OpenSHC/Map/Units/UnitsState/selectionContainsTunnelersOnly.cpp new file mode 100644 index 000000000..95f8d48ea --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/selectionContainsTunnelersOnly.cpp @@ -0,0 +1,29 @@ +#include "../UnitsState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x00535700 + int UnitsState::selectionContainsTunnelersOnly() + { + int result = FALSE; + // I tried simplifying this with an early-return but didn't work + if (this->selectionTunnelers != 0) { + // This really is field pointer increment style. I tried a for loop over the fields as a int[] + // but that didn't work + int* pUnitSelection = (int*)&this->selectionEuropeanArchers; + for (int index = 0; index <= 26; index++) { + if ((index != 9) && (*pUnitSelection != 0)) { + return FALSE; + } + pUnitSelection++; + } + result = TRUE; + } + return result; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/selectionHasArchers.cpp b/src/OpenSHC/Map/Units/UnitsState/selectionHasArchers.cpp new file mode 100644 index 000000000..f5fa655cf --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/selectionHasArchers.cpp @@ -0,0 +1,22 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00535560 + BOOLEnum UnitsState::selectionHasArchers() + { + if (this->selectionEuropeanArchers != 0) { + return TRUE; + } + return this->selectionArabArcher != 0; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/selectionHasEngineers.cpp b/src/OpenSHC/Map/Units/UnitsState/selectionHasEngineers.cpp new file mode 100644 index 000000000..228da9285 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/selectionHasEngineers.cpp @@ -0,0 +1,16 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00535550 + BOOLEnum UnitsState::selectionHasEngineers() { return this->selectionEngineers != 0; } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/setupUnitSharingCurrentTilePosition.cpp b/src/OpenSHC/Map/Units/UnitsState/setupUnitSharingCurrentTilePosition.cpp new file mode 100644 index 000000000..d448f7512 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/setupUnitSharingCurrentTilePosition.cpp @@ -0,0 +1,16 @@ +#include "../UnitsState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x0053BB70 + void UnitsState::setupUnitSharingCurrentTilePosition(int unitID) + { + MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::setupUnitSharingTileIDs, this)( + unitID, this->units[unitID].tile); + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/sitDownIfStanding.cpp b/src/OpenSHC/Map/Units/UnitsState/sitDownIfStanding.cpp new file mode 100644 index 000000000..d86d69a7c --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/sitDownIfStanding.cpp @@ -0,0 +1,20 @@ +#include "../UnitsState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x0052FBF0 + BOOLEnum UnitsState::sitDownIfStanding(int unitID) + { + if (this->units[unitID].seated != 0) { + return FALSE; + } + this->units[unitID].substate = 101; + this->units[unitID].animationCycleNumber = 0; + return TRUE; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/standUpIfSeated.cpp b/src/OpenSHC/Map/Units/UnitsState/standUpIfSeated.cpp new file mode 100644 index 000000000..89cacac5d --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/standUpIfSeated.cpp @@ -0,0 +1,20 @@ +#include "../UnitsState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x0052FBB0 + BOOLEnum UnitsState::standUpIfSeated(int unitID) + { + if (this->units[unitID].seated == 0) { + return FALSE; + } + this->units[unitID].substate = 100; + this->units[unitID].animationCycleNumber = 0; + return TRUE; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/unitIsInMoat.cpp b/src/OpenSHC/Map/Units/UnitsState/unitIsInMoat.cpp new file mode 100644 index 000000000..70b2ba45c --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/unitIsInMoat.cpp @@ -0,0 +1,22 @@ +#include "../UnitsState.func.hpp" + +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_TileMapState.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + using OpenSHC::Map::Logic1; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00534460 + BOOLEnum UnitsState::unitIsInMoat(int unitID) + { + return (uint)DAT_TileMapState::instance.LogicLayer[this->units[unitID].tile] >> 30 & 1; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UpdateWorker_ConsiderTakingABreakUnk.cpp b/src/OpenSHC/Map/Units/UpdateWorker_ConsiderTakingABreakUnk.cpp new file mode 100644 index 000000000..28480ae9c --- /dev/null +++ b/src/OpenSHC/Map/Units/UpdateWorker_ConsiderTakingABreakUnk.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Map/Units.func.hpp" +#include "OpenSHC/Map/Units/States/UnitState.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Units::States::UnitState; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x0053CAC0 + BOOLEnum Units::UpdateWorker_ConsiderTakingABreakUnk(int unitID) + { + return MACRO_CALL(OpenSHC::Map::Units_Func::ConsiderHavingABreakNowUnk)( + unitID, (UnitState)(short)DAT_UnitsState::instance.units[unitID].state.generic); + } + +} +} diff --git a/src/OpenSHC/Map/Version/SetBuildingsEmployeeCountToValue.cpp b/src/OpenSHC/Map/Version/SetBuildingsEmployeeCountToValue.cpp new file mode 100644 index 000000000..90da3b480 --- /dev/null +++ b/src/OpenSHC/Map/Version/SetBuildingsEmployeeCountToValue.cpp @@ -0,0 +1,28 @@ +#include "OpenSHC/Map/Version.func.hpp" +#include "OpenSHC/Map/Buildings/Building.hpp" +#include "OpenSHC/Map/Buildings/BuildingLogicalState.hpp" + +#include "OpenSHC/Globals/DAT_BuildingDefinedData.hpp" +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Buildings::Building; + using OpenSHC::Map::Buildings::BuildingLogicalState; + + // FUNCTION: STRONGHOLDCRUSADER 0x0041A390 + void Version::SetBuildingsEmployeeCountToValue() + { + for (int buildingID = 1; buildingID < 2000; ++buildingID) { + if (DAT_BuildingsState::instance.buildings[buildingID].logicalState != (BuildingLogicalState)0) { + DAT_BuildingsState::instance.buildings[buildingID].buildingTypeBasedEmployeeCount + = DAT_BuildingDefinedData::instance + .EmployeeCountPerBuildingType[DAT_BuildingsState::instance.buildings[buildingID].buildingType] + .shortValue; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/SetDairyCheeseToZero.cpp b/src/OpenSHC/Map/Version/SetDairyCheeseToZero.cpp new file mode 100644 index 000000000..2417584a6 --- /dev/null +++ b/src/OpenSHC/Map/Version/SetDairyCheeseToZero.cpp @@ -0,0 +1,28 @@ +#include "OpenSHC/Map/Version.func.hpp" +#include "OpenSHC/Map/Buildings/Building.hpp" +#include "OpenSHC/Map/Buildings/BuildingLogicalState.hpp" +#include "OpenSHC/Map/Buildings/BuildingType.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Buildings::Building; + using OpenSHC::Map::Buildings::BuildingLogicalState; + using OpenSHC::Map::Buildings::BuildingType; + + // FUNCTION: STRONGHOLDCRUSADER 0x0041A2B0 + void Version::SetDairyCheeseToZero() + { + for (int buildingID = 1; buildingID < 2000; ++buildingID) { + if (DAT_BuildingsState::instance.buildings[buildingID].logicalState != (BuildingLogicalState)0 + && DAT_BuildingsState::instance.buildings[buildingID].buildingType + == OpenSHC::Map::Buildings::BT_DAIRYFARM) { + DAT_BuildingsState::instance.buildings[buildingID].flagonsOfAleOrCheeseOrReleaseDogs = 0; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/SetUndamagedBuildingHealthToValue.cpp b/src/OpenSHC/Map/Version/SetUndamagedBuildingHealthToValue.cpp new file mode 100644 index 000000000..b92f15e58 --- /dev/null +++ b/src/OpenSHC/Map/Version/SetUndamagedBuildingHealthToValue.cpp @@ -0,0 +1,32 @@ +#include "OpenSHC/Map/Version.func.hpp" +#include "OpenSHC/Map/Buildings/Building.hpp" +#include "OpenSHC/Map/Buildings/BuildingLogicalState.hpp" + +#include "OpenSHC/Globals/DAT_BuildingDefinedData.hpp" +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Buildings::Building; + using OpenSHC::Map::Buildings::BuildingLogicalState; + + // FUNCTION: STRONGHOLDCRUSADER 0x0041A060 + void Version::SetUndamagedBuildingHealthToValue() + { + for (int buildingID = 1; buildingID < 2000; ++buildingID) { + if (DAT_BuildingsState::instance.buildings[buildingID].logicalState != (BuildingLogicalState)0 + && DAT_BuildingsState::instance.buildings[buildingID].currentHealth + == DAT_BuildingsState::instance.buildings[buildingID].maxHealth) { + uint const health + = DAT_BuildingDefinedData::instance + .BuildingHP[(short)DAT_BuildingsState::instance.buildings[buildingID].buildingType] + .ushortValue; + DAT_BuildingsState::instance.buildings[buildingID].maxHealth = health; + DAT_BuildingsState::instance.buildings[buildingID].currentHealth = health; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpdateDestroyedBuildingCountData.cpp b/src/OpenSHC/Map/Version/UpdateDestroyedBuildingCountData.cpp new file mode 100644 index 000000000..d72f5777d --- /dev/null +++ b/src/OpenSHC/Map/Version/UpdateDestroyedBuildingCountData.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/Map/Version.func.hpp" + +#include "OpenSHC/Globals/DAT_DestroyedBuildingsCountHistory.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x0044AAA0 + void Version::UpdateDestroyedBuildingCountData(int destroyedCount) + { + DAT_DestroyedBuildingsCountHistory::instance[0] += destroyedCount; + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpdateUnitLossData.cpp b/src/OpenSHC/Map/Version/UpdateUnitLossData.cpp new file mode 100644 index 000000000..7cc5c29ec --- /dev/null +++ b/src/OpenSHC/Map/Version/UpdateUnitLossData.cpp @@ -0,0 +1,17 @@ +#include "OpenSHC/Map/Version.func.hpp" + +#include "OpenSHC/Globals/DAT_UnitValueLossesPerEnemyPlayer.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x0044AA80 + void Version::UpdateUnitLossData(int lossValue, int playerID) + { + if (lossValue < 0) { + DAT_UnitValueLossesPerEnemyPlayer::instance[playerID] -= lossValue; + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeBuildingField1.cpp b/src/OpenSHC/Map/Version/UpgradeBuildingField1.cpp new file mode 100644 index 000000000..08b6f94a6 --- /dev/null +++ b/src/OpenSHC/Map/Version/UpgradeBuildingField1.cpp @@ -0,0 +1,25 @@ +#include "OpenSHC/Map/Version.func.hpp" +#include "OpenSHC/Map/Buildings/Building.hpp" +#include "OpenSHC/Map/Buildings/BuildingLogicalState.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Buildings::Building; + using OpenSHC::Map::Buildings::BuildingLogicalState; + + // FUNCTION: STRONGHOLDCRUSADER 0x0041A0D0 + void Version::UpgradeBuildingField1() + { + for (int buildingID = 1; buildingID < 2000; ++buildingID) { + if (DAT_BuildingsState::instance.buildings[buildingID].logicalState != (BuildingLogicalState)0) { + DAT_BuildingsState::instance.buildings[buildingID].uidWhenPlaced + = DAT_BuildingsState::instance.buildings[buildingID].uidPlaced; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeBuildingField2.cpp b/src/OpenSHC/Map/Version/UpgradeBuildingField2.cpp new file mode 100644 index 000000000..85f2845de --- /dev/null +++ b/src/OpenSHC/Map/Version/UpgradeBuildingField2.cpp @@ -0,0 +1,25 @@ +#include "OpenSHC/Map/Version.func.hpp" +#include "OpenSHC/Map/Buildings/Building.hpp" +#include "OpenSHC/Map/Buildings/BuildingLogicalState.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Buildings::Building; + using OpenSHC::Map::Buildings::BuildingLogicalState; + + // FUNCTION: STRONGHOLDCRUSADER 0x0041A3C0 + void Version::UpgradeBuildingField2() + { + for (int buildingID = 1; buildingID < 2000; ++buildingID) { + if (DAT_BuildingsState::instance.buildings[buildingID].logicalState != (BuildingLogicalState)0) { + DAT_BuildingsState::instance.buildings[buildingID].field203_0x288 = 0; + DAT_BuildingsState::instance.buildings[buildingID].field185_0x264 = 0; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeBuildingField4.cpp b/src/OpenSHC/Map/Version/UpgradeBuildingField4.cpp new file mode 100644 index 000000000..fd84d62cd --- /dev/null +++ b/src/OpenSHC/Map/Version/UpgradeBuildingField4.cpp @@ -0,0 +1,24 @@ +#include "OpenSHC/Map/Version.func.hpp" +#include "OpenSHC/Map/Buildings/Building.hpp" +#include "OpenSHC/Map/Buildings/BuildingLogicalState.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Buildings::Building; + using OpenSHC::Map::Buildings::BuildingLogicalState; + + // FUNCTION: STRONGHOLDCRUSADER 0x0041A5F0 + void Version::UpgradeBuildingField4() + { + for (int buildingID = 1; buildingID < 2000; ++buildingID) { + if (DAT_BuildingsState::instance.buildings[buildingID].logicalState != (BuildingLogicalState)0) { + DAT_BuildingsState::instance.buildings[buildingID].field241_0x2c6 = 0; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeClearBuildings1000AndHigher.cpp b/src/OpenSHC/Map/Version/UpgradeClearBuildings1000AndHigher.cpp new file mode 100644 index 000000000..ba3dffb2f --- /dev/null +++ b/src/OpenSHC/Map/Version/UpgradeClearBuildings1000AndHigher.cpp @@ -0,0 +1,24 @@ +#include "OpenSHC/IO/LowLevelMemory.func.hpp" +#include "OpenSHC/Map/Version.func.hpp" +#include "OpenSHC/Map/Buildings/Building.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_LowLevelMemory.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Buildings::Building; + + // FUNCTION: STRONGHOLDCRUSADER 0x0041A620 + void Version::UpgradeClearBuildings1000AndHigher() + { + for (int buildingID = 1000; buildingID < 2000; ++buildingID) { + MACRO_CALL_MEMBER(OpenSHC::IO::LowLevelMemory_Func::fillMemory_ByteValue, DAT_LowLevelMemory::ptr)( + sizeof(DAT_BuildingsState::instance.buildings[buildingID]), 0, + &DAT_BuildingsState::instance.buildings[buildingID]); + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeFirst9Buildings.cpp b/src/OpenSHC/Map/Version/UpgradeFirst9Buildings.cpp new file mode 100644 index 000000000..a9874e9fa --- /dev/null +++ b/src/OpenSHC/Map/Version/UpgradeFirst9Buildings.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Map/Buildings/BuildingsState.func.hpp" +#include "OpenSHC/Map/Version.func.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x0041A0A0 + void Version::UpgradeFirst9Buildings() + { + for (int buildingID = 1; buildingID < 9; ++buildingID) { + MACRO_CALL_MEMBER(OpenSHC::Map::Buildings::BuildingsState_Func::setupBarracksCampgroundPositions, + DAT_BuildingsState::ptr)(buildingID); + MACRO_CALL_MEMBER(OpenSHC::Map::Buildings::BuildingsState_Func::setupMercenaryPostCampgroundPositions, + DAT_BuildingsState::ptr)(buildingID); + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeKillingPitField.cpp b/src/OpenSHC/Map/Version/UpgradeKillingPitField.cpp new file mode 100644 index 000000000..97ec5cae3 --- /dev/null +++ b/src/OpenSHC/Map/Version/UpgradeKillingPitField.cpp @@ -0,0 +1,28 @@ +#include "OpenSHC/Map/Version.func.hpp" +#include "OpenSHC/Map/Buildings/Building.hpp" +#include "OpenSHC/Map/Buildings/BuildingLogicalState.hpp" +#include "OpenSHC/Map/Buildings/BuildingType.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Buildings::Building; + using OpenSHC::Map::Buildings::BuildingLogicalState; + using OpenSHC::Map::Buildings::BuildingType; + + // FUNCTION: STRONGHOLDCRUSADER 0x0041A5C0 + void Version::UpgradeKillingPitField() + { + for (int buildingID = 1; buildingID < 2000; ++buildingID) { + if (DAT_BuildingsState::instance.buildings[buildingID].logicalState != (BuildingLogicalState)0 + && DAT_BuildingsState::instance.buildings[buildingID].buildingType + == OpenSHC::Map::Buildings::BT_KILLINGPIT) { + DAT_BuildingsState::instance.buildings[buildingID].killingPitField = 0; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeMapLogicToVersion_125.cpp b/src/OpenSHC/Map/Version/UpgradeMapLogicToVersion_125.cpp new file mode 100644 index 000000000..23ef2eba2 --- /dev/null +++ b/src/OpenSHC/Map/Version/UpgradeMapLogicToVersion_125.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Map/Version.func.hpp" + +#include "OpenSHC/Globals/DAT_TileMapState.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x005011C0 + void Version::UpgradeMapLogicToVersion_125() + { + for (int tile = 0; tile < 80400; ++tile) { + if (DAT_TileMapState::instance.HeightLayer[tile] == 80) { + DAT_TileMapState::instance.Logic2Layer[tile] = 4; + } else if (DAT_TileMapState::instance.HeightLayer[tile] == 130) { + DAT_TileMapState::instance.Logic2Layer[tile] = 8; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeMapLogicToVersion_147.cpp b/src/OpenSHC/Map/Version/UpgradeMapLogicToVersion_147.cpp new file mode 100644 index 000000000..6da9a058c --- /dev/null +++ b/src/OpenSHC/Map/Version/UpgradeMapLogicToVersion_147.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Map/Version.func.hpp" + +#include "OpenSHC/Globals/DAT_TileMapState.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x00501730 + void Version::UpgradeMapLogicToVersion_147() + { + for (int tile = 0; tile < 80400; ++tile) { + if (DAT_TileMapState::instance.DefaultHeightLayer[tile] > 156) { + DAT_TileMapState::instance.HeightLayer[tile] + += 156 - DAT_TileMapState::instance.DefaultHeightLayer[tile]; + DAT_TileMapState::instance.DefaultHeightLayer[tile] = 156; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeMapTribesStateVersionTo_142.cpp b/src/OpenSHC/Map/Version/UpgradeMapTribesStateVersionTo_142.cpp new file mode 100644 index 000000000..fccf9e164 --- /dev/null +++ b/src/OpenSHC/Map/Version/UpgradeMapTribesStateVersionTo_142.cpp @@ -0,0 +1,23 @@ +#include "OpenSHC/Map/Version.func.hpp" +#include "OpenSHC/Map/Units/SomeTribeBehaviorType.hpp" + +#include "OpenSHC/Globals/DAT_TribesState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Units::SomeTribeBehaviorType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00523E00 + void Version::UpgradeMapTribesStateVersionTo_142() + { + for (int tribeID = 1; tribeID < 1250; ++tribeID) { + if (DAT_TribesState::instance.tribes[tribeID].tribeState != 0 + && DAT_TribesState::instance.tribes[tribeID].attackWave <= 0) { + DAT_TribesState::instance.tribes[tribeID].tribeBehaviorType = 0; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeMapTribesStateVersionTo_Unknown2.cpp b/src/OpenSHC/Map/Version/UpgradeMapTribesStateVersionTo_Unknown2.cpp new file mode 100644 index 000000000..853009835 --- /dev/null +++ b/src/OpenSHC/Map/Version/UpgradeMapTribesStateVersionTo_Unknown2.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Map/Units/TribesState.func.hpp" +#include "OpenSHC/Map/Version.func.hpp" + +#include "OpenSHC/Globals/DAT_TribesState.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x00523EB0 + void Version::UpgradeMapTribesStateVersionTo_Unknown2() + { + for (int tribeID = 1; tribeID < 1250; ++tribeID) { + if (DAT_TribesState::instance.tribes[tribeID].tribeState != 0) { + MACRO_CALL_MEMBER(OpenSHC::Map::Units::TribesState_Func::setWhetherTribeContainsAnyUnits, + DAT_TribesState::ptr)(tribeID); + } + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeMapUnitsTo_112.cpp b/src/OpenSHC/Map/Version/UpgradeMapUnitsTo_112.cpp new file mode 100644 index 000000000..711a49fec --- /dev/null +++ b/src/OpenSHC/Map/Version/UpgradeMapUnitsTo_112.cpp @@ -0,0 +1,28 @@ +#include "OpenSHC/Map/Version.func.hpp" +#include "OpenSHC/Map/Units/Unit.hpp" +#include "OpenSHC/Map/Units/UnitLogicState.hpp" + +#include "OpenSHC/Globals/DAT_CurrentUnitSlotID.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Units::Unit; + using OpenSHC::Map::Units::UnitLogicState; + + // FUNCTION: STRONGHOLDCRUSADER 0x0053B340 + void Version::UpgradeMapUnitsTo_112() + { + DAT_CurrentUnitSlotID::instance = 1; + for (int unitID = 1; unitID != 2500; ++unitID) { + DAT_CurrentUnitSlotID::instance += 1; + if (DAT_UnitsState::instance.units[unitID].logicalState == Units::ULS_NORMAL) { + DAT_UnitsState::instance.units[unitID].buildingID + = DAT_UnitsState::instance.units[unitID].workplaceBuildingID_1; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeMapUnitsTo_114.cpp b/src/OpenSHC/Map/Version/UpgradeMapUnitsTo_114.cpp new file mode 100644 index 000000000..03ee3e4af --- /dev/null +++ b/src/OpenSHC/Map/Version/UpgradeMapUnitsTo_114.cpp @@ -0,0 +1,27 @@ +#include "OpenSHC/Map/Version.func.hpp" +#include "OpenSHC/Map/Units/UnitLogicState.hpp" +#include "OpenSHC/Map/Units/UnitLogicStateShort.hpp" + +#include "OpenSHC/Globals/DAT_CurrentUnitSlotID.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Units::UnitLogicState; + using OpenSHC::Map::Units::UnitLogicStateShort; + + // FUNCTION: STRONGHOLDCRUSADER 0x0053B310 + void Version::UpgradeMapUnitsTo_114() + { + DAT_CurrentUnitSlotID::instance = 1; + for (int unitID = 1; unitID < 2500; ++unitID) { + DAT_CurrentUnitSlotID::instance += 1; + if (DAT_UnitsState::instance.units[unitID].logicalState == Units::ULS_NORMAL) { + DAT_UnitsState::instance.units[unitID].calculatedOwnerPlayerIndex = 0; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeMapUnitsTo_130.cpp b/src/OpenSHC/Map/Version/UpgradeMapUnitsTo_130.cpp new file mode 100644 index 000000000..d4b712994 --- /dev/null +++ b/src/OpenSHC/Map/Version/UpgradeMapUnitsTo_130.cpp @@ -0,0 +1,31 @@ +#include "OpenSHC/Map/Version.func.hpp" +#include "OpenSHC/Map/Units/UnitLogicState.hpp" +#include "OpenSHC/Map/Units/UnitType.hpp" +#include "OpenSHC/Map/Units/UnitTypeShort.hpp" + +#include "OpenSHC/Globals/DAT_CurrentUnitSlotID.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Units::UnitLogicState; + using OpenSHC::Map::Units::UnitType; + using OpenSHC::Map::Units::UnitTypeShort; + + // FUNCTION: STRONGHOLDCRUSADER 0x0053B530 + void Version::UpgradeMapUnitsTo_130() + { + DAT_CurrentUnitSlotID::instance = 1; + for (int unitID = 1; unitID < 2500; ++unitID) { + DAT_CurrentUnitSlotID::instance += 1; + if (DAT_UnitsState::instance.units[unitID].logicalState == Units::ULS_NORMAL + && DAT_UnitsState::instance.units[unitID].unitType == Units::UT_COW) { + DAT_UnitsState::instance.units[unitID] + .digTileX__OR__countCurrentlyManningEnginers__OR__forCowsRandomBelow300 = 0; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeMapUnitsTo_149.cpp b/src/OpenSHC/Map/Version/UpgradeMapUnitsTo_149.cpp new file mode 100644 index 000000000..4b6fb6957 --- /dev/null +++ b/src/OpenSHC/Map/Version/UpgradeMapUnitsTo_149.cpp @@ -0,0 +1,27 @@ +#include "OpenSHC/Map/Version.func.hpp" +#include "OpenSHC/Map/Units/Unit.hpp" +#include "OpenSHC/Map/Units/UnitLogicState.hpp" + +#include "OpenSHC/Globals/DAT_CurrentUnitSlotID.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Units::Unit; + using OpenSHC::Map::Units::UnitLogicState; + + // FUNCTION: STRONGHOLDCRUSADER 0x0053B570 + void Version::UpgradeMapUnitsTo_149() + { + DAT_CurrentUnitSlotID::instance = 1; + for (int unitID = 1; unitID < 2500; ++unitID) { + DAT_CurrentUnitSlotID::instance += 1; + if (DAT_UnitsState::instance.units[unitID].logicalState == Units::ULS_NORMAL) { + DAT_UnitsState::instance.units[unitID].shootBeforeStop = 0; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeMapUnitsTo_155.cpp b/src/OpenSHC/Map/Version/UpgradeMapUnitsTo_155.cpp new file mode 100644 index 000000000..8371c1009 --- /dev/null +++ b/src/OpenSHC/Map/Version/UpgradeMapUnitsTo_155.cpp @@ -0,0 +1,27 @@ +#include "OpenSHC/Map/Version.func.hpp" +#include "OpenSHC/Map/Units/Unit.hpp" +#include "OpenSHC/Map/Units/UnitLogicState.hpp" + +#include "OpenSHC/Globals/DAT_CurrentUnitSlotID.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Units::Unit; + using OpenSHC::Map::Units::UnitLogicState; + + // FUNCTION: STRONGHOLDCRUSADER 0x0053B5E0 + void Version::UpgradeMapUnitsTo_155() + { + DAT_CurrentUnitSlotID::instance = 1; + for (int unitID = 1; unitID < 2500; ++unitID) { + DAT_CurrentUnitSlotID::instance += 1; + if (DAT_UnitsState::instance.units[unitID].logicalState != Units::ULS_INVISIBLE) { + DAT_UnitsState::instance.units[unitID].killedFlagUnk = 0; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeOutpostField.cpp b/src/OpenSHC/Map/Version/UpgradeOutpostField.cpp new file mode 100644 index 000000000..d5cdeddf7 --- /dev/null +++ b/src/OpenSHC/Map/Version/UpgradeOutpostField.cpp @@ -0,0 +1,30 @@ +#include "OpenSHC/Map/Version.func.hpp" +#include "OpenSHC/Map/Buildings/Building.hpp" +#include "OpenSHC/Map/Buildings/BuildingLogicalState.hpp" +#include "OpenSHC/Map/Buildings/BuildingType.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Buildings::Building; + using OpenSHC::Map::Buildings::BuildingLogicalState; + using OpenSHC::Map::Buildings::BuildingType; + + // FUNCTION: STRONGHOLDCRUSADER 0x0041A710 + void Version::UpgradeOutpostField() + { + for (int buildingID = 1; buildingID < 2000; ++buildingID) { + if (DAT_BuildingsState::instance.buildings[buildingID].logicalState != (BuildingLogicalState)0 + && (DAT_BuildingsState::instance.buildings[buildingID].buildingType + == OpenSHC::Map::Buildings::BT_OUTPOST_EUROPEAN + || DAT_BuildingsState::instance.buildings[buildingID].buildingType + == OpenSHC::Map::Buildings::BT_OUTPOST_ARABIAN)) { + DAT_BuildingsState::instance.buildings[buildingID].randomOutpostField = 0; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeRemoveRocksBeyond1000.cpp b/src/OpenSHC/Map/Version/UpgradeRemoveRocksBeyond1000.cpp new file mode 100644 index 000000000..2d15cd8b0 --- /dev/null +++ b/src/OpenSHC/Map/Version/UpgradeRemoveRocksBeyond1000.cpp @@ -0,0 +1,23 @@ +#include "OpenSHC/IO/LowLevelMemory.func.hpp" +#include "OpenSHC/Map/Version.func.hpp" +#include "OpenSHC/Map/Rocks/Rock.hpp" + +#include "OpenSHC/Globals/DAT_LandscapeState.hpp" +#include "OpenSHC/Globals/DAT_LowLevelMemory.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Map::Rocks::Rock; + + // FUNCTION: STRONGHOLDCRUSADER 0x004F3900 + void Version::UpgradeRemoveRocksBeyond1000() + { + for (int i = 2000; i < 4000; ++i) { + MACRO_CALL_MEMBER(OpenSHC::IO::LowLevelMemory_Func::fillMemory_ByteValue, DAT_LowLevelMemory::ptr)( + sizeof(DAT_LandscapeState::instance.rocks[i]), 0, &DAT_LandscapeState::instance.rocks[i]); + } + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeSetCurrentEntityID3000.cpp b/src/OpenSHC/Map/Version/UpgradeSetCurrentEntityID3000.cpp new file mode 100644 index 000000000..97b23d686 --- /dev/null +++ b/src/OpenSHC/Map/Version/UpgradeSetCurrentEntityID3000.cpp @@ -0,0 +1,12 @@ +#include "OpenSHC/Map/Version.func.hpp" + +#include "OpenSHC/Globals/DAT_CurrentEntityID.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x004038A0 + void Version::UpgradeSetCurrentEntityID3000() { DAT_CurrentEntityID::instance = 3000; } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeSolitaryMapBuildingField3.cpp b/src/OpenSHC/Map/Version/UpgradeSolitaryMapBuildingField3.cpp new file mode 100644 index 000000000..ef930a585 --- /dev/null +++ b/src/OpenSHC/Map/Version/UpgradeSolitaryMapBuildingField3.cpp @@ -0,0 +1,30 @@ +#include "OpenSHC/Map/Version.func.hpp" +#include "OpenSHC/Game/GameMode.hpp" +#include "OpenSHC/Map/Buildings/Building.hpp" +#include "OpenSHC/Map/Buildings/BuildingLogicalState.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Game::GameMode; + using OpenSHC::Map::Buildings::Building; + using OpenSHC::Map::Buildings::BuildingLogicalState; + + // FUNCTION: STRONGHOLDCRUSADER 0x0041A3F0 + void Version::UpgradeSolitaryMapBuildingField3() + { + if (DAT_GameSynchronyState::instance.currentGameMode != OpenSHC::Game::GM_SOLITARY) { + return; + } + for (int buildingID = 1; buildingID < 2000; ++buildingID) { + if (DAT_BuildingsState::instance.buildings[buildingID].logicalState != (BuildingLogicalState)0) { + DAT_BuildingsState::instance.buildings[buildingID].playerColorUnk = 0; + } + } + } + +} +} diff --git a/src/OpenSHC/Map/WallAndPitchState/resetWallAndPitchState.cpp b/src/OpenSHC/Map/WallAndPitchState/resetWallAndPitchState.cpp new file mode 100644 index 000000000..2cd7df980 --- /dev/null +++ b/src/OpenSHC/Map/WallAndPitchState/resetWallAndPitchState.cpp @@ -0,0 +1,29 @@ +#include "OpenSHC/Map/WallAndPitchState.func.hpp" +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_UIDragDropDefinedData.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Game::GameMode2; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00500C80 + void WallAndPitchState::resetWallAndPitchState() + { + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SKIRMISH_AND_MULTIPLAYER + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + return; + } + this->state = 4; + this->countdown = 400; + this->index = 0; + this->counter = 0; + DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; + } + +} +} diff --git a/src/OpenSHC/Map/WallAndPitchState/resetWallPlacementInfo.cpp b/src/OpenSHC/Map/WallAndPitchState/resetWallPlacementInfo.cpp new file mode 100644 index 000000000..806f75997 --- /dev/null +++ b/src/OpenSHC/Map/WallAndPitchState/resetWallPlacementInfo.cpp @@ -0,0 +1,29 @@ +#include "OpenSHC/Map/WallAndPitchState.func.hpp" +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_UIDragDropDefinedData.hpp" + +namespace OpenSHC { +namespace Map { + + using OpenSHC::Game::GameMode2; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00500D30 + void WallAndPitchState::resetWallPlacementInfo() + { + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SKIRMISH_AND_MULTIPLAYER + || DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_SIEGE_THAT) { + return; + } + this->state = 3; + this->countdown = 400; + this->index = 0; + this->counter = 0; + DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; + } + +} +} diff --git a/src/OpenSHC/Map/WildlifeState/clearWildlifeState.cpp b/src/OpenSHC/Map/WildlifeState/clearWildlifeState.cpp new file mode 100644 index 000000000..798db1a8c --- /dev/null +++ b/src/OpenSHC/Map/WildlifeState/clearWildlifeState.cpp @@ -0,0 +1,18 @@ +#include "OpenSHC/IO/LowLevelMemory.func.hpp" +#include "OpenSHC/Map/WildlifeState.func.hpp" + +#include "OpenSHC/Globals/DAT_LowLevelMemory.hpp" +#include "OpenSHC/Globals/DAT_WildlifeState.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x0052B9F0 + void WildlifeState::clearWildlifeState() + { + MACRO_CALL_MEMBER(OpenSHC::IO::LowLevelMemory_Func::fillMemory_ByteValue, DAT_LowLevelMemory::ptr)( + sizeof(DAT_WildlifeState::instance.grid), 0, DAT_WildlifeState::instance.grid); + } + +} +} diff --git a/src/OpenSHC/Rendering/ViewportRenderState/computeTileXOffset.cpp b/src/OpenSHC/Rendering/ViewportRenderState/computeTileXOffset.cpp new file mode 100644 index 000000000..6a27369f7 --- /dev/null +++ b/src/OpenSHC/Rendering/ViewportRenderState/computeTileXOffset.cpp @@ -0,0 +1,13 @@ +#include "../ViewportRenderState.func.hpp" + +namespace OpenSHC { +namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x004092E0 + int ViewportRenderState::computeTileXOffset(int tile, int y) + { + return tile - this->translationMatrix[y].addXgetTile; + } + +} +} diff --git a/src/OpenSHC/Rendering/ViewportRenderState/createFloatingTextElement.cpp b/src/OpenSHC/Rendering/ViewportRenderState/createFloatingTextElement.cpp new file mode 100644 index 000000000..a790f02a5 --- /dev/null +++ b/src/OpenSHC/Rendering/ViewportRenderState/createFloatingTextElement.cpp @@ -0,0 +1,17 @@ +#include "OpenSHC/Rendering/ViewportRenderState.func.hpp" +#include "OpenSHC/IO/Graphics/GmID.hpp" + +namespace OpenSHC { +namespace Rendering { + + using OpenSHC::IO::Graphics::GmID; + + // FUNCTION: STRONGHOLDCRUSADER 0x004E8CC0 + void ViewportRenderState::createFloatingTextElement(int param_1, int param_2, int param_3, int param_4, int param_5) + { + MACRO_CALL_MEMBER(OpenSHC::Rendering::ViewportRenderState_Func::createFloatingLayerElement, this)( + OpenSHC::IO::Graphics::GID_FLOATS, param_1, param_2, param_3, param_4, param_5); + } + +} +} diff --git a/src/OpenSHC/Rendering/ViewportRenderState/focusOnCoordinate.cpp b/src/OpenSHC/Rendering/ViewportRenderState/focusOnCoordinate.cpp new file mode 100644 index 000000000..a2a9c1d26 --- /dev/null +++ b/src/OpenSHC/Rendering/ViewportRenderState/focusOnCoordinate.cpp @@ -0,0 +1,14 @@ +#include "OpenSHC/Rendering/ViewportRenderState.func.hpp" + +namespace OpenSHC { +namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x004E8CA0 + void ViewportRenderState::focusOnCoordinate(int x, int y) + { + MACRO_CALL_MEMBER(OpenSHC::Rendering::ViewportRenderState_Func::focusOnTile, this)( + this->translationMatrix[y].addXgetTile + x); + } + +} +} diff --git a/src/OpenSHC/Rendering/ViewportRenderState/resetBatchedRender.cpp b/src/OpenSHC/Rendering/ViewportRenderState/resetBatchedRender.cpp new file mode 100644 index 000000000..e11881f1e --- /dev/null +++ b/src/OpenSHC/Rendering/ViewportRenderState/resetBatchedRender.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/Rendering/ViewportRenderState.func.hpp" + +namespace OpenSHC { +namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x004E2600 + int ViewportRenderState::resetBatchedRender() + { + this->unitBatchedRenderCounterUntil6 = 1; + this->unitRender1 = 0; + this->unitRender2 = 0; + this->unitRender3 = 0; + this->unitRender4 = 0; + this->unitRender5 = 0; + return 0; + } + +} +} diff --git a/src/OpenSHC/Rendering/ViewportRenderState/resetupViewportThunk.cpp b/src/OpenSHC/Rendering/ViewportRenderState/resetupViewportThunk.cpp new file mode 100644 index 000000000..4c88f30e3 --- /dev/null +++ b/src/OpenSHC/Rendering/ViewportRenderState/resetupViewportThunk.cpp @@ -0,0 +1,14 @@ +#include "../ViewportRenderState.func.hpp" + +namespace OpenSHC { +namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x004E7800 + void ViewportRenderState::resetupViewportThunk() + { + MACRO_CALL_MEMBER(OpenSHC::Rendering::ViewportRenderState_Func::resetupViewport, this)( + this->viewportState.isZoomedOutUnk); + } + +} +} diff --git a/src/OpenSHC/Rendering/ViewportRenderState/restoreFocusTile.cpp b/src/OpenSHC/Rendering/ViewportRenderState/restoreFocusTile.cpp new file mode 100644 index 000000000..cba664253 --- /dev/null +++ b/src/OpenSHC/Rendering/ViewportRenderState/restoreFocusTile.cpp @@ -0,0 +1,13 @@ +#include "../ViewportRenderState.func.hpp" + +namespace OpenSHC { +namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x004E8C90 + void ViewportRenderState::restoreFocusTile() + { + MACRO_CALL_MEMBER(OpenSHC::Rendering::ViewportRenderState_Func::focusOnTile, this)(this->field44_0x18b738); + } + +} +} diff --git a/src/OpenSHC/Rendering/ViewportRenderState/translateXYToTile.cpp b/src/OpenSHC/Rendering/ViewportRenderState/translateXYToTile.cpp new file mode 100644 index 000000000..437a8147a --- /dev/null +++ b/src/OpenSHC/Rendering/ViewportRenderState/translateXYToTile.cpp @@ -0,0 +1,10 @@ +#include "../ViewportRenderState.func.hpp" + +namespace OpenSHC { +namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x00401040 + int ViewportRenderState::translateXYToTile(int x, int y) { return this->translationMatrix[y].addXgetTile + x; } + +} +} diff --git a/src/OpenSHC/Rendering/ViewportRenderState/xyAreValid.cpp b/src/OpenSHC/Rendering/ViewportRenderState/xyAreValid.cpp new file mode 100644 index 000000000..6e1b8ce4f --- /dev/null +++ b/src/OpenSHC/Rendering/ViewportRenderState/xyAreValid.cpp @@ -0,0 +1,17 @@ +#include "../ViewportRenderState.func.hpp" + +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Rendering { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00401000 + BOOLEnum ViewportRenderState::xyAreValid(uint x, uint y) + { + return x <= 399 && y <= 399 && this->DAT_BinaryTileMap400x400[y * 400 + x] != 0; + } + +} +} diff --git a/src/OpenSHC/Rendering/WindowInformation/storeWindowRectangleInfoUnk.cpp b/src/OpenSHC/Rendering/WindowInformation/storeWindowRectangleInfoUnk.cpp new file mode 100644 index 000000000..9ac90b8f8 --- /dev/null +++ b/src/OpenSHC/Rendering/WindowInformation/storeWindowRectangleInfoUnk.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/Rendering/WindowInformation.func.hpp" + +namespace OpenSHC { +namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x00467F60 + void WindowInformation::storeWindowRectangleInfoUnk(LONG left, LONG right, LONG top, LONG bottom) + { + this->RECT_SomeGameWindowRectUnk.left = left; + this->RECT_SomeGameWindowRectUnk.top = top; + this->RECT_SomeGameWindowRectUnk.right = right; + this->RECT_SomeGameWindowRectUnk.bottom = bottom; + } + +} +} diff --git a/src/OpenSHC/Synchrony/Actions/ChangeRations.cpp b/src/OpenSHC/Synchrony/Actions/ChangeRations.cpp new file mode 100644 index 000000000..d627dde81 --- /dev/null +++ b/src/OpenSHC/Synchrony/Actions/ChangeRations.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/Synchrony/Actions.func.hpp" + +#include "OpenSHC/Globals/DAT_GameState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + // FUNCTION: STRONGHOLDCRUSADER 0x00465890 + void Actions::ChangeRations(int playerID, int rationsSetting) + { + DAT_GameState::instance.playerDataArray[playerID].rationsSetting = rationsSetting; + } + +} +} diff --git a/src/OpenSHC/Synchrony/Actions/ChangeTaxes.cpp b/src/OpenSHC/Synchrony/Actions/ChangeTaxes.cpp new file mode 100644 index 000000000..dae8f1c02 --- /dev/null +++ b/src/OpenSHC/Synchrony/Actions/ChangeTaxes.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/Synchrony/Actions.func.hpp" + +#include "OpenSHC/Globals/DAT_GameState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + // FUNCTION: STRONGHOLDCRUSADER 0x00465800 + void Actions::ChangeTaxes(int playerID, int taxesSetting) + { + DAT_GameState::instance.playerDataArray[playerID].taxesSetting = taxesSetting; + } + +} +} diff --git a/src/OpenSHC/Synchrony/Actions/RemovePositionOfPlayer.cpp b/src/OpenSHC/Synchrony/Actions/RemovePositionOfPlayer.cpp new file mode 100644 index 000000000..9d2d66d38 --- /dev/null +++ b/src/OpenSHC/Synchrony/Actions/RemovePositionOfPlayer.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/Synchrony/Actions.func.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + // FUNCTION: STRONGHOLDCRUSADER 0x004285C0 + void Actions::RemovePositionOfPlayer(int playerID) + { + for (int position = 0; position < 8; ++position) { + if ((char)DAT_GameSynchronyState::instance.playerPositionsArray[position] + 1 == playerID) { + DAT_GameSynchronyState::instance.playerPositionsArray[position] = 0xf6; + } + } + } + +} +} diff --git a/src/OpenSHC/Synchrony/Actions/SetBuildingProductionType.cpp b/src/OpenSHC/Synchrony/Actions/SetBuildingProductionType.cpp new file mode 100644 index 000000000..2f336b408 --- /dev/null +++ b/src/OpenSHC/Synchrony/Actions/SetBuildingProductionType.cpp @@ -0,0 +1,18 @@ +#include "OpenSHC/Synchrony/Actions.func.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + // FUNCTION: STRONGHOLDCRUSADER 0x004652A0 + void Actions::SetBuildingProductionType( + undefined4 playerID, int buildingID, ushort producedItemType, int buildingUID) + { + if (DAT_BuildingsState::instance.buildings[buildingID].uid == buildingUID) { + DAT_BuildingsState::instance.buildings[buildingID].producedItemType = producedItemType; + } + } + +} +} diff --git a/src/OpenSHC/Synchrony/Commands/QueueChangeGameIntensityOrBalance.cpp b/src/OpenSHC/Synchrony/Commands/QueueChangeGameIntensityOrBalance.cpp new file mode 100644 index 000000000..b7a006091 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/QueueChangeGameIntensityOrBalance.cpp @@ -0,0 +1,22 @@ +#include "OpenSHC/Synchrony/Commands.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandType.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Commands::GameCommandType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00429630 + void Commands::QueueChangeGameIntensityOrBalance() + { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)( + OpenSHC::Commands::GCT_CHANGE_GAME_INTENSITY_OR_BALANCE); + DAT_GameSynchronyState::instance.field235_0x1072e8 = -1; + DAT_GameSynchronyState::instance.field236_0x1072ec = -1; + } + +} +} diff --git a/src/OpenSHC/Synchrony/Commands/_REMOVED_COMMAND1_.cpp b/src/OpenSHC/Synchrony/Commands/_REMOVED_COMMAND1_.cpp new file mode 100644 index 000000000..3336d85aa --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/_REMOVED_COMMAND1_.cpp @@ -0,0 +1,12 @@ +#include "OpenSHC/Synchrony/Commands.func.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + // FUNCTION: STRONGHOLDCRUSADER 0x00482280 + void Commands::_REMOVED_COMMAND1_() { DAT_GameSynchronyState::instance.DAT_CommandSize = 0; } + +} +} diff --git a/src/OpenSHC/Synchrony/GameSynchronyState/clearGameCommandEntry.cpp b/src/OpenSHC/Synchrony/GameSynchronyState/clearGameCommandEntry.cpp new file mode 100644 index 000000000..096cf171c --- /dev/null +++ b/src/OpenSHC/Synchrony/GameSynchronyState/clearGameCommandEntry.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/IO/LowLevelMemory.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" + +#include "OpenSHC/Globals/DAT_LowLevelMemory.hpp" + +namespace OpenSHC { +namespace Synchrony { + + // FUNCTION: STRONGHOLDCRUSADER 0x004800B0 + void GameSynchronyState::clearGameCommandEntry(int gameCommandID) + { + if (gameCommandID < 200) { + MACRO_CALL_MEMBER(OpenSHC::IO::LowLevelMemory_Func::fillMemory_ByteValue, DAT_LowLevelMemory::ptr)( + sizeof(this->DAT_GameCommandArray[gameCommandID]), 0, &this->DAT_GameCommandArray[gameCommandID]); + } + } + +} +} diff --git a/src/OpenSHC/Synchrony/GameSynchronyState/compressOrCreateLengthPrefixedPacketUnk.cpp b/src/OpenSHC/Synchrony/GameSynchronyState/compressOrCreateLengthPrefixedPacketUnk.cpp new file mode 100644 index 000000000..657e4df40 --- /dev/null +++ b/src/OpenSHC/Synchrony/GameSynchronyState/compressOrCreateLengthPrefixedPacketUnk.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/IO/DecoderState.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" + +#include "OpenSHC/Globals/DAT_DecoderState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + // FUNCTION: STRONGHOLDCRUSADER 0x0047E7E0 + int GameSynchronyState::compressOrCreateLengthPrefixedPacketUnk(int size, char* src, void* dst) + { + return MACRO_CALL_MEMBER(OpenSHC::IO::DecoderState_Func::compressRLE, DAT_DecoderState::ptr)(src, dst, size); + } + +} +} diff --git a/src/OpenSHC/Synchrony/GameSynchronyState/computeSomeHashOnUnitArray.cpp b/src/OpenSHC/Synchrony/GameSynchronyState/computeSomeHashOnUnitArray.cpp new file mode 100644 index 000000000..a7536d067 --- /dev/null +++ b/src/OpenSHC/Synchrony/GameSynchronyState/computeSomeHashOnUnitArray.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/Map/Navigation/DirectionAlgorithmState.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" + +#include "OpenSHC/Globals/DAT_DirectionAlgorithmState.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + // FUNCTION: STRONGHOLDCRUSADER 0x0047EEB0 + int GameSynchronyState::computeSomeHashOnUnitArray() + { + return MACRO_CALL_MEMBER( + OpenSHC::Map::Navigation::DirectionAlgorithmState_Func::computeHash, DAT_DirectionAlgorithmState::ptr)( + sizeof(DAT_UnitsState::instance.units), (int*)DAT_UnitsState::instance.units); + } + +} +} diff --git a/src/OpenSHC/Synchrony/GameSynchronyState/decompressTooLongPacketData.cpp b/src/OpenSHC/Synchrony/GameSynchronyState/decompressTooLongPacketData.cpp new file mode 100644 index 000000000..6574e659e --- /dev/null +++ b/src/OpenSHC/Synchrony/GameSynchronyState/decompressTooLongPacketData.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/IO/DecoderState.func.hpp" +#include "OpenSHC/IO/LowLevelMemory.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" + +#include "OpenSHC/Globals/DAT_DecoderState.hpp" +#include "OpenSHC/Globals/DAT_LowLevelMemory.hpp" + +namespace OpenSHC { +namespace Synchrony { + + // FUNCTION: STRONGHOLDCRUSADER 0x0047E800 + void GameSynchronyState::decompressTooLongPacketData(byte* source, byte* destination) + { + size_t const size = MACRO_CALL_MEMBER(OpenSHC::IO::DecoderState_Func::decompressRLE, DAT_DecoderState::ptr)( + (char*)source, (char*)this->DAT_PacketDecodingDestination); + MACRO_CALL_MEMBER(OpenSHC::IO::LowLevelMemory_Func::copyData, DAT_LowLevelMemory::ptr)( + size, this->DAT_PacketDecodingDestination, destination); + } + +} +} diff --git a/src/OpenSHC/Synchrony/GameSynchronyState/getGameCommandArrayIndex.cpp b/src/OpenSHC/Synchrony/GameSynchronyState/getGameCommandArrayIndex.cpp new file mode 100644 index 000000000..fb01abc83 --- /dev/null +++ b/src/OpenSHC/Synchrony/GameSynchronyState/getGameCommandArrayIndex.cpp @@ -0,0 +1,10 @@ +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" + +namespace OpenSHC { +namespace Synchrony { + + // FUNCTION: STRONGHOLDCRUSADER 0x00480570 + undefined4 GameSynchronyState::getGameCommandArrayIndex() { return this->DAT_GameCommandArrayIndex; } + +} +} diff --git a/src/OpenSHC/Synchrony/GameSynchronyState/isAIPlayer.cpp b/src/OpenSHC/Synchrony/GameSynchronyState/isAIPlayer.cpp new file mode 100644 index 000000000..6c6f8ec95 --- /dev/null +++ b/src/OpenSHC/Synchrony/GameSynchronyState/isAIPlayer.cpp @@ -0,0 +1,20 @@ +#include "../GameSynchronyState.func.hpp" + +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004010B0 + BOOLEnum GameSynchronyState::isAIPlayer(int playerID) + { + if (this->currentPlayerFullIDArray[playerID] != -1) { + return FALSE; + } + return this->currentAIArray[playerID] != 0; + } + +} +} diff --git a/src/OpenSHC/Synchrony/GameSynchronyState/throttledMultiplayerSyncUpdate.cpp b/src/OpenSHC/Synchrony/GameSynchronyState/throttledMultiplayerSyncUpdate.cpp new file mode 100644 index 000000000..0c27a7ecc --- /dev/null +++ b/src/OpenSHC/Synchrony/GameSynchronyState/throttledMultiplayerSyncUpdate.cpp @@ -0,0 +1,26 @@ +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Game/GameMode.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::Game::GameMode; + + // FUNCTION: STRONGHOLDCRUSADER 0x00490340 + void GameSynchronyState::throttledMultiplayerSyncUpdate() + { + if (DAT_GameSynchronyState::instance.currentGameMode == OpenSHC::Game::GM_SOLITARY + || DAT_GameSynchronyState::instance.currentGameMode == OpenSHC::Game::GM_SKIRMISH_SINGLE_PLAYER) { + return; + } + DWORD const now = timeGetTime(); + if (now - this->field309_0x109e94 > 10) { + this->field309_0x109e94 = now; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::sendPeriodicSyncMessages, this)(); + } + } + +} +} diff --git a/src/OpenSHC/Synchrony/GetPlayerPosition.cpp b/src/OpenSHC/Synchrony/GetPlayerPosition.cpp new file mode 100644 index 000000000..fc3a488e1 --- /dev/null +++ b/src/OpenSHC/Synchrony/GetPlayerPosition.cpp @@ -0,0 +1,18 @@ +#include "OpenSHC/Synchrony.func.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x0042AC60 +int Synchrony::GetPlayerPosition(int playerID) +{ + for (int position = 0; position < 8; ++position) { + if (DAT_GameSynchronyState::instance.playerPositionsArray[position] + 1 == playerID) { + return position + 1; + } + } + return 0; +} + +} diff --git a/src/OpenSHC/Synchrony/ProgressBarRelated.cpp b/src/OpenSHC/Synchrony/ProgressBarRelated.cpp new file mode 100644 index 000000000..5e7acdb12 --- /dev/null +++ b/src/OpenSHC/Synchrony/ProgressBarRelated.cpp @@ -0,0 +1,25 @@ +#include "OpenSHC/Synchrony.func.hpp" +#include "OpenSHC/UI/MenuItems/ProgressBarBox.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" + +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" + +namespace OpenSHC { +namespace Synchrony { + + using OpenSHC::UI::Enums::MenuModalType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00495840 + void ProgressBarRelated() + { + DAT_MenuTextInputState::instance.DAT_MenuOptionsActionParameter = 0x1f; + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog2, DAT_MenuModalComposition1::ptr)( + OpenSHC::UI::Enums::MMT_PROGRESS_BAR_BOX); + MACRO_CALL(OpenSHC::UI::MenuItems::ProgressBarBox_Func:: + MenuItemActionHandler_ProgressBarBox_LoadAndSaveGameButtonLogic)(0); + } + +} +} diff --git a/src/OpenSHC/UI/BuildingMenus/RenderBuildingMenu_RecruitingBuilding.cpp b/src/OpenSHC/UI/BuildingMenus/RenderBuildingMenu_RecruitingBuilding.cpp new file mode 100644 index 000000000..fb6fbc3d3 --- /dev/null +++ b/src/OpenSHC/UI/BuildingMenus/RenderBuildingMenu_RecruitingBuilding.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Map/Buildings/BuildingsState.func.hpp" +#include "OpenSHC/UI/BuildingMenus.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" + +namespace OpenSHC { +namespace UI { + namespace BuildingMenus { + + // FUNCTION: STRONGHOLDCRUSADER 0x0043A8D0 + void RenderBuildingMenu_RecruitingBuilding() + { + MACRO_CALL_MEMBER( + OpenSHC::Map::Buildings::BuildingsState_Func::createEntityForAssemblyPointsForActiveTabType, + DAT_BuildingsState::ptr)(); + } + + } +} +} diff --git a/src/OpenSHC/UI/Credits/AppendCreditsClearImageCommand.cpp b/src/OpenSHC/UI/Credits/AppendCreditsClearImageCommand.cpp new file mode 100644 index 000000000..4d4654d65 --- /dev/null +++ b/src/OpenSHC/UI/Credits/AppendCreditsClearImageCommand.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/Credits.func.hpp" + +#include "OpenSHC/Globals/DAT_ARRAY_00eb9b68.hpp" +#include "OpenSHC/Globals/DAT_UnknownBinkCount.hpp" + +namespace OpenSHC { +namespace UI { + namespace Credits { + + // FUNCTION: STRONGHOLDCRUSADER 0x004DA8A0 + void AppendCreditsClearImageCommand() + { + if ((int)DAT_UnknownBinkCount::instance < 288) { + DAT_ARRAY_00eb9b68::instance[DAT_UnknownBinkCount::instance].field0_0x0 = 0x28; + DAT_UnknownBinkCount::instance += 1; + } + } + + } +} +} diff --git a/src/OpenSHC/UI/Credits/AppendCreditsCommand.cpp b/src/OpenSHC/UI/Credits/AppendCreditsCommand.cpp new file mode 100644 index 000000000..1b264e8ff --- /dev/null +++ b/src/OpenSHC/UI/Credits/AppendCreditsCommand.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/Credits.func.hpp" + +#include "OpenSHC/Globals/DAT_ARRAY_00eb9b68.hpp" +#include "OpenSHC/Globals/DAT_UnknownBinkCount.hpp" + +namespace OpenSHC { +namespace UI { + namespace Credits { + + // FUNCTION: STRONGHOLDCRUSADER 0x004DA7E0 + void AppendCreditsCommand(int command) + { + if ((int)DAT_UnknownBinkCount::instance < 288) { + DAT_ARRAY_00eb9b68::instance[DAT_UnknownBinkCount::instance].field0_0x0 = command; + DAT_UnknownBinkCount::instance += 1; + } + } + + } +} +} diff --git a/src/OpenSHC/UI/Credits/AppendCreditsListTerminator.cpp b/src/OpenSHC/UI/Credits/AppendCreditsListTerminator.cpp new file mode 100644 index 000000000..1a4468cc2 --- /dev/null +++ b/src/OpenSHC/UI/Credits/AppendCreditsListTerminator.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/Credits.func.hpp" + +#include "OpenSHC/Globals/DAT_ARRAY_00eb9b68.hpp" +#include "OpenSHC/Globals/DAT_UnknownBinkCount.hpp" + +namespace OpenSHC { +namespace UI { + namespace Credits { + + // FUNCTION: STRONGHOLDCRUSADER 0x004DA810 + void AppendCreditsListTerminator() + { + if ((int)DAT_UnknownBinkCount::instance < 288) { + DAT_ARRAY_00eb9b68::instance[DAT_UnknownBinkCount::instance].field0_0x0 = 0x20; + DAT_UnknownBinkCount::instance += 1; + } + } + + } +} +} diff --git a/src/OpenSHC/UI/Credits/AppendCreditsPauseCommand.cpp b/src/OpenSHC/UI/Credits/AppendCreditsPauseCommand.cpp new file mode 100644 index 000000000..98b285fcc --- /dev/null +++ b/src/OpenSHC/UI/Credits/AppendCreditsPauseCommand.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/Credits.func.hpp" + +#include "OpenSHC/Globals/DAT_ARRAY_00eb9b68.hpp" +#include "OpenSHC/Globals/DAT_UnknownBinkCount.hpp" + +namespace OpenSHC { +namespace UI { + namespace Credits { + + // FUNCTION: STRONGHOLDCRUSADER 0x004DA840 + void AppendCreditsPauseCommand() + { + if ((int)DAT_UnknownBinkCount::instance < 288) { + DAT_ARRAY_00eb9b68::instance[DAT_UnknownBinkCount::instance].field0_0x0 = 0x1c; + DAT_UnknownBinkCount::instance += 1; + } + } + + } +} +} diff --git a/src/OpenSHC/UI/Credits/AppendCreditsSegmentEndCommand.cpp b/src/OpenSHC/UI/Credits/AppendCreditsSegmentEndCommand.cpp new file mode 100644 index 000000000..009b7c581 --- /dev/null +++ b/src/OpenSHC/UI/Credits/AppendCreditsSegmentEndCommand.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/Credits.func.hpp" + +#include "OpenSHC/Globals/DAT_ARRAY_00eb9b68.hpp" +#include "OpenSHC/Globals/DAT_UnknownBinkCount.hpp" + +namespace OpenSHC { +namespace UI { + namespace Credits { + + // FUNCTION: STRONGHOLDCRUSADER 0x004DA870 + void AppendCreditsSegmentEndCommand() + { + if ((int)DAT_UnknownBinkCount::instance < 288) { + DAT_ARRAY_00eb9b68::instance[DAT_UnknownBinkCount::instance].field0_0x0 = 0x1f; + DAT_UnknownBinkCount::instance += 1; + } + } + + } +} +} diff --git a/src/OpenSHC/UI/Credits/AppendCreditsSoundStreamCommand.cpp b/src/OpenSHC/UI/Credits/AppendCreditsSoundStreamCommand.cpp new file mode 100644 index 000000000..3fd969984 --- /dev/null +++ b/src/OpenSHC/UI/Credits/AppendCreditsSoundStreamCommand.cpp @@ -0,0 +1,25 @@ +#include "OpenSHC/UI/Credits.func.hpp" +#include "OpenSHC/Audio/MSS/enums/SHC_SoundStream.hpp" + +#include "OpenSHC/Globals/DAT_ARRAY_00eb9b68.hpp" +#include "OpenSHC/Globals/DAT_UnknownBinkCount.hpp" + +namespace OpenSHC { +namespace UI { + namespace Credits { + + using OpenSHC::Audio::MSS::enums::SHC_SoundStream; + + // FUNCTION: STRONGHOLDCRUSADER 0x004DABF0 + void AppendCreditsSoundStreamCommand(int command, SHC_SoundStream soundStream) + { + if ((int)DAT_UnknownBinkCount::instance < 288) { + DAT_ARRAY_00eb9b68::instance[DAT_UnknownBinkCount::instance].field0_0x0 = command; + DAT_ARRAY_00eb9b68::instance[DAT_UnknownBinkCount::instance].soundStream = soundStream; + DAT_UnknownBinkCount::instance += 1; + } + } + + } +} +} diff --git a/src/OpenSHC/UI/Credits/SetActiveCreditsSequenceIndex.cpp b/src/OpenSHC/UI/Credits/SetActiveCreditsSequenceIndex.cpp new file mode 100644 index 000000000..97331b4de --- /dev/null +++ b/src/OpenSHC/UI/Credits/SetActiveCreditsSequenceIndex.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/UI/Credits.func.hpp" + +#include "OpenSHC/Globals/DAT_00ed3120.hpp" +#include "OpenSHC/Globals/DAT_00ed3124.hpp" + +namespace OpenSHC { +namespace UI { + namespace Credits { + + // FUNCTION: STRONGHOLDCRUSADER 0x004D9270 + void __cdecl SetActiveCreditsSequenceIndex(undefined4 sequenceIndex) + { + DAT_00ed3124::instance = sequenceIndex; + DAT_00ed3120::instance = 0; + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/ActivateGameSpeedAndResourceLackDisplayElementUnk.cpp b/src/OpenSHC/UI/DisplayElements/ActivateGameSpeedAndResourceLackDisplayElementUnk.cpp new file mode 100644 index 000000000..3df60c966 --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/ActivateGameSpeedAndResourceLackDisplayElementUnk.cpp @@ -0,0 +1,27 @@ +#include "OpenSHC/UI/DisplayElements.func.hpp" +#include "OpenSHC/UI/DisplayElement.hpp" +#include "OpenSHC/UI/Enums/DisplayElementID.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + using OpenSHC::UI::DisplayElement; + using OpenSHC::UI::Enums::DisplayElementID; + + // FUNCTION: STRONGHOLDCRUSADER 0x004AF680 + void ActivateGameSpeedAndResourceLackDisplayElementUnk( + DisplayElementID elementId, dword elementState, int displayDuration) + { + DisplayElement* const displayElement + = MACRO_CALL(OpenSHC::UI::DisplayElements_Func::FindDisplayElementWithID)(elementId); + if (displayElement != NULL) { + displayElement->elementStateUnk_0xc = elementState; + displayElement->displayDuration_0x14 = displayDuration; + displayElement->activationTime_0x10 = timeGetTime(); + } + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/CheckDisplayElementByIDAndSetForUnlimitedDisplay.cpp b/src/OpenSHC/UI/DisplayElements/CheckDisplayElementByIDAndSetForUnlimitedDisplay.cpp new file mode 100644 index 000000000..9b155c257 --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/CheckDisplayElementByIDAndSetForUnlimitedDisplay.cpp @@ -0,0 +1,33 @@ +#include "OpenSHC/UI/DisplayElements.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/DisplayElement.hpp" +#include "OpenSHC/UI/Enums/DisplayElementID.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/BOOL_RelatedToInitialGranaryAndKeepPlacement.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + using OpenSHC::UI::DisplayElement; + using OpenSHC::UI::Enums::DisplayElementID; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004AF650 + void CheckDisplayElementByIDAndSetForUnlimitedDisplay(DisplayElementID displayElementID, dword elementState) + { + DisplayElement* const displayElement + = MACRO_CALL(OpenSHC::UI::DisplayElements_Func::FindDisplayElementWithID)(displayElementID); + if (displayElement != NULL) { + if (displayElement->elementStateUnk_0xc != elementState) { + BOOL_RelatedToInitialGranaryAndKeepPlacement::instance = FALSE; + } + displayElement->elementStateUnk_0xc = elementState; + displayElement->displayDuration_0x14 = -1; + } + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/FindDisplayElementWithID.cpp b/src/OpenSHC/UI/DisplayElements/FindDisplayElementWithID.cpp new file mode 100644 index 000000000..1541c48e8 --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/FindDisplayElementWithID.cpp @@ -0,0 +1,26 @@ +#include "OpenSHC/UI/DisplayElements.func.hpp" +#include "OpenSHC/UI/DisplayElement.hpp" + +#include "OpenSHC/Globals/DAT_PointerToDisplayElementStackTop.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + using OpenSHC::UI::DisplayElement; + + // FUNCTION: STRONGHOLDCRUSADER 0x004AF630 + DisplayElement* FindDisplayElementWithID(int elementID) + { + for (DisplayElement* element = DAT_PointerToDisplayElementStackTop::instance; element != NULL; + element = element->nextDisplayElement_0x20) { + if (element->elementID_0x8 == elementID) { + return element; + } + } + return NULL; + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/GetIfDisplayElementStateNotZero.cpp b/src/OpenSHC/UI/DisplayElements/GetIfDisplayElementStateNotZero.cpp new file mode 100644 index 000000000..1d8079e41 --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/GetIfDisplayElementStateNotZero.cpp @@ -0,0 +1,28 @@ +#include "OpenSHC/UI/DisplayElements.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/DisplayElement.hpp" +#include "OpenSHC/UI/Enums/DisplayElementID.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + using OpenSHC::UI::DisplayElement; + using OpenSHC::UI::Enums::DisplayElementID; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004AF6E0 + BOOLEnum GetIfDisplayElementStateNotZero(DisplayElementID displayElementID) + { + DisplayElement* const displayElement + = MACRO_CALL(OpenSHC::UI::DisplayElements_Func::FindDisplayElementWithID)(displayElementID); + if (displayElement != NULL) { + return displayElement->elementStateUnk_0xc != 0; + } + return FALSE; + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/RenderInGameChatDisplayElement.cpp b/src/OpenSHC/UI/DisplayElements/RenderInGameChatDisplayElement.cpp new file mode 100644 index 000000000..393ce5c67 --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/RenderInGameChatDisplayElement.cpp @@ -0,0 +1,20 @@ +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/UI/DisplayElements.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AF800 + void RenderInGameChatDisplayElement(int posX, int posY, DWORD elementState) + { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::renderInGameChat, + DAT_GameSynchronyState::ptr)(posX, posY, elementState); + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/RenderNoRushDisplayElementUnk.cpp b/src/OpenSHC/UI/DisplayElements/RenderNoRushDisplayElementUnk.cpp new file mode 100644 index 000000000..47577c0a1 --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/RenderNoRushDisplayElementUnk.cpp @@ -0,0 +1,103 @@ +#include "OpenSHC/Audio/SFX/SFXState.func.hpp" +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/DisplayElements.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/Rendering/ScreenResolutionEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" +#include "OpenSHC/UI/Enums/DisplayElementID.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/COL_DARK_LIME.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_SFXState.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + using OpenSHC::DE::SHCDE::eTextSections; + using OpenSHC::Rendering::ScreenResolutionEnum; + using OpenSHC::Rendering::Enums::RenderTarget; + using OpenSHC::Text::TextAlignment; + using OpenSHC::UI::Enums::DisplayElementID; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004B20B0 + void RenderNoRushDisplayElementUnk(int posX, int posY, DWORD elementState) + { + if (DAT_GameState::instance.mapAndTime.skirmishNoRushTicks == 0) { + // Plays pa paam pa pa pa paam + MACRO_CALL_MEMBER(OpenSHC::Audio::SFX::SFXState_Func::playWAVSFX, DAT_SFXState::ptr)( + s_battlehorn_wav_005a77d8); + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_NO_RUSH, 0); + return; + } + int const barWidth + = MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::computeTextWidth, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_MISC, 7), + 18) + + 50; + int x = posX + 800; + DAT_PencilRenderCore::instance.surfaceTarget = OpenSHC::Rendering::Enums::RT_MAP_GAME; + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1024x768) { + x += 112; + } else if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1280x1024) { + x -= 240; + } else if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1600x1200) { + x -= 400; + } else if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1280x720) { + x -= 240; + } else if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1440x900) { + x -= 320; + } else if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1920x1080) { + x -= 560; + } else if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1920x1200) { + x -= 560; + } else if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_2560x1440) { + x -= 880; + } else if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_2560x1600) { + x -= 880; + } else if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1366x768) { + x -= 283; + } else if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1680x1050) { + x -= 440; + } else if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1600x900) { + x -= 400; + } else if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1024x600) { + x -= 112; + } else if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_1360x768) { + x -= 280; + } + x += -18 - (barWidth / 2); + int const left = x - (barWidth / 2); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBlendedBlackBox, + DAT_PencilRenderCore::ptr)(left - 7, posY - 5, (barWidth / 2) + 5 + x, posY + 30, 16); + 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_SKIRMISH_MISC, 7), + x, posY, OpenSHC::Text::TTA_CENTER, 0xc2f0eb, 0, 18, FALSE, 0); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBorderBox, DAT_PencilRenderCore::ptr)( + left - 1, posY + 18, (barWidth / 2) + 1 + x, posY + 24, COL_BLACK::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)( + left, posY + 19, + (DAT_GameState::instance.mapAndTime.skirmishNoRushTicks * barWidth) + / DAT_GameState::instance.mapAndTime.skirmishNoRushTicksLeft + - (barWidth / 2) + x, + posY + 23, COL_DARK_LIME::instance.shortValue); + DAT_PencilRenderCore::instance.surfaceTarget = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/RenderNoTreeGrowthTextDisplayElement.cpp b/src/OpenSHC/UI/DisplayElements/RenderNoTreeGrowthTextDisplayElement.cpp new file mode 100644 index 000000000..b08f357bf --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/RenderNoTreeGrowthTextDisplayElement.cpp @@ -0,0 +1,26 @@ +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/DisplayElements.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + using OpenSHC::Text::TextAlignment; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004AFB00 + void RenderNoTreeGrowthTextDisplayElement(int posX, int posY, DWORD elementState) + { + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderInGameTextWithShadow, DAT_TextManagerObject::ptr)( + s_No_tree_growth_005a779c, posX, posY, OpenSHC::Text::TTA_LEFT, 0x80ff, 0, 0x11, FALSE, 0); + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/RenderResourceMissing1DisplayElement.cpp b/src/OpenSHC/UI/DisplayElements/RenderResourceMissing1DisplayElement.cpp new file mode 100644 index 000000000..aaf3eb480 --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/RenderResourceMissing1DisplayElement.cpp @@ -0,0 +1,20 @@ +#include "OpenSHC/Audio/MissingResourceState.func.hpp" +#include "OpenSHC/UI/DisplayElements.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" + +#include "OpenSHC/Globals/DAT_MissingResourceState.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AF820 + void RenderResourceMissing1DisplayElement(int posX, int posY, DWORD elementState) + { + MACRO_CALL_MEMBER(OpenSHC::Audio::MissingResourceState_Func::renderResourceMissingText, + DAT_MissingResourceState::ptr)(posX, posY, elementState, 1); + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/RenderResourceMissing2DisplayElement.cpp b/src/OpenSHC/UI/DisplayElements/RenderResourceMissing2DisplayElement.cpp new file mode 100644 index 000000000..cfb6fde6c --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/RenderResourceMissing2DisplayElement.cpp @@ -0,0 +1,20 @@ +#include "OpenSHC/Audio/MissingResourceState.func.hpp" +#include "OpenSHC/UI/DisplayElements.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" + +#include "OpenSHC/Globals/DAT_MissingResourceState.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AF840 + void RenderResourceMissing2DisplayElement(int posX, int posY, DWORD elementState) + { + MACRO_CALL_MEMBER(OpenSHC::Audio::MissingResourceState_Func::renderResourceMissingText, + DAT_MissingResourceState::ptr)(posX, posY, elementState, 2); + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/RenderUnknownDisplayElement7.cpp b/src/OpenSHC/UI/DisplayElements/RenderUnknownDisplayElement7.cpp new file mode 100644 index 000000000..94fc228bb --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/RenderUnknownDisplayElement7.cpp @@ -0,0 +1,27 @@ +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/DisplayElements.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_UnknownStopwatch.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + using OpenSHC::Text::TextAlignment; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004AFA50 + void RenderUnknownDisplayElement7(int posX, int posY, DWORD elementState) + { + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderNumber2, DAT_TextManagerObject::ptr)( + DAT_UnknownStopwatch::instance.duration_0x0, posX, posY + 5, OpenSHC::Text::TTA_RIGHT, 0x80ff, 0, 0xf, + FALSE, 0); + } + + } +} +} diff --git a/src/OpenSHC/UI/DisplayElements/TogglePlayerPingDisplayElementUnk.cpp b/src/OpenSHC/UI/DisplayElements/TogglePlayerPingDisplayElementUnk.cpp new file mode 100644 index 000000000..38fe7d0f5 --- /dev/null +++ b/src/OpenSHC/UI/DisplayElements/TogglePlayerPingDisplayElementUnk.cpp @@ -0,0 +1,26 @@ +#include "OpenSHC/UI/DisplayElements.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/DisplayElement.hpp" +#include "OpenSHC/UI/Enums/DisplayElementID.hpp" + +namespace OpenSHC { +namespace UI { + namespace DisplayElements { + + using OpenSHC::UI::DisplayElement; + using OpenSHC::UI::Enums::DisplayElementID; + + // FUNCTION: STRONGHOLDCRUSADER 0x004AF6B0 + void TogglePlayerPingDisplayElementUnk(DisplayElementID displayElementID, uint toggleValue) + { + DisplayElement* const displayElement + = MACRO_CALL(OpenSHC::UI::DisplayElements_Func::FindDisplayElementWithID)(displayElementID); + if (displayElement != NULL) { + displayElement->displayDuration_0x14 = -1; + displayElement->elementStateUnk_0xc = displayElement->elementStateUnk_0xc != 0 ? 0 : toggleValue; + } + } + + } +} +} diff --git a/src/OpenSHC/UI/GreatestLord/IfAiGreatestLordGetAiType.cpp b/src/OpenSHC/UI/GreatestLord/IfAiGreatestLordGetAiType.cpp new file mode 100644 index 000000000..58c519aa6 --- /dev/null +++ b/src/OpenSHC/UI/GreatestLord/IfAiGreatestLordGetAiType.cpp @@ -0,0 +1,23 @@ +#include "OpenSHC/UI/GreatestLord.func.hpp" +#include "OpenSHC/AI/AIType.hpp" + +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace UI { + + using OpenSHC::AI::AIType; + + // FUNCTION: STRONGHOLDCRUSADER 0x0044B7D0 + int GreatestLord::IfAiGreatestLordGetAiType() + { + int const playerID = MACRO_CALL(OpenSHC::UI::GreatestLord_Func::GetPlayerAtRank)(0); + if (playerID != 0 && DAT_GameSynchronyState::instance.currentAIArray[playerID] != 0) { + return DAT_GameState::instance.playerDataArray[playerID].aiType - 1; + } + return 0; + } + +} +} diff --git a/src/OpenSHC/UI/Helpers/AModalDialogIsActiveButIsNotQuitting.cpp b/src/OpenSHC/UI/Helpers/AModalDialogIsActiveButIsNotQuitting.cpp new file mode 100644 index 000000000..70f48c274 --- /dev/null +++ b/src/OpenSHC/UI/Helpers/AModalDialogIsActiveButIsNotQuitting.cpp @@ -0,0 +1,27 @@ +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" + +namespace OpenSHC { +namespace UI { + + using OpenSHC::UI::Enums::MenuModalType; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00427210 + BOOLEnum Helpers::AModalDialogIsActiveButIsNotQuitting() + { + if (DAT_MenuModalComposition1::instance.activeModalDialogID != OpenSHC::UI::Enums::MMT_NONE + && DAT_MenuModalComposition1::instance.activeModalDialogID != OpenSHC::UI::Enums::MMT_BASIC_AI_LORD_SELECT + && DAT_MenuModalComposition1::instance.activeModalDialogID + != OpenSHC::UI::Enums::MMT_EXTENDED_AI_LORD_SELECT + && DAT_MenuModalComposition1::instance.activeModalDialogID != OpenSHC::UI::Enums::MMT_ROUNDTABLE) { + return TRUE; + } + return FALSE; + } + +} +} diff --git a/src/OpenSHC/UI/Helpers/CaptureCurrentTimeToUnknownTime01.cpp b/src/OpenSHC/UI/Helpers/CaptureCurrentTimeToUnknownTime01.cpp new file mode 100644 index 000000000..b028ec435 --- /dev/null +++ b/src/OpenSHC/UI/Helpers/CaptureCurrentTimeToUnknownTime01.cpp @@ -0,0 +1,14 @@ +#include "OpenSHC/UI/Helpers.func.hpp" + +#include "OpenSHC/Globals/DAT_UnknownTime_01.hpp" + +namespace OpenSHC { +namespace UI { + namespace Helpers { + + // FUNCTION: STRONGHOLDCRUSADER 0x004B9610 + void CaptureCurrentTimeToUnknownTime01() { DAT_UnknownTime_01::instance = timeGetTime(); } + + } +} +} diff --git a/src/OpenSHC/UI/Helpers/CheckGoldResource.cpp b/src/OpenSHC/UI/Helpers/CheckGoldResource.cpp new file mode 100644 index 000000000..66b2125ef --- /dev/null +++ b/src/OpenSHC/UI/Helpers/CheckGoldResource.cpp @@ -0,0 +1,25 @@ +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace UI { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004650C0 + BOOLEnum Helpers::CheckGoldResource(int unitIndex) + { + int requiredGold = 0; + if (unitIndex == 5) { + requiredGold = 30; + } + return DAT_GameState::instance.playerDataArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] + .currentResources[OpenSHC::Game::Resources::RT_GOLD] + >= requiredGold; + } + +} +} diff --git a/src/OpenSHC/UI/Helpers/CheckIfEnoughGoldForLadderman.cpp b/src/OpenSHC/UI/Helpers/CheckIfEnoughGoldForLadderman.cpp new file mode 100644 index 000000000..5ea25ac2e --- /dev/null +++ b/src/OpenSHC/UI/Helpers/CheckIfEnoughGoldForLadderman.cpp @@ -0,0 +1,20 @@ +#include "OpenSHC/UI/Helpers.func.hpp" + +#include "OpenSHC/Globals/DAT_EnoughGoldForRequestedUnit.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace UI { + + // FUNCTION: STRONGHOLDCRUSADER 0x00465080 + void Helpers::CheckIfEnoughGoldForLadderman() + { + DAT_EnoughGoldForRequestedUnit::instance + = DAT_GameState::instance.playerDataArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] + .currentResources[OpenSHC::Game::Resources::RT_GOLD] + >= 4; + } + +} +} diff --git a/src/OpenSHC/UI/Helpers/CheckIfEnoughGoldForMonk.cpp b/src/OpenSHC/UI/Helpers/CheckIfEnoughGoldForMonk.cpp new file mode 100644 index 000000000..adfdee6dc --- /dev/null +++ b/src/OpenSHC/UI/Helpers/CheckIfEnoughGoldForMonk.cpp @@ -0,0 +1,20 @@ +#include "OpenSHC/UI/Helpers.func.hpp" + +#include "OpenSHC/Globals/DAT_EnoughGoldForRequestedUnit.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace UI { + + // FUNCTION: STRONGHOLDCRUSADER 0x004650A0 + void Helpers::CheckIfEnoughGoldForMonk() + { + DAT_EnoughGoldForRequestedUnit::instance + = DAT_GameState::instance.playerDataArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] + .currentResources[OpenSHC::Game::Resources::RT_GOLD] + >= 10; + } + +} +} diff --git a/src/OpenSHC/UI/Helpers/CheckIfEnoughGoldForTunneler.cpp b/src/OpenSHC/UI/Helpers/CheckIfEnoughGoldForTunneler.cpp new file mode 100644 index 000000000..986dc27bf --- /dev/null +++ b/src/OpenSHC/UI/Helpers/CheckIfEnoughGoldForTunneler.cpp @@ -0,0 +1,20 @@ +#include "OpenSHC/UI/Helpers.func.hpp" + +#include "OpenSHC/Globals/DAT_EnoughGoldForRequestedUnit.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace UI { + + // FUNCTION: STRONGHOLDCRUSADER 0x004650F0 + void Helpers::CheckIfEnoughGoldForTunneler() + { + DAT_EnoughGoldForRequestedUnit::instance + = DAT_GameState::instance.playerDataArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] + .currentResources[OpenSHC::Game::Resources::RT_GOLD] + >= 30; + } + +} +} diff --git a/src/OpenSHC/UI/Helpers/DisableMercPostPortraits.cpp b/src/OpenSHC/UI/Helpers/DisableMercPostPortraits.cpp new file mode 100644 index 000000000..09eb1fb8e --- /dev/null +++ b/src/OpenSHC/UI/Helpers/DisableMercPostPortraits.cpp @@ -0,0 +1,14 @@ +#include "OpenSHC/UI/Helpers.func.hpp" + +#include "OpenSHC/Globals/DAT_DisableMercPostPortraits.hpp" + +namespace OpenSHC { +namespace UI { + namespace Helpers { + + // FUNCTION: STRONGHOLDCRUSADER 0x00466E10 + void DisableMercPostPortraits() { DAT_DisableMercPostPortraits::instance = 1; } + + } +} +} diff --git a/src/OpenSHC/UI/Helpers/LoadTGX_shc_back.cpp b/src/OpenSHC/UI/Helpers/LoadTGX_shc_back.cpp new file mode 100644 index 000000000..8c464f386 --- /dev/null +++ b/src/OpenSHC/UI/Helpers/LoadTGX_shc_back.cpp @@ -0,0 +1,20 @@ +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace Helpers { + + // FUNCTION: STRONGHOLDCRUSADER 0x00424BD0 + void LoadTGX_shc_back() + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_shc_back_tgx_005a1f8c); + } + + } +} +} diff --git a/src/OpenSHC/UI/Helpers/PlayAMessageFromAI.cpp b/src/OpenSHC/UI/Helpers/PlayAMessageFromAI.cpp new file mode 100644 index 000000000..c97e51f04 --- /dev/null +++ b/src/OpenSHC/UI/Helpers/PlayAMessageFromAI.cpp @@ -0,0 +1,31 @@ +#include "OpenSHC/Audio/SFX/SFXState.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" + +#include "OpenSHC/Globals/DAT_MissionAestheticsDefinedData.hpp" +#include "OpenSHC/Globals/DAT_SFXState.hpp" + +namespace OpenSHC { +namespace UI { + namespace Helpers { + + /* + Plays a WAV sound effect from the mission aesthetics data table. messageIndex is the column index + (0-16) and speakerIndex is the row index (1-33). Bounds-checks both params and calls + SFXState::playWAVSFX with the resolved filename pointer. + + renamed by: Claude Sonnet 4.6 + */ + + // FUNCTION: STRONGHOLDCRUSADER 0x004B7F60 + void PlayAMessageFromAI(uint messageIndex, int speakerIndex) + { + if (messageIndex <= 16 && speakerIndex - 1U <= 32) { + MACRO_CALL_MEMBER(OpenSHC::Audio::SFX::SFXState_Func::playWAVSFX, DAT_SFXState::ptr)( + (char const*)DAT_MissionAestheticsDefinedData::instance + .field92_0x170[speakerIndex * 17 + messageIndex - 12]); + } + } + + } +} +} diff --git a/src/OpenSHC/UI/Helpers/RestoreScenarioGold.cpp b/src/OpenSHC/UI/Helpers/RestoreScenarioGold.cpp new file mode 100644 index 000000000..191ed7be0 --- /dev/null +++ b/src/OpenSHC/UI/Helpers/RestoreScenarioGold.cpp @@ -0,0 +1,18 @@ +#include "OpenSHC/UI/Helpers.func.hpp" + +#include "OpenSHC/Globals/DAT_CopyOfScenarioGold.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" + +namespace OpenSHC { +namespace UI { + namespace Helpers { + + // FUNCTION: STRONGHOLDCRUSADER 0x004B8210 + void RestoreScenarioGold() + { + DAT_GameState::instance.mapAndTime.scenarioGold = (short)DAT_CopyOfScenarioGold::instance; + } + + } +} +} diff --git a/src/OpenSHC/UI/Helpers/SetEnoughGoldForRequestedUnitToTrueUnk.cpp b/src/OpenSHC/UI/Helpers/SetEnoughGoldForRequestedUnitToTrueUnk.cpp new file mode 100644 index 000000000..22b974ab8 --- /dev/null +++ b/src/OpenSHC/UI/Helpers/SetEnoughGoldForRequestedUnitToTrueUnk.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_EnoughGoldForRequestedUnit.hpp" + +namespace OpenSHC { +namespace UI { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00466E00 + void Helpers::SetEnoughGoldForRequestedUnitToTrueUnk() { DAT_EnoughGoldForRequestedUnit::instance = TRUE; } + +} +} diff --git a/src/OpenSHC/UI/Helpers/SetTaxesSetting_unknown.cpp b/src/OpenSHC/UI/Helpers/SetTaxesSetting_unknown.cpp new file mode 100644 index 000000000..7a510db61 --- /dev/null +++ b/src/OpenSHC/UI/Helpers/SetTaxesSetting_unknown.cpp @@ -0,0 +1,23 @@ +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { +namespace UI { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00433560 + void Helpers::SetTaxesSetting_unknown(int taxesSettingUnk) + { + if (DAT_GameCore::instance.taxesSettingUnk == 0) { + DAT_GameCore::instance.taxesSettingUnk = taxesSettingUnk; + DAT_GameCore::instance.unknownScribeRelatedFlag_0x130 = TRUE; + DAT_GameCore::instance.taxestimeUnk = timeGetTime(); + DAT_GameCore::instance.scribeAnimationFrame2 = 0; + } + } + +} +} diff --git a/src/OpenSHC/UI/Helpers/SetTutorialBuildingActionState.cpp b/src/OpenSHC/UI/Helpers/SetTutorialBuildingActionState.cpp new file mode 100644 index 000000000..2674f69d3 --- /dev/null +++ b/src/OpenSHC/UI/Helpers/SetTutorialBuildingActionState.cpp @@ -0,0 +1,31 @@ +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/Map/Buildings/BuildingType.hpp" + +#include "OpenSHC/Globals/DAT_00df5588.hpp" +#include "OpenSHC/Globals/DAT_00df558c.hpp" + +namespace OpenSHC { +namespace UI { + + using OpenSHC::Map::Buildings::BuildingType; + + /* + Sets DAT_00df5588 (tutorial action type) and DAT_00df558c (building type) unless actionState is 11 + and DAT_00df5588 is already 7 — in which case the update is skipped to avoid overwriting a + pending state. Used to record which building-related action the player last performed for + tutorial step evaluation. + + renamed by: Claude Sonnet 4.6 + */ + + // FUNCTION: STRONGHOLDCRUSADER 0x004BC690 + void Helpers::SetTutorialBuildingActionState(int actionState, BuildingType buildingType) + { + if (actionState != 11 || DAT_00df5588::instance != 7) { + DAT_00df5588::instance = actionState; + DAT_00df558c::instance = buildingType; + } + } + +} +} diff --git a/src/OpenSHC/UI/Helpers/SetTutorialHintActiveWithTimestamp.cpp b/src/OpenSHC/UI/Helpers/SetTutorialHintActiveWithTimestamp.cpp new file mode 100644 index 000000000..3f2d9ac4c --- /dev/null +++ b/src/OpenSHC/UI/Helpers/SetTutorialHintActiveWithTimestamp.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/UI/Helpers.func.hpp" + +#include "OpenSHC/Globals/DAT_00df5564.hpp" +#include "OpenSHC/Globals/DWORD_00df5568.hpp" + +namespace OpenSHC { +namespace UI { + namespace Helpers { + + // FUNCTION: STRONGHOLDCRUSADER 0x004BC770 + void SetTutorialHintActiveWithTimestamp() + { + DAT_00df5564::instance = 1; + DWORD_00df5568::instance = timeGetTime(); + } + + } +} +} diff --git a/src/OpenSHC/UI/Helpers/ShowProgressBarSaveLoadDialog.cpp b/src/OpenSHC/UI/Helpers/ShowProgressBarSaveLoadDialog.cpp new file mode 100644 index 000000000..b4613b109 --- /dev/null +++ b/src/OpenSHC/UI/Helpers/ShowProgressBarSaveLoadDialog.cpp @@ -0,0 +1,28 @@ +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuItems/ProgressBarBox.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" + +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" + +namespace OpenSHC { +namespace UI { + namespace Helpers { + + using OpenSHC::UI::Enums::MenuModalType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00495800 + void ShowProgressBarSaveLoadDialog(int isSaving) + { + DAT_MenuTextInputState::instance.DAT_MenuOptionsActionParameter = (isSaving != 0 ? 14 : 0) + 32; + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog2, + DAT_MenuModalComposition1::ptr)(OpenSHC::UI::Enums::MMT_PROGRESS_BAR_BOX); + DAT_MenuModalComposition1::instance.activeModalDialogID = OpenSHC::UI::Enums::MMT_PROGRESS_BAR_BOX; + MACRO_CALL(OpenSHC::UI::MenuItems::ProgressBarBox_Func:: + MenuItemActionHandler_ProgressBarBox_LoadAndSaveGameButtonLogic)(0); + } + + } +} +} diff --git a/src/OpenSHC/UI/Helpers/SumUnitPoints.cpp b/src/OpenSHC/UI/Helpers/SumUnitPoints.cpp new file mode 100644 index 000000000..3dfb06823 --- /dev/null +++ b/src/OpenSHC/UI/Helpers/SumUnitPoints.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/Map/MapPropertiesState.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" + +#include "OpenSHC/Globals/DAT_MapPropertiesState.hpp" + +namespace OpenSHC { +namespace UI { + + // FUNCTION: STRONGHOLDCRUSADER 0x004B8200 + void Helpers::SumUnitPoints() + { + MACRO_CALL_MEMBER(OpenSHC::Map::MapPropertiesState_Func::sumUnitPoints, DAT_MapPropertiesState::ptr)(); + } + +} +} diff --git a/src/OpenSHC/UI/Helpers/TacticalPowersFill.cpp b/src/OpenSHC/UI/Helpers/TacticalPowersFill.cpp new file mode 100644 index 000000000..2b24df701 --- /dev/null +++ b/src/OpenSHC/UI/Helpers/TacticalPowersFill.cpp @@ -0,0 +1,23 @@ +#include "OpenSHC/UI/Helpers.func.hpp" + +#include "OpenSHC/Globals/DAT_MissionDefinedData.hpp" +#include "OpenSHC/Globals/DAT_TacticalPowersHelpTextDisplayBool.hpp" + +namespace OpenSHC { +namespace UI { + namespace Helpers { + + // FUNCTION: STRONGHOLDCRUSADER 0x004D9D90 + void TacticalPowersFill() + { + if (DAT_TacticalPowersHelpTextDisplayBool::instance != 0) { + DAT_MissionDefinedData::instance.field39_0x1370 -= 1; + if (DAT_MissionDefinedData::instance.field39_0x1370 == 0) { + DAT_TacticalPowersHelpTextDisplayBool::instance = 0; + } + } + } + + } +} +} diff --git a/src/OpenSHC/UI/HoveredState/clearHoveredState.cpp b/src/OpenSHC/UI/HoveredState/clearHoveredState.cpp new file mode 100644 index 000000000..8db116996 --- /dev/null +++ b/src/OpenSHC/UI/HoveredState/clearHoveredState.cpp @@ -0,0 +1,20 @@ +#include "OpenSHC/UI/HoveredState.func.hpp" +#include "OpenSHC/Commands/MappersEnum.hpp" +#include "OpenSHC/Commands/MappersEnumInt.hpp" + +namespace OpenSHC { +namespace UI { + + using OpenSHC::Commands::MappersEnum; + using OpenSHC::Commands::MappersEnumInt; + + // FUNCTION: STRONGHOLDCRUSADER 0x005010C0 + void HoveredState::clearHoveredState() + { + for (int i = 0; i < 20; ++i) { + this->elements[i].type = OpenSHC::Commands::M_MAPPER_NULL; + } + } + +} +} diff --git a/src/OpenSHC/UI/HoveredState/clearInvalidatedHoverStates.cpp b/src/OpenSHC/UI/HoveredState/clearInvalidatedHoverStates.cpp new file mode 100644 index 000000000..89aeeee45 --- /dev/null +++ b/src/OpenSHC/UI/HoveredState/clearInvalidatedHoverStates.cpp @@ -0,0 +1,31 @@ +#include "OpenSHC/UI/HoveredState.func.hpp" +#include "OpenSHC/Commands/MappersEnum.hpp" +#include "OpenSHC/Game/GameMode.hpp" +#include "OpenSHC/UI/HoveredStateElement.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace UI { + + using OpenSHC::Commands::MappersEnum; + using OpenSHC::Game::GameMode; + using OpenSHC::UI::HoveredStateElement; + + // FUNCTION: STRONGHOLDCRUSADER 0x005010E0 + void HoveredState::clearInvalidatedHoverStates() + { + if (DAT_GameSynchronyState::instance.currentGameMode == OpenSHC::Game::GM_SOLITARY) { + return; + } + for (int i = 0; i < 20; ++i) { + if (this->elements[i].type != OpenSHC::Commands::M_MAPPER_NULL + && (int)DAT_GameCore::instance.mapTimeInTicks >= this->elements[i].time) { + this->elements[i].type = OpenSHC::Commands::M_MAPPER_NULL; + } + } + } + +} +} diff --git a/src/OpenSHC/UI/Menu/updateMenuButtons.cpp b/src/OpenSHC/UI/Menu/updateMenuButtons.cpp new file mode 100644 index 000000000..c34b068a7 --- /dev/null +++ b/src/OpenSHC/UI/Menu/updateMenuButtons.cpp @@ -0,0 +1,28 @@ +#include "OpenSHC/UI/Menu.func.hpp" +#include "OpenSHC/UI/Enums/MenuItemHandleState.hpp" +#include "OpenSHC/UI/MenuItem.hpp" + +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" + +namespace OpenSHC { +namespace UI { + + using OpenSHC::UI::MenuItem; + using OpenSHC::UI::Enums::MenuItemHandleState; + + // FUNCTION: STRONGHOLDCRUSADER 0x004F6470 + void Menu::updateMenuButtons() + { + if (this->hoveredItem == NULL) { + this->someMenuItemPtr_0x3c = NULL; + } + this->hoveredItem = NULL; + this->field16_0x40 = 0; + DAT_MenuHandlerState::instance.field18_0x3c = 0; + MACRO_CALL_MEMBER(OpenSHC::UI::Menu_Func::handleMenuItems, this)( + OpenSHC::UI::Enums::MIHS_HANDLE_INPUT_CALLBACKSUnk); + this->one = 0; + } + +} +} diff --git a/src/OpenSHC/UI/MenuHandlerState/setupBuildMenuState.cpp b/src/OpenSHC/UI/MenuHandlerState/setupBuildMenuState.cpp new file mode 100644 index 000000000..86886bcbd --- /dev/null +++ b/src/OpenSHC/UI/MenuHandlerState/setupBuildMenuState.cpp @@ -0,0 +1,20 @@ +#include "OpenSHC/UI/MenuHandlerState.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace UI { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004F4C60 + void MenuHandlerState::setupBuildMenuState(dword const017, dword const516) + { + this->isBuildMenuTransitioning_0x18 = FALSE; + this->buildMenuBackgroundLeftShift_0x24 = 0; + this->buildMenuTransitionDirection_0x2c = -1; + this->const017 = const017; + this->const516 = const516; + } + +} +} diff --git a/src/OpenSHC/UI/MenuItem/resetMenuItemStateUnk.cpp b/src/OpenSHC/UI/MenuItem/resetMenuItemStateUnk.cpp new file mode 100644 index 000000000..a6c8b25c6 --- /dev/null +++ b/src/OpenSHC/UI/MenuItem/resetMenuItemStateUnk.cpp @@ -0,0 +1,26 @@ +#include "OpenSHC/UI/MenuItem.func.hpp" +#include "OpenSHC/UI/Enums/MenuItemType.hpp" +#include "OpenSHC/UI/Enums/MenuItemTypeInt.hpp" + +namespace OpenSHC { +namespace UI { + + using OpenSHC::UI::Enums::MenuItemType; + using OpenSHC::UI::Enums::MenuItemTypeInt; + + // FUNCTION: STRONGHOLDCRUSADER 0x004F4C30 + void MenuItem::resetMenuItemStateUnk() + { + this->hovering = 0; + this->clicked = 0; + this->secondItemTypeData.buttonState.someTimestamp_1_0x0 = 0; + this->secondItemTypeData.buttonState.clickTimestamp_0x4 = 0; + this->secondItemTypeData.buttonState.countTo100 = 0; + MenuItemTypeInt const itemType = this->menuItemType & Enums::MIT_MENU_ITEM_TYPE_ID_PARTUnk; + if (itemType == OpenSHC::UI::Enums::MIT_SLIDERUnk || itemType == OpenSHC::UI::Enums::MIT_SCROLLBARUnk) { + this->secondItemTypeData.buttonState.currentButtonPictureInGm_0xc = -1000; + } + } + +} +} diff --git a/src/OpenSHC/UI/MenuItems/BuildMenu/MenuItemActionHandler_BuildMenu_SomeKeepAndGranaryCheckUnk.cpp b/src/OpenSHC/UI/MenuItems/BuildMenu/MenuItemActionHandler_BuildMenu_SomeKeepAndGranaryCheckUnk.cpp new file mode 100644 index 000000000..97a6c0486 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/BuildMenu/MenuItemActionHandler_BuildMenu_SomeKeepAndGranaryCheckUnk.cpp @@ -0,0 +1,38 @@ +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/Game/GameStateStructures.func.hpp" +#include "OpenSHC/UI/MenuItems/BuildMenu.func.hpp" +#include "OpenSHC/UI/Enums/BuildMenuTabType.hpp" +#include "OpenSHC/UI/Enums/BuildingsAndStatusMenuTabType.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace BuildMenu { + + using OpenSHC::UI::Enums::BuildingsAndStatusMenuTabType; + using OpenSHC::UI::Enums::BuildMenuTabType; + using OpenSHC::UI::Enums::MenuViewType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00433200 + void MenuItemActionHandler_BuildMenu_SomeKeepAndGranaryCheckUnk(int param_1, ...) + { + if (DAT_GameCore::instance.activeMenuTab.buildMenuTab != (BuildMenuTabType)0x31) { + return; + } + if (MACRO_CALL_MEMBER(OpenSHC::Game::GameStateStructures_Func::singlePlayerHasKeepAndGranaryCheck, + DAT_GameState::ptr)() + > 0) { + DAT_GameCore::instance.buildmenuMenuTabToSwitchTo.tabType = OpenSHC::UI::Enums::BASMTT_HUNTERSHUT; + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_BUILD_MENU, 0); + } + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/BuildMenu/MenuItemRenderFunction_BuildMenu_BuildingIcons.cpp b/src/OpenSHC/UI/MenuItems/BuildMenu/MenuItemRenderFunction_BuildMenu_BuildingIcons.cpp new file mode 100644 index 000000000..8c14214dc --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/BuildMenu/MenuItemRenderFunction_BuildMenu_BuildingIcons.cpp @@ -0,0 +1,35 @@ +#include "OpenSHC/Map/MapPropertiesState.func.hpp" +#include "OpenSHC/UI/MenuItems/BuildMenu.func.hpp" +#include "OpenSHC/UI/MenuItems/General.func.hpp" +#include "OpenSHC/Commands/MappersEnum.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_ButtonUnknownZero.hpp" +#include "OpenSHC/Globals/DAT_MapPropertiesState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace BuildMenu { + + using OpenSHC::Commands::MappersEnum; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004668F0 + void MenuItemRenderFunction_BuildMenu_BuildingIcons(int mapper, ...) + { + if (MACRO_CALL_MEMBER(OpenSHC::Map::MapPropertiesState_Func::isMapperAvailable, + DAT_MapPropertiesState::ptr)((MappersEnum)mapper) + != FALSE) { + MACRO_CALL(OpenSHC::UI::MenuItems::General_Func:: + MenuItemRenderFunction_General_RenderCurrentButtonWithPossibleAlphaTexOnScreenMenuSurface)(); + DAT_ButtonUnknownZero::instance = 0; + return; + } + DAT_ButtonUnknownZero::instance = 1; + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/BuildMenu/MenuItemRenderFunction_BuildMenu_BuildingKeepSubcategoryButton.cpp b/src/OpenSHC/UI/MenuItems/BuildMenu/MenuItemRenderFunction_BuildMenu_BuildingKeepSubcategoryButton.cpp new file mode 100644 index 000000000..1b10a345b --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/BuildMenu/MenuItemRenderFunction_BuildMenu_BuildingKeepSubcategoryButton.cpp @@ -0,0 +1,31 @@ +#include "OpenSHC/UI/MenuItems/BuildMenu.func.hpp" +#include "OpenSHC/UI/MenuItems/General.func.hpp" +#include "OpenSHC/Game/GameMode2.hpp" + +#include "OpenSHC/Globals/DAT_ButtonUnknownZero.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace BuildMenu { + + using OpenSHC::Game::GameMode2; + + // FUNCTION: STRONGHOLDCRUSADER 0x00434230 + void MenuItemRenderFunction_BuildMenu_BuildingKeepSubcategoryButton(int param_1, ...) + { + if (DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_EDITOR + && DAT_GameCore::instance.gameMode_2 != OpenSHC::Game::GM_SIEGE_THAT) { + DAT_ButtonUnknownZero::instance = 1; + return; + } + DAT_ButtonUnknownZero::instance = 0; + MACRO_CALL(OpenSHC::UI::MenuItems::General_Func:: + MenuItemRenderFunction_General_RenderCurrentButtonWithPossibleAlphaTexOnScreenMenuSurface)(); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/BuildMenu/MenuItemRenderFunction_BuildMenu_BuildingSubcategoryButton.cpp b/src/OpenSHC/UI/MenuItems/BuildMenu/MenuItemRenderFunction_BuildMenu_BuildingSubcategoryButton.cpp new file mode 100644 index 000000000..77415d7af --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/BuildMenu/MenuItemRenderFunction_BuildMenu_BuildingSubcategoryButton.cpp @@ -0,0 +1,30 @@ +#include "OpenSHC/Map/MapPropertiesState.func.hpp" +#include "OpenSHC/UI/MenuItems/BuildMenu.func.hpp" +#include "OpenSHC/UI/MenuItems/General.func.hpp" + +#include "OpenSHC/Globals/DAT_ButtonUnknownZero.hpp" +#include "OpenSHC/Globals/DAT_MapPropertiesState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace BuildMenu { + + // FUNCTION: STRONGHOLDCRUSADER 0x00466920 + void MenuItemRenderFunction_BuildMenu_BuildingSubcategoryButton(int buildingType, ...) + { + if (MACRO_CALL_MEMBER(OpenSHC::Map::MapPropertiesState_Func::isMercRecruitableForBuildingType, + DAT_MapPropertiesState::ptr)(buildingType) + != 0) { + MACRO_CALL(OpenSHC::UI::MenuItems::General_Func:: + MenuItemRenderFunction_General_RenderCurrentButtonWithPossibleAlphaTexOnScreenMenuSurface)(); + DAT_ButtonUnknownZero::instance = 0; + return; + } + DAT_ButtonUnknownZero::instance = 1; + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/BuildMenu/MenuItemRenderFunction_BuildMenu_CurrentlySelectedTroopsDeselectHelper.cpp b/src/OpenSHC/UI/MenuItems/BuildMenu/MenuItemRenderFunction_BuildMenu_CurrentlySelectedTroopsDeselectHelper.cpp new file mode 100644 index 000000000..3aed4bca2 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/BuildMenu/MenuItemRenderFunction_BuildMenu_CurrentlySelectedTroopsDeselectHelper.cpp @@ -0,0 +1,27 @@ +#include "OpenSHC/UI/MenuItems/BuildMenu.func.hpp" + +#include "OpenSHC/Globals/DAT_ButtonUnknownZero.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace BuildMenu { + + // FUNCTION: STRONGHOLDCRUSADER 0x00439390 + void MenuItemRenderFunction_BuildMenu_CurrentlySelectedTroopsDeselectHelper(int selectionIndex, ...) + { + if (DAT_UnitsState::instance.nHasOwnedUnitInSelection == 0) { + DAT_ButtonUnknownZero::instance = 1; + return; + } + DAT_ButtonUnknownZero::instance = 0; + if ((&DAT_UnitsState::instance.selectionEngineers)[selectionIndex] == -1) { + DAT_ButtonUnknownZero::instance = 1; + } + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_ArmySwitchButton.cpp b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_ArmySwitchButton.cpp new file mode 100644 index 000000000..5ae41783a --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_ArmySwitchButton.cpp @@ -0,0 +1,22 @@ +#include "OpenSHC/UI/MenuItems/BuildingAndStatusMenu.func.hpp" + +#include "OpenSHC/Globals/DAT_00b95b68.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace BuildingAndStatusMenu { + + // FUNCTION: STRONGHOLDCRUSADER 0x0043FC80 + void MenuItemActionHandler_BuildingAndStatusMenu_ArmySwitchButton() + { + DAT_00b95b68::instance += 1; + if ((int)DAT_00b95b68::instance > 2) { + DAT_00b95b68::instance = 0; + } + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_BuildingHelpTextButton.cpp b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_BuildingHelpTextButton.cpp new file mode 100644 index 000000000..82874bddb --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_BuildingHelpTextButton.cpp @@ -0,0 +1,24 @@ +#include "OpenSHC/Text/TextEditorState.func.hpp" +#include "OpenSHC/UI/MenuItems/BuildingAndStatusMenu.func.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_TextEditorState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace BuildingAndStatusMenu { + + // FUNCTION: STRONGHOLDCRUSADER 0x0043A860 + void MenuItemActionHandler_BuildingAndStatusMenu_BuildingHelpTextButton() + { + if (DAT_BuildingsState::instance.field24_0x18e04c != 0) { + MACRO_CALL_MEMBER(OpenSHC::Text::TextEditorState_Func::openBuildingHelpDialog, + DAT_TextEditorState::ptr)(DAT_BuildingsState::instance.field25_0x18e050); + } + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_BuildingSleep.cpp b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_BuildingSleep.cpp new file mode 100644 index 000000000..56e18d480 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_BuildingSleep.cpp @@ -0,0 +1,36 @@ +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuItems/BuildingAndStatusMenu.func.hpp" +#include "OpenSHC/Commands/GameCommandType.hpp" +#include "OpenSHC/Game/GameMode2.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace BuildingAndStatusMenu { + + using OpenSHC::Commands::GameCommandType; + using OpenSHC::Game::GameMode2; + + // FUNCTION: STRONGHOLDCRUSADER 0x004660B0 + void MenuItemActionHandler_BuildingAndStatusMenu_BuildingSleep() + { + if (DAT_GameCore::instance.gameMode_2 == OpenSHC::Game::GM_CRUSADER_TUTORIAL) { + MACRO_CALL(OpenSHC::UI::Helpers_Func::SetTutorialHintActiveWithTimestamp)(); + return; + } + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 + = DAT_BuildingsState::instance.buildings[DAT_BuildingsState::instance.menuSelectedBuildingID] + .buildingType; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, + DAT_GameSynchronyState::ptr)(OpenSHC::Commands::GCT_BUILDING_SLEEP); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_MarketMenuChangeButtons.cpp b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_MarketMenuChangeButtons.cpp new file mode 100644 index 000000000..c65130883 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_MarketMenuChangeButtons.cpp @@ -0,0 +1,26 @@ +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/UI/MenuItems/BuildingAndStatusMenu.func.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace BuildingAndStatusMenu { + + using OpenSHC::UI::Enums::MenuViewType; + + // FUNCTION: STRONGHOLDCRUSADER 0x00465920 + void MenuItemActionHandler_BuildingAndStatusMenu_MarketMenuChangeButtons(int tabType, ...) + { + DAT_GameCore::instance.buildingandstatusmenuMenuTabToSwitchTo = tabType; + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_BUILDING_AND_STATUS_MENU, 0); + DAT_GameCore::instance.field61_0x100 = tabType; + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_OutpostUnitSelection.cpp b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_OutpostUnitSelection.cpp new file mode 100644 index 000000000..b905a67a0 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_OutpostUnitSelection.cpp @@ -0,0 +1,22 @@ +#include "OpenSHC/UI/MenuItems/BuildingAndStatusMenu.func.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace BuildingAndStatusMenu { + + // FUNCTION: STRONGHOLDCRUSADER 0x00466710 + void MenuItemActionHandler_BuildingAndStatusMenu_OutpostUnitSelection(int bitIndex, ...) + { + // Toggle the bit selected by the menu action in the currently selected + // building's outpost unit-selection mask. + DAT_BuildingsState::instance.buildings[DAT_BuildingsState::instance.menuSelectedBuildingID] + .outpostRelatedUnk1 ^= (ushort)(1 << bitIndex); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_PopularityMenuSwitchButtonUnk.cpp b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_PopularityMenuSwitchButtonUnk.cpp new file mode 100644 index 000000000..6dc41abf1 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_PopularityMenuSwitchButtonUnk.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/UI/MenuItems/BuildingAndStatusMenu.func.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace BuildingAndStatusMenu { + + // FUNCTION: STRONGHOLDCRUSADER 0x0043F2B0 + void MenuItemActionHandler_BuildingAndStatusMenu_PopularityMenuSwitchButtonUnk() + { + DAT_GameCore::instance.field77_0x144 ^= 1; + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_StopBuildingOrPeasantBinkPlayback.cpp b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_StopBuildingOrPeasantBinkPlayback.cpp new file mode 100644 index 000000000..70d4113b8 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_StopBuildingOrPeasantBinkPlayback.cpp @@ -0,0 +1,28 @@ +#include "OpenSHC/Rendering/Bink/BinkControlClass.func.hpp" +#include "OpenSHC/UI/MenuItems/BuildingAndStatusMenu.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_BinkControlState.hpp" +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace BuildingAndStatusMenu { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00439890 + void MenuItemActionHandler_BuildingAndStatusMenu_StopBuildingOrPeasantBinkPlayback() + { + if (DAT_BuildingsState::instance.DAT_IsBuildingOrPeasantBinkPlaying != FALSE) { + DAT_BuildingsState::instance.DAT_IsBuildingOrPeasantBinkPlaying = FALSE; + MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::BinkControlClass_Func::stopBinkPlayback, + DAT_BinkControlState::ptr)(0); + } + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_UnknownMin1Unk.cpp b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_UnknownMin1Unk.cpp new file mode 100644 index 000000000..cdd6666a2 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_UnknownMin1Unk.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/UI/MenuItems/BuildingAndStatusMenu.func.hpp" + +#include "OpenSHC/Globals/INT_00df335c.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace BuildingAndStatusMenu { + + // FUNCTION: STRONGHOLDCRUSADER 0x00464D90 + void MenuItemActionHandler_BuildingAndStatusMenu_UnknownMin1Unk() { INT_00df335c::instance = -1; } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Countdown.cpp b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Countdown.cpp new file mode 100644 index 000000000..eae51b143 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Countdown.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/UI/MenuItems/BuildingAndStatusMenu.func.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace BuildingAndStatusMenu { + + // FUNCTION: STRONGHOLDCRUSADER 0x0043A850 + void MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Countdown() + { + DAT_GameCore::instance.countdown = 1; + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Min1.cpp b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Min1.cpp new file mode 100644 index 000000000..a2f272fc3 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Min1.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/UI/MenuItems/BuildingAndStatusMenu.func.hpp" + +#include "OpenSHC/Globals/DAT_00df3350.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace BuildingAndStatusMenu { + + // FUNCTION: STRONGHOLDCRUSADER 0x004649C0 + void MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Min1() { DAT_00df3350::instance = 0xffffffff; } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_ArmyStatusSwitchButton.cpp b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_ArmyStatusSwitchButton.cpp new file mode 100644 index 000000000..9545bd7a3 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_ArmyStatusSwitchButton.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/UI/MenuItems/BuildingAndStatusMenu.func.hpp" +#include "OpenSHC/UI/MenuItems/General.func.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace BuildingAndStatusMenu { + + // FUNCTION: STRONGHOLDCRUSADER 0x0043FCA0 + void MenuItemRenderFunction_BuildingAndStatusMenu_ArmyStatusSwitchButton() + { + MACRO_CALL(OpenSHC::UI::MenuItems::General_Func:: + MenuItemRenderFunction_General_RenderCurrentButtonWithPossibleAlphaTexOnScreenMenuSurface)(); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_BarracksAndMercenaryPostHelpText.cpp b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_BarracksAndMercenaryPostHelpText.cpp new file mode 100644 index 000000000..5e1f9e4a9 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_BarracksAndMercenaryPostHelpText.cpp @@ -0,0 +1,23 @@ +#include "OpenSHC/UI/MenuItems/BuildingAndStatusMenu.func.hpp" +#include "OpenSHC/UI/MenuItems/General.func.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace BuildingAndStatusMenu { + + // FUNCTION: STRONGHOLDCRUSADER 0x0043A8C0 + void MenuItemRenderFunction_BuildingAndStatusMenu_BarracksAndMercenaryPostHelpText(int param_1, ...) + { + if (DAT_BuildingsState::instance.field24_0x18e04c != 0) { + MACRO_CALL(OpenSHC::UI::MenuItems::General_Func:: + MenuItemRenderFunction_General_RenderCurrentButtonWithPossibleAlphaTexOnScreenMenuSurface)(); + } + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_BuildingHelpTextButton.cpp b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_BuildingHelpTextButton.cpp new file mode 100644 index 000000000..af35ef44d --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_BuildingHelpTextButton.cpp @@ -0,0 +1,34 @@ +#include "OpenSHC/UI/MenuItems/BuildingAndStatusMenu.func.hpp" +#include "OpenSHC/UI/MenuItems/General.func.hpp" +#include "OpenSHC/UI/Enums/BuildingsAndStatusMenuTabType.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_ButtonUnknownZero.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace BuildingAndStatusMenu { + + using OpenSHC::UI::Enums::BuildingsAndStatusMenuTabType; + + // FUNCTION: STRONGHOLDCRUSADER 0x0043A880 + void MenuItemRenderFunction_BuildingAndStatusMenu_BuildingHelpTextButton(int param_1, ...) + { + DAT_ButtonUnknownZero::instance = 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) { + DAT_ButtonUnknownZero::instance = 1; + return; + } + if (DAT_BuildingsState::instance.field24_0x18e04c != 0) { + MACRO_CALL(OpenSHC::UI::MenuItems::General_Func:: + MenuItemRenderFunction_General_RenderCurrentButtonWithPossibleAlphaTexOnScreenMenuSurface)(); + } + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_PopularityMenuSwitchButton.cpp b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_PopularityMenuSwitchButton.cpp new file mode 100644 index 000000000..b02cd7928 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_PopularityMenuSwitchButton.cpp @@ -0,0 +1,28 @@ +#include "OpenSHC/UI/MenuItems/BuildingAndStatusMenu.func.hpp" +#include "OpenSHC/UI/MenuItems/General.func.hpp" + +#include "OpenSHC/Globals/DAT_CurrentButtonGmDataIndex.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace BuildingAndStatusMenu { + + // FUNCTION: STRONGHOLDCRUSADER 0x0043F2C0 + void MenuItemRenderFunction_BuildingAndStatusMenu_PopularityMenuSwitchButton(int param_1, ...) + { + if (DAT_GameCore::instance.field78_0x148 == 1) { + return; + } + if (DAT_GameCore::instance.field77_0x144 == 1) { + DAT_CurrentButtonGmDataIndex::instance = 0x73; + } + MACRO_CALL(OpenSHC::UI::MenuItems::General_Func:: + MenuItemRenderFunction_General_RenderCurrentButtonWithPossibleAlphaTexOnScreenMenuSurface)(); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/Chat/MenuItemActionHandler_Chat_SendMessageToPlayer.cpp b/src/OpenSHC/UI/MenuItems/Chat/MenuItemActionHandler_Chat_SendMessageToPlayer.cpp new file mode 100644 index 000000000..b16e58b13 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/Chat/MenuItemActionHandler_Chat_SendMessageToPlayer.cpp @@ -0,0 +1,24 @@ +#include "OpenSHC/UI/MenuItems/Chat.func.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace Chat { + + // FUNCTION: STRONGHOLDCRUSADER 0x0047FFA0 + void MenuItemActionHandler_Chat_SendMessageToPlayer(int receiver, ...) + { + if (receiver < 0) { + unsigned int const playerID = -receiver; + DAT_GameSynchronyState::instance.DAT_ChatMessageReceiverArray[playerID] ^= 1; + } + DAT_GameSynchronyState::instance + .DAT_ChatMessageReceiverArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] = 1; + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/Chat/MenuItemActionHandler_Chat_TauntButtons.cpp b/src/OpenSHC/UI/MenuItems/Chat/MenuItemActionHandler_Chat_TauntButtons.cpp new file mode 100644 index 000000000..18d9f97a6 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/Chat/MenuItemActionHandler_Chat_TauntButtons.cpp @@ -0,0 +1,25 @@ +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/UI/MenuItems/Chat.func.hpp" +#include "OpenSHC/Commands/GameCommandType.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace Chat { + + using OpenSHC::Commands::GameCommandType; + + // FUNCTION: STRONGHOLDCRUSADER 0x0048F850 + void MenuItemActionHandler_Chat_TauntButtons(int tauntOrMessage, ...) + { + DAT_GameSynchronyState::instance.DAT_ChatTauntOrMessage = tauntOrMessage; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, + DAT_GameSynchronyState::ptr)(OpenSHC::Commands::GCT_TAUNT_OR_CHAT); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/ChooseNetworkServiceProvider/MenuItemActionHandler_ChooseNetworkServiceProvider_ModemTableRows.cpp b/src/OpenSHC/UI/MenuItems/ChooseNetworkServiceProvider/MenuItemActionHandler_ChooseNetworkServiceProvider_ModemTableRows.cpp new file mode 100644 index 000000000..2d4924c45 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/ChooseNetworkServiceProvider/MenuItemActionHandler_ChooseNetworkServiceProvider_ModemTableRows.cpp @@ -0,0 +1,22 @@ +#include "OpenSHC/UI/MenuItems/ChooseNetworkServiceProvider.func.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace ChooseNetworkServiceProvider { + + // FUNCTION: STRONGHOLDCRUSADER 0x0047D0E0 + void MenuItemActionHandler_ChooseNetworkServiceProvider_ModemTableRows(int row, ...) + { + if (DAT_GameSynchronyState::instance.modemScrollBarOffset + row + < DAT_GameSynchronyState::instance.modemScrollbarCount) { + DAT_GameSynchronyState::instance.modemScrollbarIndex = row; + } + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/DeleteGameRecord/MenuItemActionHandler_DeleteGameRecord_Main.cpp b/src/OpenSHC/UI/MenuItems/DeleteGameRecord/MenuItemActionHandler_DeleteGameRecord_Main.cpp new file mode 100644 index 000000000..c64a18448 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/DeleteGameRecord/MenuItemActionHandler_DeleteGameRecord_Main.cpp @@ -0,0 +1,32 @@ +#include "OpenSHC/Game/Skirmish.func.hpp" +#include "OpenSHC/UI/MenuItems/DeleteGameRecord.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_00ed2788.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace DeleteGameRecord { + + using OpenSHC::UI::Enums::MenuModalType; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004D9D60 + void MenuItemActionHandler_DeleteGameRecord_Main(int action, ...) + { + if (action == 22) { + MACRO_CALL(OpenSHC::Game::Skirmish_Func::SkirmishLeaderboard_DeleteEntry)(DAT_00ed2788::instance); + MACRO_CALL(OpenSHC::Game::Skirmish_Func::Skirmish_PrepareLeaderboardView)(); + } + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition1::ptr)(OpenSHC::UI::Enums::MMT_NONE, FALSE); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/DisableArabTroops/MenuItemActionHandler_DisableArabTroops_Main.cpp b/src/OpenSHC/UI/MenuItems/DisableArabTroops/MenuItemActionHandler_DisableArabTroops_Main.cpp new file mode 100644 index 000000000..adbf30f7a --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/DisableArabTroops/MenuItemActionHandler_DisableArabTroops_Main.cpp @@ -0,0 +1,33 @@ +#include "OpenSHC/UI/MenuItems/DisableArabTroops.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_MapPropertiesState.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace DisableArabTroops { + + using OpenSHC::UI::Enums::MenuModalType; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004BB650 + void MenuItemActionHandler_DisableArabTroops_Main(int troopIndex, ...) + { + if ((uint)troopIndex <= 7) { + DAT_MapPropertiesState::instance.SEC_MercRecruitable[troopIndex] ^= 1; + return; + } + if (troopIndex == -3) { + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition1::ptr)(OpenSHC::UI::Enums::MMT_BUILDING_AVAILABILITY, FALSE); + } + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/DisableEuroTroops/MenuItemActionHandler_DisableEuroTroops_Main.cpp b/src/OpenSHC/UI/MenuItems/DisableEuroTroops/MenuItemActionHandler_DisableEuroTroops_Main.cpp new file mode 100644 index 000000000..c1cfe507b --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/DisableEuroTroops/MenuItemActionHandler_DisableEuroTroops_Main.cpp @@ -0,0 +1,35 @@ +#include "OpenSHC/UI/MenuItems/DisableEuroTroops.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_MapPropertiesState.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace DisableEuroTroops { + + using OpenSHC::UI::Enums::MenuModalType; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004BB540 + void MenuItemActionHandler_DisableEuroTroops_Main(int troopIndex, ...) + { + // indexes the seven barracks troop flags that directly precede SEC_MercRecruitable + if ((uint)troopIndex <= 7) { + DAT_MapPropertiesState::instance.barracksRecruitability.array.barracksRecruitability[troopIndex] + ^= 1; + return; + } + if (troopIndex == -3) { + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition1::ptr)(OpenSHC::UI::Enums::MMT_BUILDING_AVAILABILITY, FALSE); + } + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/DisplayScenarioHelpText/MenuItemRenderFunction_DisplayScenarioHelpText_AnotherButtonUnk.cpp b/src/OpenSHC/UI/MenuItems/DisplayScenarioHelpText/MenuItemRenderFunction_DisplayScenarioHelpText_AnotherButtonUnk.cpp new file mode 100644 index 000000000..f009fee38 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/DisplayScenarioHelpText/MenuItemRenderFunction_DisplayScenarioHelpText_AnotherButtonUnk.cpp @@ -0,0 +1,23 @@ +#include "OpenSHC/UI/MenuItems/DisplayScenarioHelpText.func.hpp" +#include "OpenSHC/UI/MenuItems/General.func.hpp" + +#include "OpenSHC/Globals/DAT_TextEditorState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace DisplayScenarioHelpText { + + // FUNCTION: STRONGHOLDCRUSADER 0x0045F120 + void MenuItemRenderFunction_DisplayScenarioHelpText_AnotherButtonUnk(int param_1, ...) + { + if (DAT_TextEditorState::instance.helpSectionHistoryStack[0] != -1) { + MACRO_CALL(OpenSHC::UI::MenuItems::General_Func:: + MenuItemRenderFunction_General_RenderCurrentButtonWithPossibleAlphaTexOnScreenMenuSurface)(); + } + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/EnterTitleOnGameStart/MenuItemActionHandler_EnterTitleOnGameStart_Button.cpp b/src/OpenSHC/UI/MenuItems/EnterTitleOnGameStart/MenuItemActionHandler_EnterTitleOnGameStart_Button.cpp new file mode 100644 index 000000000..cdb7315ca --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/EnterTitleOnGameStart/MenuItemActionHandler_EnterTitleOnGameStart_Button.cpp @@ -0,0 +1,36 @@ +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/Text/UserTextHandler.func.hpp" +#include "OpenSHC/UI/MenuItems/EnterTitleOnGameStart.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" +#include "OpenSHC/Globals/DAT_UserTextHandlerState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace EnterTitleOnGameStart { + + using OpenSHC::UI::Enums::MenuModalType; + using OpenSHC::UI::Enums::MenuViewType; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00491C20 + void MenuItemActionHandler_EnterTitleOnGameStart_Button(int param_1, ...) + { + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition1::ptr)(OpenSHC::UI::Enums::MMT_NONE, FALSE); + MACRO_CALL_MEMBER(OpenSHC::Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)( + 9); + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_MAIN_MENU, 0); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/FindingNetworkSessions/MenuItemActionHandler_FindingNetworkSessions_EnumerateDPlaySessions.cpp b/src/OpenSHC/UI/MenuItems/FindingNetworkSessions/MenuItemActionHandler_FindingNetworkSessions_EnumerateDPlaySessions.cpp new file mode 100644 index 000000000..49913649f --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/FindingNetworkSessions/MenuItemActionHandler_FindingNetworkSessions_EnumerateDPlaySessions.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/UI/MenuItems/FindingNetworkSessions.func.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace FindingNetworkSessions { + + // FUNCTION: STRONGHOLDCRUSADER 0x0048BF70 + void MenuItemActionHandler_FindingNetworkSessions_EnumerateDPlaySessions(int param_1, ...) + { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::restartDPlaySessionEnumeration, + DAT_GameSynchronyState::ptr)(param_1); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/FindingNetworkSessions/MenuItemActionHandler_FindingNetworkSessions_TableRows.cpp b/src/OpenSHC/UI/MenuItems/FindingNetworkSessions/MenuItemActionHandler_FindingNetworkSessions_TableRows.cpp new file mode 100644 index 000000000..3e8ba7984 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/FindingNetworkSessions/MenuItemActionHandler_FindingNetworkSessions_TableRows.cpp @@ -0,0 +1,22 @@ +#include "OpenSHC/UI/MenuItems/FindingNetworkSessions.func.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace FindingNetworkSessions { + + // FUNCTION: STRONGHOLDCRUSADER 0x0047D3F0 + void MenuItemActionHandler_FindingNetworkSessions_TableRows(int row, ...) + { + if (DAT_GameSynchronyState::instance.scrollBarItemOffset + row + < DAT_GameSynchronyState::instance.DPLAY_SessionsCount) { + DAT_GameSynchronyState::instance.scrollBarIndex = row; + } + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/General/MenuItemActionHandler_General_DisplayConditionalText.cpp b/src/OpenSHC/UI/MenuItems/General/MenuItemActionHandler_General_DisplayConditionalText.cpp new file mode 100644 index 000000000..2b683acf2 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/General/MenuItemActionHandler_General_DisplayConditionalText.cpp @@ -0,0 +1,22 @@ +#include "OpenSHC/UI/BottomLeftTextDisplayState.func.hpp" +#include "OpenSHC/UI/MenuItems/General.func.hpp" + +#include "OpenSHC/Globals/DAT_BottomLeftTextDisplayState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace General { + + // FUNCTION: STRONGHOLDCRUSADER 0x004F6A60 + void MenuItemActionHandler_General_DisplayConditionalText(int textID, ...) + { + MACRO_CALL_MEMBER( + OpenSHC::UI::BottomLeftTextDisplayState_Func::renderCurrentlyDisplayedTextConstructionCost, + DAT_BottomLeftTextDisplayState::ptr)(textID); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/General/MenuItemActionHandler_General_RemoveConditionalTextOrReleaseHoverUnk.cpp b/src/OpenSHC/UI/MenuItems/General/MenuItemActionHandler_General_RemoveConditionalTextOrReleaseHoverUnk.cpp new file mode 100644 index 000000000..36ebbc28b --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/General/MenuItemActionHandler_General_RemoveConditionalTextOrReleaseHoverUnk.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/BottomLeftTextDisplayState.func.hpp" +#include "OpenSHC/UI/MenuItems/General.func.hpp" + +#include "OpenSHC/Globals/DAT_BottomLeftTextDisplayState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace General { + + // FUNCTION: STRONGHOLDCRUSADER 0x004F6A70 + void MenuItemActionHandler_General_RemoveConditionalTextOrReleaseHoverUnk(int param_1, ...) + { + MACRO_CALL_MEMBER(OpenSHC::UI::BottomLeftTextDisplayState_Func::hasPassedCountdownOrDuration, + DAT_BottomLeftTextDisplayState::ptr)(); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/General/MenuItemActionHandler_General_Unknown2.cpp b/src/OpenSHC/UI/MenuItems/General/MenuItemActionHandler_General_Unknown2.cpp new file mode 100644 index 000000000..e559815e6 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/General/MenuItemActionHandler_General_Unknown2.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/UI/MenuItems/General.func.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace General { + + // FUNCTION: STRONGHOLDCRUSADER 0x00434260 + void MenuItemActionHandler_General_Unknown2(int param_1, ...) + { + DAT_GameCore::instance.field12_0x30 = param_1; + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/General/MenuItemFunction_General_Unknown.cpp b/src/OpenSHC/UI/MenuItems/General/MenuItemFunction_General_Unknown.cpp new file mode 100644 index 000000000..bcb525a3f --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/General/MenuItemFunction_General_Unknown.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/UI/MenuItems/General.func.hpp" + +#include "OpenSHC/Globals/DAT_StopHandlingMenuItems.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace General { + + // FUNCTION: STRONGHOLDCRUSADER 0x00440410 + void MenuItemFunction_General_Unknown(int param_1, ...) { DAT_StopHandlingMenuItems::instance = 0; } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/InGameMenu/MenuItemActionHandler_InGameMenu_UnknownBinkRelated.cpp b/src/OpenSHC/UI/MenuItems/InGameMenu/MenuItemActionHandler_InGameMenu_UnknownBinkRelated.cpp new file mode 100644 index 000000000..77d98d399 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/InGameMenu/MenuItemActionHandler_InGameMenu_UnknownBinkRelated.cpp @@ -0,0 +1,26 @@ +#include "OpenSHC/UI/MenuItems/InGameMenu.func.hpp" + +#include "OpenSHC/Globals/DAT_BinkControlState.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace InGameMenu { + + // FUNCTION: STRONGHOLDCRUSADER 0x00433230 + void MenuItemActionHandler_InGameMenu_UnknownBinkRelated(int param_1, ...) + { + if (DAT_GameCore::instance.isBinkVideoPlaying == 0) { + return; + } + if (DAT_BinkControlState::instance.binkObjPtrArray[1] == NULL) { + DAT_GameCore::instance.isBinkVideoPlaying = 0; + } + DAT_GameCore::instance.countdown = 1; + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/InGameMenu/MenuItemRenderFunction_InGameMenu_MapEventIconUnk.cpp b/src/OpenSHC/UI/MenuItems/InGameMenu/MenuItemRenderFunction_InGameMenu_MapEventIconUnk.cpp new file mode 100644 index 000000000..da87850ce --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/InGameMenu/MenuItemRenderFunction_InGameMenu_MapEventIconUnk.cpp @@ -0,0 +1,28 @@ +#include "OpenSHC/UI/MenuItems/General.func.hpp" +#include "OpenSHC/UI/MenuItems/InGameMenu.func.hpp" + +#include "OpenSHC/Globals/DAT_ButtonUnknownZero.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_MinimapViewState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace InGameMenu { + + // FUNCTION: STRONGHOLDCRUSADER 0x004B6500 + void MenuItemRenderFunction_InGameMenu_MapEventIconUnk(int param_1, ...) + { + DAT_ButtonUnknownZero::instance = 1; + if (DAT_MinimapViewState::instance.spawnMomentCount != 0 + && DAT_GameCore::instance.isBinkVideoPlaying == 0) { + DAT_ButtonUnknownZero::instance = 0; + MACRO_CALL(OpenSHC::UI::MenuItems::General_Func:: + MenuItemRenderFunction_General_RenderCurrentButtonWithPossibleAlphaTexOnScreenMenuSurface)(); + } + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/LobbyMenu/MenuItemRenderFunction_LobbyMenu_Unknown.cpp b/src/OpenSHC/UI/MenuItems/LobbyMenu/MenuItemRenderFunction_LobbyMenu_Unknown.cpp new file mode 100644 index 000000000..ce97bf043 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/LobbyMenu/MenuItemRenderFunction_LobbyMenu_Unknown.cpp @@ -0,0 +1,28 @@ +#include "OpenSHC/UI/BottomLeftTextDisplayState.func.hpp" +#include "OpenSHC/UI/MenuItems/LobbyMenu.func.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" + +#include "OpenSHC/Globals/DAT_BottomLeftTextDisplayState.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace LobbyMenu { + + using OpenSHC::UI::Enums::MenuModalType; + + // FUNCTION: STRONGHOLDCRUSADER 0x0042AC40 + void MenuItemRenderFunction_LobbyMenu_Unknown(int textID, ...) + { + if (DAT_MenuModalComposition1::instance.activeModalDialogID == OpenSHC::UI::Enums::MMT_NONE) { + MACRO_CALL_MEMBER( + OpenSHC::UI::BottomLeftTextDisplayState_Func::renderCurrentlyDisplayedTextConstructionCost, + DAT_BottomLeftTextDisplayState::ptr)(textID); + } + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/NetworkOptions/MenuItemActionHandler_NetworkOptions_LeaveButtonUnk.cpp b/src/OpenSHC/UI/MenuItems/NetworkOptions/MenuItemActionHandler_NetworkOptions_LeaveButtonUnk.cpp new file mode 100644 index 000000000..36dbdca47 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/NetworkOptions/MenuItemActionHandler_NetworkOptions_LeaveButtonUnk.cpp @@ -0,0 +1,23 @@ +#include "OpenSHC/UI/MenuItems/NetworkOptions.func.hpp" +#include "OpenSHC/UI/MenuTextInputState.func.hpp" + +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace NetworkOptions { + + // FUNCTION: STRONGHOLDCRUSADER 0x004941F0 + void MenuItemActionHandler_NetworkOptions_LeaveButtonUnk(int action, ...) + { + if (action == 17) { + MACRO_CALL_MEMBER( + OpenSHC::UI::MenuTextInputState_Func::popModalDialog, DAT_MenuTextInputState::ptr)(); + } + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/SaveLoadMap/MenuItemRenderFunction_SaveLoadMap_Scrollbar.cpp b/src/OpenSHC/UI/MenuItems/SaveLoadMap/MenuItemRenderFunction_SaveLoadMap_Scrollbar.cpp new file mode 100644 index 000000000..1c17ece1d --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/SaveLoadMap/MenuItemRenderFunction_SaveLoadMap_Scrollbar.cpp @@ -0,0 +1,29 @@ +#include "OpenSHC/UI/MenuItems/SaveLoadMap.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_ButtonH.hpp" +#include "OpenSHC/Globals/DAT_ButtonX.hpp" +#include "OpenSHC/Globals/DAT_ButtonY.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace SaveLoadMap { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00492C60 + void MenuItemRenderFunction_SaveLoadMap_Scrollbar( + int param_1, int thumbYPos, int param_3, int thumbHeight, BOOLEnum isDragged) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawScrollbar, + DAT_PencilRenderCore::ptr)(DAT_ButtonX::instance, DAT_ButtonY::instance, DAT_ButtonH::instance, + thumbYPos, isDragged, thumbHeight, 0); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/SaveMap/MenuItemActionHandler_SaveMap_ReturnKeySave.cpp b/src/OpenSHC/UI/MenuItems/SaveMap/MenuItemActionHandler_SaveMap_ReturnKeySave.cpp new file mode 100644 index 000000000..827340418 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/SaveMap/MenuItemActionHandler_SaveMap_ReturnKeySave.cpp @@ -0,0 +1,24 @@ +#include "OpenSHC/UI/MenuItems/SaveLoadMap.func.hpp" +#include "OpenSHC/UI/MenuItems/SaveMap.func.hpp" + +#include "OpenSHC/Globals/DAT_UserTextHandlerState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace SaveMap { + + // FUNCTION: STRONGHOLDCRUSADER 0x00494920 + void MenuItemActionHandler_SaveMap_ReturnKeySave(int param_1, ...) + { + int const returnPressed = DAT_UserTextHandlerState::instance.returnPressed; + DAT_UserTextHandlerState::instance.returnPressed = 0; + if (returnPressed != 0) { + MACRO_CALL(OpenSHC::UI::MenuItems::SaveLoadMap_Func::MenuItemActionHandler_SaveLoadMap_Buttons)(3); + } + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/SelectCrusade/MenuItemRenderFunction_SelectCrusade_Main.cpp b/src/OpenSHC/UI/MenuItems/SelectCrusade/MenuItemRenderFunction_SelectCrusade_Main.cpp new file mode 100644 index 000000000..3db30df2b --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/SelectCrusade/MenuItemRenderFunction_SelectCrusade_Main.cpp @@ -0,0 +1,31 @@ +#include "OpenSHC/UI/MenuItems/General.func.hpp" +#include "OpenSHC/UI/MenuItems/SelectCrusade.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_ButtonCurrentlyInteracting.hpp" +#include "OpenSHC/Globals/DAT_HighlightedSkirmishType.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace SelectCrusade { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x0042C060 + void MenuItemRenderFunction_SelectCrusade_Main(int skirmishType, ...) + { + if (skirmishType == -1) { + DAT_HighlightedSkirmishType::instance = 0; + } + if (DAT_ButtonCurrentlyInteracting::instance != FALSE) { + DAT_HighlightedSkirmishType::instance = skirmishType; + } + MACRO_CALL(OpenSHC::UI::MenuItems::General_Func:: + MenuItemRenderFunction_General_RenderCurrentButtonWithPossibleAlphaTexOnScreenMenuSurface)(); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/Unused/MenuItemActionHandler_UnusedOldTitleMenu_General.cpp b/src/OpenSHC/UI/MenuItems/Unused/MenuItemActionHandler_UnusedOldTitleMenu_General.cpp new file mode 100644 index 000000000..58839a64e --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/Unused/MenuItemActionHandler_UnusedOldTitleMenu_General.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/UI/MenuItems/Unused.func.hpp" + +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace Unused { + + // FUNCTION: STRONGHOLDCRUSADER 0x00440420 + void MenuItemActionHandler_UnusedOldTitleMenu_General(int param_1, ...) + { + DAT_WindowAndDirectDraw::instance.postWindowCloseMessage = 1; + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuItems/Unused/MenuItemActionHandler_UnusedWinCondition_Options.cpp b/src/OpenSHC/UI/MenuItems/Unused/MenuItemActionHandler_UnusedWinCondition_Options.cpp new file mode 100644 index 000000000..b5431f1b5 --- /dev/null +++ b/src/OpenSHC/UI/MenuItems/Unused/MenuItemActionHandler_UnusedWinCondition_Options.cpp @@ -0,0 +1,34 @@ +#include "OpenSHC/UI/MenuItems/Unused.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuItems { + namespace Unused { + + using OpenSHC::UI::Enums::MenuModalType; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004B1090 + void MenuItemActionHandler_UnusedWinCondition_Options(int value, ...) + { + if (value >= (int)DAT_MenuModalComposition1::instance.mbr_0x64) { + return; + } + DAT_MenuModalComposition1::instance.sliderValue = value; + *DAT_MenuModalComposition1::instance.destination = value; + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition1::ptr)(OpenSHC::UI::Enums::MMT_NONE, FALSE); + if (DAT_MenuModalComposition1::instance.sliderCallbackFunction != NULL) { + ((void (*)())DAT_MenuModalComposition1::instance.sliderCallbackFunction)(); + } + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModalComposition/findModalMenu.cpp b/src/OpenSHC/UI/MenuModalComposition/findModalMenu.cpp new file mode 100644 index 000000000..29d720d1a --- /dev/null +++ b/src/OpenSHC/UI/MenuModalComposition/findModalMenu.cpp @@ -0,0 +1,26 @@ +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/UI/MenuModal.hpp" + +#include "OpenSHC/Globals/DAT_ModalMenuArrayPointerToStackTop.hpp" + +namespace OpenSHC { +namespace UI { + + using OpenSHC::UI::MenuModal; + using OpenSHC::UI::Enums::MenuModalType; + + // FUNCTION: STRONGHOLDCRUSADER 0x004A9EB0 + MenuModal* MenuModalComposition::findModalMenu(MenuModalType menuModalID) + { + for (MenuModal* modal = DAT_ModalMenuArrayPointerToStackTop::instance; modal != NULL; + modal = modal->pointerToNextModalMenu) { + if (modal->menuModalID == menuModalID) { + return modal; + } + } + return NULL; + } + +} +} diff --git a/src/OpenSHC/UI/MenuModalComposition/loadAllMenuElementsOfMenuModals.cpp b/src/OpenSHC/UI/MenuModalComposition/loadAllMenuElementsOfMenuModals.cpp new file mode 100644 index 000000000..3bbace5fd --- /dev/null +++ b/src/OpenSHC/UI/MenuModalComposition/loadAllMenuElementsOfMenuModals.cpp @@ -0,0 +1,26 @@ +#include "OpenSHC/UI/Menu.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/Menu.hpp" +#include "OpenSHC/UI/MenuModal.hpp" + +#include "OpenSHC/Globals/DAT_ModalMenuArrayPointerToStackTop.hpp" + +namespace OpenSHC { +namespace UI { + + using OpenSHC::UI::Menu; + using OpenSHC::UI::MenuModal; + + // FUNCTION: STRONGHOLDCRUSADER 0x004A9E80 + void MenuModalComposition::loadAllMenuElementsOfMenuModals() + { + for (MenuModal* modal = DAT_ModalMenuArrayPointerToStackTop::instance; modal != NULL; + modal = modal->pointerToNextModalMenu) { + if (modal->pointerToMenu != NULL) { + MACRO_CALL_MEMBER(OpenSHC::UI::Menu_Func::loadMenuElements, modal->pointerToMenu)(0); + } + } + } + +} +} diff --git a/src/OpenSHC/UI/MenuModals/CreateOrTriggerInvasion/MenuModalRenderFunction_CreateOrTriggerInvasion.cpp b/src/OpenSHC/UI/MenuModals/CreateOrTriggerInvasion/MenuModalRenderFunction_CreateOrTriggerInvasion.cpp new file mode 100644 index 000000000..615e9f6e7 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/CreateOrTriggerInvasion/MenuModalRenderFunction_CreateOrTriggerInvasion.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/MenuModals/CreateOrTriggerInvasion.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace CreateOrTriggerInvasion { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AB540 + void MenuModalRenderFunction_CreateOrTriggerInvasion(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(199, 0x2e, x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/DebugDataAiInfo/MenuModalRenderFunction_DebugDataAiInfo.cpp b/src/OpenSHC/UI/MenuModals/DebugDataAiInfo/MenuModalRenderFunction_DebugDataAiInfo.cpp new file mode 100644 index 000000000..77286eb06 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/DebugDataAiInfo/MenuModalRenderFunction_DebugDataAiInfo.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/AI/AICState.func.hpp" +#include "OpenSHC/UI/MenuModals/DebugDataAiInfo.func.hpp" + +#include "OpenSHC/Globals/DAT_AICState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace DebugDataAiInfo { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AAA60 + void MenuModalRenderFunction_DebugDataAiInfo(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::AI::AICState_Func::renderDebugDataAiInfo, DAT_AICState::ptr)( + x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/DebugDataCurrentPlayerData/MenuModalRenderFunction_DebugDataCurrentPlayerData.cpp b/src/OpenSHC/UI/MenuModals/DebugDataCurrentPlayerData/MenuModalRenderFunction_DebugDataCurrentPlayerData.cpp new file mode 100644 index 000000000..52ee043e1 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/DebugDataCurrentPlayerData/MenuModalRenderFunction_DebugDataCurrentPlayerData.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Game/GameStateStructures.func.hpp" +#include "OpenSHC/UI/MenuModals/DebugDataCurrentPlayerData.func.hpp" + +#include "OpenSHC/Globals/DAT_GameState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace DebugDataCurrentPlayerData { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AAA40 + void MenuModalRenderFunction_DebugDataCurrentPlayerData(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::Game::GameStateStructures_Func::renderDebugDataCurrentPlayerData, + DAT_GameState::ptr)(x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/DebugDataMapData/MenuModalRenderFunction_DebugDataMapData.cpp b/src/OpenSHC/UI/MenuModals/DebugDataMapData/MenuModalRenderFunction_DebugDataMapData.cpp new file mode 100644 index 000000000..77a303092 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/DebugDataMapData/MenuModalRenderFunction_DebugDataMapData.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Map/WildlifeState.func.hpp" +#include "OpenSHC/UI/MenuModals/DebugDataMapData.func.hpp" + +#include "OpenSHC/Globals/DAT_WildlifeState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace DebugDataMapData { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AAB20 + void MenuModalRenderFunction_DebugDataMapData(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::Map::WildlifeState_Func::renderDebugDataMapData, DAT_WildlifeState::ptr)( + x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/DebugDataMousePointing/MenuModalRenderFunction_DebugDataMousePointing.cpp b/src/OpenSHC/UI/MenuModals/DebugDataMousePointing/MenuModalRenderFunction_DebugDataMousePointing.cpp new file mode 100644 index 000000000..1733c3a8d --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/DebugDataMousePointing/MenuModalRenderFunction_DebugDataMousePointing.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Rendering/ViewportRenderState.func.hpp" +#include "OpenSHC/UI/MenuModals/DebugDataMousePointing.func.hpp" + +#include "OpenSHC/Globals/DAT_ViewportRenderState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace DebugDataMousePointing { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AAAC0 + void MenuModalRenderFunction_DebugDataMousePointing(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::Rendering::ViewportRenderState_Func::renderDebugDataMousePointing, + DAT_ViewportRenderState::ptr)(x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/DebugDataNetwork/MenuModalRenderFunction_DebugDataNetwork.cpp b/src/OpenSHC/UI/MenuModals/DebugDataNetwork/MenuModalRenderFunction_DebugDataNetwork.cpp new file mode 100644 index 000000000..b7d42c0b4 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/DebugDataNetwork/MenuModalRenderFunction_DebugDataNetwork.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/UI/MenuModals/DebugDataNetwork.func.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace DebugDataNetwork { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AAAE0 + void MenuModalRenderFunction_DebugDataNetwork(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::renderDebugDataNetwork, + DAT_GameSynchronyState::ptr)(x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/DebugDataSplitInfo/MenuModalRenderFunction_DebugDataSplitInfo.cpp b/src/OpenSHC/UI/MenuModals/DebugDataSplitInfo/MenuModalRenderFunction_DebugDataSplitInfo.cpp new file mode 100644 index 000000000..eb0b0e732 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/DebugDataSplitInfo/MenuModalRenderFunction_DebugDataSplitInfo.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/UI/MenuModals/DebugDataSplitInfo.func.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace DebugDataSplitInfo { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AAB00 + void MenuModalRenderFunction_DebugDataSplitInfo(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::renderDebugDataSplitInfo, + DAT_GameSynchronyState::ptr)(x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/DebugDataUnitData/MenuModalRenderFunction_DebugDataUnitData.cpp b/src/OpenSHC/UI/MenuModals/DebugDataUnitData/MenuModalRenderFunction_DebugDataUnitData.cpp new file mode 100644 index 000000000..44e80409a --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/DebugDataUnitData/MenuModalRenderFunction_DebugDataUnitData.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Map/Units/UnitsState.func.hpp" +#include "OpenSHC/UI/MenuModals/DebugDataUnitData.func.hpp" + +#include "OpenSHC/Globals/DAT_UnitsState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace DebugDataUnitData { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AAA80 + void MenuModalRenderFunction_DebugDataUnitData(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::renderDebugDataUnitData, DAT_UnitsState::ptr)( + x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/DebugDataZoneDataUnk/MenuModalRenderFunction_DebugDataZoneDataUnk.cpp b/src/OpenSHC/UI/MenuModals/DebugDataZoneDataUnk/MenuModalRenderFunction_DebugDataZoneDataUnk.cpp new file mode 100644 index 000000000..04792f035 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/DebugDataZoneDataUnk/MenuModalRenderFunction_DebugDataZoneDataUnk.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Map/Units/TroopValueState.func.hpp" +#include "OpenSHC/UI/MenuModals/DebugDataZoneDataUnk.func.hpp" + +#include "OpenSHC/Globals/DAT_TroopValueState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace DebugDataZoneDataUnk { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AAAA0 + void MenuModalRenderFunction_DebugDataZoneDataUnk(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::Map::Units::TroopValueState_Func::renderAttackInfoDebugOverlay, + DAT_TroopValueState::ptr)(x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/DisableTroops/MenuModalRenderFunction_DisableTroops.cpp b/src/OpenSHC/UI/MenuModals/DisableTroops/MenuModalRenderFunction_DisableTroops.cpp new file mode 100644 index 000000000..343c0bbc3 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/DisableTroops/MenuModalRenderFunction_DisableTroops.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/MenuModals/DisableTroops.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace DisableTroops { + + // FUNCTION: STRONGHOLDCRUSADER 0x004ABCB0 + void MenuModalRenderFunction_DisableTroops(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(199, 0xbc, x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/DisableWeapon/MenuModalRenderFunction_DisableWeapon.cpp b/src/OpenSHC/UI/MenuModals/DisableWeapon/MenuModalRenderFunction_DisableWeapon.cpp new file mode 100644 index 000000000..d497fc976 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/DisableWeapon/MenuModalRenderFunction_DisableWeapon.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/MenuModals/DisableWeapon.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace DisableWeapon { + + // FUNCTION: STRONGHOLDCRUSADER 0x004ABCE0 + void MenuModalRenderFunction_DisableWeapon(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(199, 0xbd, x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/DisplayAiLordMessage/MenuModalRenderFunction_DisplayAiLordMessage.cpp b/src/OpenSHC/UI/MenuModals/DisplayAiLordMessage/MenuModalRenderFunction_DisplayAiLordMessage.cpp new file mode 100644 index 000000000..5ab65710c --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/DisplayAiLordMessage/MenuModalRenderFunction_DisplayAiLordMessage.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Rendering/Bink/AIMessageQueue.func.hpp" +#include "OpenSHC/UI/MenuModals/DisplayAiLordMessage.func.hpp" + +#include "OpenSHC/Globals/DAT_VideoBikQueue.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace DisplayAiLordMessage { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AB440 + void MenuModalRenderFunction_DisplayAiLordMessage(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER( + OpenSHC::Rendering::Bink::AIMessageQueue_Func::playAiLordMessage, DAT_VideoBikQueue::ptr)(x, y); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/EnterTitleOnGameStart/MenuModalRenderFunction_EnterTitleOnGameStart.cpp b/src/OpenSHC/UI/MenuModals/EnterTitleOnGameStart/MenuModalRenderFunction_EnterTitleOnGameStart.cpp new file mode 100644 index 000000000..8d5e6c26e --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/EnterTitleOnGameStart/MenuModalRenderFunction_EnterTitleOnGameStart.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/MenuModals/EnterTitleOnGameStart.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace EnterTitleOnGameStart { + + // FUNCTION: STRONGHOLDCRUSADER 0x00491BF0 + void MenuModalRenderFunction_EnterTitleOnGameStart(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(5, 6, x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/GameplayOptions/MenuModalRenderFunction_GameplayOptions.cpp b/src/OpenSHC/UI/MenuModals/GameplayOptions/MenuModalRenderFunction_GameplayOptions.cpp new file mode 100644 index 000000000..061906c47 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/GameplayOptions/MenuModalRenderFunction_GameplayOptions.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/MenuModals/GameplayOptions.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace GameplayOptions { + + // FUNCTION: STRONGHOLDCRUSADER 0x00491E80 + void MenuModalRenderFunction_GameplayOptions(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(0x4a, 0x19, x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/NetworkOptions/MenuModalRenderFunction_NetworkOptions.cpp b/src/OpenSHC/UI/MenuModals/NetworkOptions/MenuModalRenderFunction_NetworkOptions.cpp new file mode 100644 index 000000000..d234390ae --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/NetworkOptions/MenuModalRenderFunction_NetworkOptions.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/MenuModals/NetworkOptions.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace NetworkOptions { + + // FUNCTION: STRONGHOLDCRUSADER 0x00492A60 + void MenuModalRenderFunction_NetworkOptions(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(0x4a, 6, x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/OnlineQuitGame/MenuModalRenderFunction_OnlineQuitGame.cpp b/src/OpenSHC/UI/MenuModals/OnlineQuitGame/MenuModalRenderFunction_OnlineQuitGame.cpp new file mode 100644 index 000000000..fbba87f66 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/OnlineQuitGame/MenuModalRenderFunction_OnlineQuitGame.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/MenuModals/OnlineQuitGame.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace OnlineQuitGame { + + // FUNCTION: STRONGHOLDCRUSADER 0x004937B0 + void MenuModalRenderFunction_OnlineQuitGame(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(0x4a, 7, x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/OptionsMenu/MenuModalRenderFunction_OptionsMenu.cpp b/src/OpenSHC/UI/MenuModals/OptionsMenu/MenuModalRenderFunction_OptionsMenu.cpp new file mode 100644 index 000000000..cae175e53 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/OptionsMenu/MenuModalRenderFunction_OptionsMenu.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/MenuModals/OptionsMenu.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace OptionsMenu { + + // FUNCTION: STRONGHOLDCRUSADER 0x00491810 + void MenuModalRenderFunction_OptionsMenu(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(0x4a, 1, x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/SkirmishConnectionOptions/MenuModalRenderFunction_SkirmishConnectionOptions.cpp b/src/OpenSHC/UI/MenuModals/SkirmishConnectionOptions/MenuModalRenderFunction_SkirmishConnectionOptions.cpp new file mode 100644 index 000000000..bd1fc7a9b --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/SkirmishConnectionOptions/MenuModalRenderFunction_SkirmishConnectionOptions.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/MenuModals/SkirmishConnectionOptions.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace SkirmishConnectionOptions { + + // FUNCTION: STRONGHOLDCRUSADER 0x004ABE50 + void MenuModalRenderFunction_SkirmishConnectionOptions(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(0x4f, 0x5d, x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/SkirmishPlayOptions/MenuModalRenderFunction_SkirmishPlayOptions.cpp b/src/OpenSHC/UI/MenuModals/SkirmishPlayOptions/MenuModalRenderFunction_SkirmishPlayOptions.cpp new file mode 100644 index 000000000..4829b68b7 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/SkirmishPlayOptions/MenuModalRenderFunction_SkirmishPlayOptions.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/MenuModals/SkirmishPlayOptions.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace SkirmishPlayOptions { + + // FUNCTION: STRONGHOLDCRUSADER 0x004ABE80 + void MenuModalRenderFunction_SkirmishPlayOptions(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(0x4f, 0x67, x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/SoundOptions/MenuModalRenderFunction_SoundOptions.cpp b/src/OpenSHC/UI/MenuModals/SoundOptions/MenuModalRenderFunction_SoundOptions.cpp new file mode 100644 index 000000000..9c86cf509 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/SoundOptions/MenuModalRenderFunction_SoundOptions.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/MenuModals/SoundOptions.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace SoundOptions { + + // FUNCTION: STRONGHOLDCRUSADER 0x00492660 + void MenuModalRenderFunction_SoundOptions(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(0x4a, 5, x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/StartGoods/MenuModalRenderFunction_StartGoods.cpp b/src/OpenSHC/UI/MenuModals/StartGoods/MenuModalRenderFunction_StartGoods.cpp new file mode 100644 index 000000000..b9fe397dc --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/StartGoods/MenuModalRenderFunction_StartGoods.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/MenuModals/StartGoods.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace StartGoods { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AB4E0 + void MenuModalRenderFunction_StartGoods(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(199, 0x29, x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/TextEditor/MenuModalRenderFunction_TextEditor.cpp b/src/OpenSHC/UI/MenuModals/TextEditor/MenuModalRenderFunction_TextEditor.cpp new file mode 100644 index 000000000..d78272730 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/TextEditor/MenuModalRenderFunction_TextEditor.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Text/TextEditorState.func.hpp" +#include "OpenSHC/UI/MenuModals/TextEditor.func.hpp" + +#include "OpenSHC/Globals/DAT_TextEditorState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace TextEditor { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AAB40 + void MenuModalRenderFunction_TextEditor(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER( + OpenSHC::Text::TextEditorState_Func::setTextRenderingLogic, DAT_TextEditorState::ptr)(); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/TraderSettings/MenuModalRenderFunction_TraderSettings.cpp b/src/OpenSHC/UI/MenuModals/TraderSettings/MenuModalRenderFunction_TraderSettings.cpp new file mode 100644 index 000000000..c881d36bf --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/TraderSettings/MenuModalRenderFunction_TraderSettings.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/MenuModals/TraderSettings.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace TraderSettings { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AB4B0 + void MenuModalRenderFunction_TraderSettings(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(199, 0x26, x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/TriggerEvent/MenuModalRenderFunction_TriggerEvent.cpp b/src/OpenSHC/UI/MenuModals/TriggerEvent/MenuModalRenderFunction_TriggerEvent.cpp new file mode 100644 index 000000000..f41936dad --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/TriggerEvent/MenuModalRenderFunction_TriggerEvent.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/MenuModals/TriggerEvent.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace TriggerEvent { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AC250 + void MenuModalRenderFunction_TriggerEvent(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(199, 0x17, x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/TutorialBox/MenuModalRenderFunction_TutorialBox_Thunk.cpp b/src/OpenSHC/UI/MenuModals/TutorialBox/MenuModalRenderFunction_TutorialBox_Thunk.cpp new file mode 100644 index 000000000..abb96cfb2 --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/TutorialBox/MenuModalRenderFunction_TutorialBox_Thunk.cpp @@ -0,0 +1,18 @@ +#include "OpenSHC/UI/MenuModals/TutorialBox.func.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace TutorialBox { + + // FUNCTION: STRONGHOLDCRUSADER 0x004abd10 + void MenuModalRenderFunction_TutorialBox_Thunk(int x, int y, int width, int height) + { + MACRO_CALL(OpenSHC::UI::MenuModals::TutorialBox_Func::MenuModalRenderFunction_TutorialBox)( + x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuModals/UnusedSiegeAttackingForceUnk/MenuModalRenderFunction_UnusedSiegeAttackingForceUnk.cpp b/src/OpenSHC/UI/MenuModals/UnusedSiegeAttackingForceUnk/MenuModalRenderFunction_UnusedSiegeAttackingForceUnk.cpp new file mode 100644 index 000000000..5d2f141cb --- /dev/null +++ b/src/OpenSHC/UI/MenuModals/UnusedSiegeAttackingForceUnk/MenuModalRenderFunction_UnusedSiegeAttackingForceUnk.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/MenuModals/UnusedSiegeAttackingForceUnk.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuModals { + namespace UnusedSiegeAttackingForceUnk { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AB510 + void MenuModalRenderFunction_UnusedSiegeAttackingForceUnk(int x, int y, int width, int height) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(199, 0xa4, x, y, width, height); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuTextInputState/clearModalDialog2to6.cpp b/src/OpenSHC/UI/MenuTextInputState/clearModalDialog2to6.cpp new file mode 100644 index 000000000..6c4ae6b24 --- /dev/null +++ b/src/OpenSHC/UI/MenuTextInputState/clearModalDialog2to6.cpp @@ -0,0 +1,18 @@ +#include "OpenSHC/UI/MenuTextInputState.hpp" + +namespace OpenSHC { + +namespace UI { + + // FUNCTION: STRONGHOLDCRUSADER 0x00491730 + void MenuTextInputState::clearModalDialog2to6() + { + this->modalDialog_2 = 0; + this->modalDialog_3 = 0; + this->modalDialog_4 = 0; + this->modalDialog_5 = 0; + this->modalDialog_6 = 0; + } +} + +} diff --git a/src/OpenSHC/UI/MenuViews/CampaignUnk/MenuView_CampaignUnk_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/CampaignUnk/MenuView_CampaignUnk_DoEveryFrame.cpp new file mode 100644 index 000000000..3d6f56bb0 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/CampaignUnk/MenuView_CampaignUnk_DoEveryFrame.cpp @@ -0,0 +1,33 @@ +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuViews/CampaignUnk.func.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + namespace CampaignUnk { + + using OpenSHC::UI::Enums::MenuViewType; + + // FUNCTION: STRONGHOLDCRUSADER 0x004D6EF0 + void MenuView_CampaignUnk_DoEveryFrame() + { + if (MACRO_CALL(OpenSHC::UI::Helpers_Func::TicksSinceCounterStart)() == 0) { + return; + } + if (DAT_GameCore::instance.missionNumber1to20 == 1) { + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_SCENARIO_DESCRIPTION, 0); + return; + } + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_UNKNOWN_26_CAMPAIGN_RELATEDUnk, 0); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/CrusadeMissionIntro/MenuView_CrusadeMissionIntro_Prepare.cpp b/src/OpenSHC/UI/MenuViews/CrusadeMissionIntro/MenuView_CrusadeMissionIntro_Prepare.cpp new file mode 100644 index 000000000..5ac5670ff --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/CrusadeMissionIntro/MenuView_CrusadeMissionIntro_Prepare.cpp @@ -0,0 +1,28 @@ +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuViews/CrusadeMissionIntro.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_MissionDefinedData.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/INT_00eb9ae8.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + namespace CrusadeMissionIntro { + + // FUNCTION: STRONGHOLDCRUSADER 0x004D8AB0 + void MenuView_CrusadeMissionIntro_Prepare() + { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("skirmish_background.tgx"); + MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); + INT_00eb9ae8::instance = 0; + DAT_MissionDefinedData::instance.field26_0xaf8 = true; + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/EditScenario/MenuView_EditScenario_Prepare.cpp b/src/OpenSHC/UI/MenuViews/EditScenario/MenuView_EditScenario_Prepare.cpp new file mode 100644 index 000000000..2b14d1176 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/EditScenario/MenuView_EditScenario_Prepare.cpp @@ -0,0 +1,29 @@ +#include "OpenSHC/Map/MapPropertiesState.func.hpp" +#include "OpenSHC/UI/MenuViews/EditScenario.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_CopyOfScenarioGold.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_MapPropertiesState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + namespace EditScenario { + + // FUNCTION: STRONGHOLDCRUSADER 0x004BEC10 + void MenuView_EditScenario_Prepare() + { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("frontend_builder2.tgx"); + MACRO_CALL_MEMBER(OpenSHC::Map::MapPropertiesState_Func::updateEventYearsAndCommitBuildingAvailability, + DAT_MapPropertiesState::ptr)(); + DAT_CopyOfScenarioGold::instance = DAT_GameState::instance.mapAndTime.scenarioGold; + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoEveryFrame_FirstGfxCentered.cpp b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoEveryFrame_FirstGfxCentered.cpp new file mode 100644 index 000000000..3f4be52d0 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoEveryFrame_FirstGfxCentered.cpp @@ -0,0 +1,28 @@ +#include "OpenSHC/UI/MenuViews/General.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + namespace General { + + // FUNCTION: STRONGHOLDCRUSADER 0x004271E0 + void MenuView_General_DoEveryFrame_FirstGfxCentered() + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_OnlySetMenuXY.cpp b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_OnlySetMenuXY.cpp new file mode 100644 index 000000000..4ff6ecc02 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_OnlySetMenuXY.cpp @@ -0,0 +1,29 @@ +#include "OpenSHC/UI/MenuViews/General.func.hpp" +#include "OpenSHC/UI/Menu.hpp" + +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + namespace General { + + using OpenSHC::UI::Menu; + + // FUNCTION: STRONGHOLDCRUSADER 0x004B8050 + void MenuView_General_DoInitial_OnlySetMenuXY() + { + int const y = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + 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; + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/General/MenuView_General_Prepare_SwordShieldAndBorder.cpp b/src/OpenSHC/UI/MenuViews/General/MenuView_General_Prepare_SwordShieldAndBorder.cpp new file mode 100644 index 000000000..548deb820 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/General/MenuView_General_Prepare_SwordShieldAndBorder.cpp @@ -0,0 +1,27 @@ +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuViews/General.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + namespace General { + + // FUNCTION: STRONGHOLDCRUSADER 0x0042BB70 + void MenuView_General_Prepare_SwordShieldAndBorder() + { + DAT_GameSynchronyState::instance.field225_0x106ee4 = 0; + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_frontend_combat3_tgx_005a2134); + MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_DoInitial.cpp new file mode 100644 index 000000000..dfc890c72 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_DoInitial.cpp @@ -0,0 +1,31 @@ +#include "OpenSHC/UI/MenuViews/IntroLogos.func.hpp" +#include "OpenSHC/UI/Menu.hpp" + +#include "OpenSHC/Globals/DAT_IntroTimestamp.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + namespace IntroLogos { + + using OpenSHC::UI::Menu; + + // FUNCTION: STRONGHOLDCRUSADER 0x00424770 + void MenuView_IntroLogos_DoInitial() + { + int const y = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + 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; + DAT_IntroTimestamp::instance = timeGetTime(); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_Prepare.cpp b/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_Prepare.cpp new file mode 100644 index 000000000..b2d428247 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_Prepare.cpp @@ -0,0 +1,28 @@ +#include "OpenSHC/UI/DisplayElements.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuViews/MapEditorLandscaping.func.hpp" +#include "OpenSHC/UI/Enums/DisplayElementID.hpp" + +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + namespace MapEditorLandscaping { + + using OpenSHC::UI::Enums::DisplayElementID; + + // FUNCTION: STRONGHOLDCRUSADER 0x00430CC0 + void MenuView_MapEditorLandscaping_Prepare() + { + DAT_WindowAndDirectDraw::instance.field37_0xdc = 1; + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_PEOPLE_LEFT_TO_PLACE, 0); + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_PLAYER_INFO_ON_HOVER, 1); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/NewMapMapsize/MenuView_NewMapMapsize_Prepare.cpp b/src/OpenSHC/UI/MenuViews/NewMapMapsize/MenuView_NewMapMapsize_Prepare.cpp new file mode 100644 index 000000000..6d419d6f1 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/NewMapMapsize/MenuView_NewMapMapsize_Prepare.cpp @@ -0,0 +1,25 @@ +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuViews/NewMapMapsize.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + namespace NewMapMapsize { + + // FUNCTION: STRONGHOLDCRUSADER 0x0042F3D0 + void MenuView_NewMapMapsize_Prepare() + { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_frontend_builder2_tgx_005a206c); + MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/NewMapMaptype/MenuView_NewMapMaptype_Prepare.cpp b/src/OpenSHC/UI/MenuViews/NewMapMaptype/MenuView_NewMapMaptype_Prepare.cpp new file mode 100644 index 000000000..10aa8b07c --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/NewMapMaptype/MenuView_NewMapMaptype_Prepare.cpp @@ -0,0 +1,27 @@ +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuViews/NewMapMaptype.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + namespace NewMapMaptype { + + // FUNCTION: STRONGHOLDCRUSADER 0x0042EFE0 + void MenuView_NewMapMaptype_Prepare() + { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_frontend_builder_tgx_005a2084); + MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); + DAT_GameCore::instance.mapU3EndInt = 0; + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/RankingGames/MenuView_RankingGames_Prepare.cpp b/src/OpenSHC/UI/MenuViews/RankingGames/MenuView_RankingGames_Prepare.cpp new file mode 100644 index 000000000..4342302a3 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/RankingGames/MenuView_RankingGames_Prepare.cpp @@ -0,0 +1,31 @@ +#include "OpenSHC/Game/Skirmish.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuViews/RankingGames.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_00ed27a0.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_StoredGameMode.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + namespace RankingGames { + + // FUNCTION: STRONGHOLDCRUSADER 0x004D9700 + void MenuView_RankingGames_Prepare() + { + MACRO_CALL(OpenSHC::Game::Skirmish_Func::Skirmish_PrepareLeaderboardView)(); + DAT_00ed27a0::instance = 0; + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)("frontend_combat3.tgx"); + MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); + DAT_StoredGameMode::instance = DAT_GameSynchronyState::instance.currentGameMode; + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/Unknown26/MenuView_Unknown26_CampaignRelatedUnk_Prepare.cpp b/src/OpenSHC/UI/MenuViews/Unknown26/MenuView_Unknown26_CampaignRelatedUnk_Prepare.cpp new file mode 100644 index 000000000..1dd90c457 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/Unknown26/MenuView_Unknown26_CampaignRelatedUnk_Prepare.cpp @@ -0,0 +1,25 @@ +#include "OpenSHC/Rendering.func.hpp" +#include "OpenSHC/UI/Credits.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuViews/Unknown26.func.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + namespace Unknown26 { + + // FUNCTION: STRONGHOLDCRUSADER 0x004DCC70 + void MenuView_Unknown26_CampaignRelatedUnk_Prepare() + { + MACRO_CALL(OpenSHC::UI::Credits_Func::ResetCredits)(); + MACRO_CALL(OpenSHC::UI::Helpers_Func::BuildIntroLogoSequence)( + DAT_GameCore::instance.missionNumber1to20, DAT_GameCore::instance.section1066); + MACRO_CALL(OpenSHC::Rendering_Func::TicksStartCounter)(); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/UnusedChooseAvailableKeeps/MenuView_UnusedChooseAvailableKeeps_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedChooseAvailableKeeps/MenuView_UnusedChooseAvailableKeeps_Prepare.cpp new file mode 100644 index 000000000..05fa1412b --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedChooseAvailableKeeps/MenuView_UnusedChooseAvailableKeeps_Prepare.cpp @@ -0,0 +1,23 @@ +#include "OpenSHC/UI/MenuViews/UnusedChooseAvailableKeeps.func.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + namespace UnusedChooseAvailableKeeps { + + // FUNCTION: STRONGHOLDCRUSADER 0x0042FAA0 + void MenuView_UnusedChooseAvailableKeeps_Prepare() + { + DAT_GameCore::instance.mapU2MiddleBytes[0] = 1; + DAT_GameCore::instance.mapU2MiddleBytes[1] = 1; + DAT_GameCore::instance.mapU2MiddleBytes[2] = 1; + DAT_GameCore::instance.mapU2MiddleBytes[3] = 1; + DAT_GameCore::instance.mapU2MiddleBytes[4] = 1; + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_DoEveryFrame.cpp new file mode 100644 index 000000000..2abadd778 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_DoEveryFrame.cpp @@ -0,0 +1,30 @@ +#include "OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/INT_00b960e0.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + namespace UnusedDemoBuyItScreen { + + // FUNCTION: STRONGHOLDCRUSADER 0x004266A0 + void MenuView_UnusedDemoBuyItScreen_DoEveryFrame() + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2 + + INT_00b960e0::instance, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_Prepare.cpp new file mode 100644 index 000000000..5a41dbdfd --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_Prepare.cpp @@ -0,0 +1,34 @@ +#include "OpenSHC/Rendering.func.hpp" +#include "OpenSHC/UI/Credits.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/MenuViews/UnusedExtremeAd.func.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_00ed278c.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition3.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + namespace UnusedExtremeAd { + + using OpenSHC::UI::Enums::MenuModalType; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004E1A20 + void MenuView_UnusedExtremeAd_Prepare() + { + MACRO_CALL(OpenSHC::UI::Credits_Func::ResetCredits)(); + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition3::ptr)(OpenSHC::UI::Enums::MMT_NONE, FALSE); + MACRO_CALL(OpenSHC::UI::Helpers_Func::BuildExtremeDemoIntroScript)(); + MACRO_CALL(OpenSHC::Rendering_Func::TicksStartCounter)(); + DAT_00ed278c::instance = 0; + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/UnusedHelpTextEditor/MenuView_UnusedHelpTextEditor_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/UnusedHelpTextEditor/MenuView_UnusedHelpTextEditor_DoEveryFrame.cpp new file mode 100644 index 000000000..37397279f --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedHelpTextEditor/MenuView_UnusedHelpTextEditor_DoEveryFrame.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/Text/TextEditorState.func.hpp" +#include "OpenSHC/UI/MenuViews/UnusedHelpTextEditor.func.hpp" + +#include "OpenSHC/Globals/DAT_TextEditorState.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + namespace UnusedHelpTextEditor { + + // FUNCTION: STRONGHOLDCRUSADER 0x00440400 + void MenuView_UnusedHelpTextEditor_DoEveryFrame() + { + MACRO_CALL_MEMBER( + OpenSHC::Text::TextEditorState_Func::renderHelpDialogIfOpen, DAT_TextEditorState::ptr)(); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/UnusedHelpTextEditor/MenuView_UnusedHelpTextEditor_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedHelpTextEditor/MenuView_UnusedHelpTextEditor_Prepare.cpp new file mode 100644 index 000000000..9c8c5dbb6 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedHelpTextEditor/MenuView_UnusedHelpTextEditor_Prepare.cpp @@ -0,0 +1,33 @@ +#include "OpenSHC/Text/TextEditorState.func.hpp" +#include "OpenSHC/UI/MenuViews/UnusedHelpTextEditor.func.hpp" +#include "OpenSHC/UI/Menu.hpp" + +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_TextEditorState.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + namespace UnusedHelpTextEditor { + + using OpenSHC::UI::Menu; + + // FUNCTION: STRONGHOLDCRUSADER 0x004403D0 + void MenuView_UnusedHelpTextEditor_Prepare() + { + int const y = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const x = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = x; + menu->yPosition = y; + DAT_MenuHandlerState::instance.y = y; + DAT_MenuHandlerState::instance.x = x; + MACRO_CALL_MEMBER( + OpenSHC::Text::TextEditorState_Func::bltTextToScreenIfNeedBe, DAT_TextEditorState::ptr)(); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/UnusedSomeMissionStartUnk/MenuView_UnusedSomeMissionStartUnk_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedSomeMissionStartUnk/MenuView_UnusedSomeMissionStartUnk_Prepare.cpp new file mode 100644 index 000000000..02691cade --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedSomeMissionStartUnk/MenuView_UnusedSomeMissionStartUnk_Prepare.cpp @@ -0,0 +1,32 @@ +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuViews/UnusedSomeMissionStartUnk.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + namespace UnusedSomeMissionStartUnk { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00426F80 + void MenuView_UnusedSomeMissionStartUnk_Prepare() + { + DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_multi_background_tgx_005a211c); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_gm_fly_tgx_005a2110); + MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); + } + + } + } +} +} diff --git a/src/OpenSHC/UI/MinimapViewState/setMapPropertyDependingOnMapSize.cpp b/src/OpenSHC/UI/MinimapViewState/setMapPropertyDependingOnMapSize.cpp new file mode 100644 index 000000000..509fec447 --- /dev/null +++ b/src/OpenSHC/UI/MinimapViewState/setMapPropertyDependingOnMapSize.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/MinimapViewState.func.hpp" + +#include "OpenSHC/Globals/DAT_TileMapState.hpp" + +namespace OpenSHC { +namespace UI { + + // FUNCTION: STRONGHOLDCRUSADER 0x004B6640 + void MinimapViewState::setMapPropertyDependingOnMapSize(uint x, int y) + { + if (DAT_TileMapState::instance.mapSize > 200) { + MACRO_CALL_MEMBER(OpenSHC::UI::MinimapViewState_Func::renderMinimapTileStripWithLuminescence, this)( + 4, 2, 1, x, y); + return; + } + MACRO_CALL_MEMBER(OpenSHC::UI::MinimapViewState_Func::renderMinimapTileStripWithLuminescence, this)( + 4, 4, 2, x, y); + } + +} +} diff --git a/src/OpenSHC/UI/MinimapViewState/setTileColorsDependingOnMapSize.cpp b/src/OpenSHC/UI/MinimapViewState/setTileColorsDependingOnMapSize.cpp new file mode 100644 index 000000000..3a692417a --- /dev/null +++ b/src/OpenSHC/UI/MinimapViewState/setTileColorsDependingOnMapSize.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/UI/MinimapViewState.func.hpp" + +#include "OpenSHC/Globals/DAT_TileMapState.hpp" + +namespace OpenSHC { +namespace UI { + + // FUNCTION: STRONGHOLDCRUSADER 0x004B6680 + void MinimapViewState::setTileColorsDependingOnMapSize(int x, uint y) + { + if (DAT_TileMapState::instance.mapSize > 200) { + MACRO_CALL_MEMBER(OpenSHC::UI::MinimapViewState_Func::renderMinimapTileColors, this)(4, 2, 1, x, y); + return; + } + MACRO_CALL_MEMBER(OpenSHC::UI::MinimapViewState_Func::renderMinimapTileColors, this)(4, 4, 2, x, y); + } + +} +} diff --git a/src/OpenSHC/UI/MinimapViewState/triggerMinimapRedraw.cpp b/src/OpenSHC/UI/MinimapViewState/triggerMinimapRedraw.cpp new file mode 100644 index 000000000..f884516f1 --- /dev/null +++ b/src/OpenSHC/UI/MinimapViewState/triggerMinimapRedraw.cpp @@ -0,0 +1,18 @@ +#include "OpenSHC/UI/MinimapViewState.func.hpp" + +namespace OpenSHC { +namespace UI { + + // FUNCTION: STRONGHOLDCRUSADER 0x004B5300 + void MinimapViewState::triggerMinimapRedraw(int unknown) + { + if (this->field14_0x38 == 0) { + this->field13_0x34 = 0; + this->field14_0x38 = 2; + return; + } + this->field14_0x38 = 1; + } + +} +} diff --git a/src/OpenSHC/UI/Rendering/AlphaAndButtonSurface/freeMemory.cpp b/src/OpenSHC/UI/Rendering/AlphaAndButtonSurface/freeMemory.cpp new file mode 100644 index 000000000..f094b729b --- /dev/null +++ b/src/OpenSHC/UI/Rendering/AlphaAndButtonSurface/freeMemory.cpp @@ -0,0 +1,18 @@ +#include "OpenSHC/OS.func.hpp" +#include "OpenSHC/UI/Rendering/AlphaAndButtonSurface.func.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x0045D0B0 + void AlphaAndButtonSurface::freeMemory() + { + if (this->surfacePtr != NULL) { + MACRO_CALL(OpenSHC::OS_Func::_free_base)(this->surfacePtr); + } + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/AlphaAndButtonSurface/renderNonInteractingButtonBackground.cpp b/src/OpenSHC/UI/Rendering/AlphaAndButtonSurface/renderNonInteractingButtonBackground.cpp new file mode 100644 index 000000000..11821b291 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/AlphaAndButtonSurface/renderNonInteractingButtonBackground.cpp @@ -0,0 +1,24 @@ +#include "OpenSHC/UI/Rendering/AlphaAndButtonSurface.func.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_ButtonCurrentlyInteracting.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + using OpenSHC::Rendering::Enums::RenderTarget; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004246E0 + void AlphaAndButtonSurface::renderNonInteractingButtonBackground(int blendStrength) + { + DAT_ButtonCurrentlyInteracting::instance = FALSE; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::AlphaAndButtonSurface_Func::renderBasicButton, this)( + blendStrength, OpenSHC::Rendering::Enums::RT_CONTEXT_BASED); + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/ButtonGmData/getPictureNumberInGm.cpp b/src/OpenSHC/UI/Rendering/ButtonGmData/getPictureNumberInGm.cpp new file mode 100644 index 000000000..6189c7258 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/ButtonGmData/getPictureNumberInGm.cpp @@ -0,0 +1,22 @@ +#include "../ButtonGmData.func.hpp" + +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004630B0 + int ButtonGmData::getPictureNumberInGm(BOOLEnum buttonIsInteracting) + { + if (buttonIsInteracting != FALSE) { + return this->numOfAdditionalIconStates_0x8 + this->pictureInGm_0x4; + } + return this->pictureInGm_0x4; + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/PencilRenderCore.hpp b/src/OpenSHC/UI/Rendering/PencilRenderCore.hpp index e477ec568..fa9efe66b 100644 --- a/src/OpenSHC/UI/Rendering/PencilRenderCore.hpp +++ b/src/OpenSHC/UI/Rendering/PencilRenderCore.hpp @@ -103,7 +103,7 @@ namespace UI { void drawLine(int x1, int y1, int x2, int y2, ushort color); void drawHeaderTextBanner( - int textGroupIndex, int textNumInGroup, int xPos, int yPos, int width, int param_6); + int textGroupIndex, int textNumInGroup, int xPos, int yPos, int width, int height); }; static_assert_cpp98_obj(sizeof(PencilRenderCore) == 66, PencilRenderCore); diff --git a/src/OpenSHC/UI/Rendering/PencilRenderCore/setupPencilSurface.cpp b/src/OpenSHC/UI/Rendering/PencilRenderCore/setupPencilSurface.cpp new file mode 100644 index 000000000..8173ed415 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/PencilRenderCore/setupPencilSurface.cpp @@ -0,0 +1,29 @@ +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" + +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + using OpenSHC::Rendering::Enums::RenderTarget; + + // FUNCTION: STRONGHOLDCRUSADER 0x00468C50 + void PencilRenderCore::setupPencilSurface() + { + ushort* surface = DAT_WindowAndDirectDraw::instance.surfacePointer_mapGame; + if (this->surfaceTarget == OpenSHC::Rendering::Enums::RT_SCREEN_MENU) { + surface = DAT_WindowAndDirectDraw::instance.surfacePointer_screenMenu; + } + this->surfacePtr = surface; + if (this->surfaceTarget != OpenSHC::Rendering::Enums::RT_SCREEN_MENU) { + this->horizontalByteSize = 8112; + return; + } + this->horizontalByteSize = DAT_WindowAndDirectDraw::instance.byteSizeOfOneHorizontalLine; + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/RenderMenuGfxHelper.cpp b/src/OpenSHC/UI/Rendering/RenderMenuGfxHelper.cpp new file mode 100644 index 000000000..0eb49a393 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/RenderMenuGfxHelper.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + + // FUNCTION: STRONGHOLDCRUSADER 0x004DA640 + void Rendering::RenderMenuGfxHelper(int gfxIndex, int x, int y, int blendStrength) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGfxTgxWithBlending, + DAT_TextureRenderCoreObject::ptr)(gfxIndex, DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + x, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + y, blendStrength); + } + +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/CheckGfxResourceExists.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/CheckGfxResourceExists.cpp new file mode 100644 index 000000000..2ca5c06f7 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/CheckGfxResourceExists.cpp @@ -0,0 +1,28 @@ +#include "../TextureRenderCore.func.hpp" + +#include "OpenSHC/IO/ResourceManager.func.hpp" +#include "OpenSHC/IO/FileResourceType.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_ResourceManager.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + using OpenSHC::IO::FileResourceType; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004548D0 + BOOLEnum TextureRenderCore::checkGfxResourceExists(char* fileName) + { + MACRO_CALL_MEMBER(OpenSHC::IO::ResourceManager_Func::resolveResourceFileName, DAT_ResourceManager::ptr)( + OpenSHC::IO::FRT_GFX, fileName); + return MACRO_CALL_MEMBER( + OpenSHC::IO::ResourceManager_Func::getCurrentResourceSize, DAT_ResourceManager::ptr)() + != 0; + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/checkIfGfxTgxStartsWithTransparentPixels.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/checkIfGfxTgxStartsWithTransparentPixels.cpp new file mode 100644 index 000000000..246f0c37b --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/checkIfGfxTgxStartsWithTransparentPixels.cpp @@ -0,0 +1,27 @@ + +#include "OpenSHC/IO/Graphics/GfxRef.hpp" +#include "OpenSHC/IO/Graphics/TgxToken.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.hpp" + +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x004549C0 + BOOLEnum TextureRenderCore::checkIfGfxTgxStartsWithTransparentPixels(int gfxIndex) + { + int byteIndex = this->loadedGfxArray[gfxIndex].offsetInBuffer + 8; + byte checkByte = ((byte*)this->gmAndGfxImageDataBuffer)[byteIndex]; + if ((checkByte & OpenSHC::IO::Graphics::TT_TGX_PIXEL_HEADER) + == OpenSHC::IO::Graphics::TT_TRANSPARENT_PIXELS) { + return TRUE; + } else { + return FALSE; + } + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/restoreMapSurfaceHeightRangeFromTemporaryUnk.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/restoreMapSurfaceHeightRangeFromTemporaryUnk.cpp new file mode 100644 index 000000000..c09122bc7 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/restoreMapSurfaceHeightRangeFromTemporaryUnk.cpp @@ -0,0 +1,16 @@ +#include "../TextureRenderCore.func.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x0044CCF0 + void TextureRenderCore::restoreMapSurfaceHeightRangeFromTemporaryUnk() + { + this->mapGameSurfaceHeightRange.start = this->mapSurfaceRangeTemporaryUnk_0x16c864.start; + this->mapGameSurfaceHeightRange.end = this->mapSurfaceRangeTemporaryUnk_0x16c864.end; + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/setActiveMenuTabIndexToZero.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/setActiveMenuTabIndexToZero.cpp new file mode 100644 index 000000000..8b472002d --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/setActiveMenuTabIndexToZero.cpp @@ -0,0 +1,12 @@ +#include "../TextureRenderCore.func.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x00454EF0 + void TextureRenderCore::setActiveMenuTabIndexToZero() { this->activeMenuTabIndex = 0; } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/setMapSurfaceHeightRange.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/setMapSurfaceHeightRange.cpp new file mode 100644 index 000000000..323bf36c0 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/setMapSurfaceHeightRange.cpp @@ -0,0 +1,15 @@ +#include "../TextureRenderCore.func.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x0044cca0 + void TextureRenderCore::setMapSurfaceHeightRange(int start, int end) + { + this->mapGameSurfaceHeightRange.start = start; + this->mapGameSurfaceHeightRange.end = end; + } + } +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/setMapSurfaceHeightRangeUnk.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/setMapSurfaceHeightRangeUnk.cpp new file mode 100644 index 000000000..2d4d683b0 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/setMapSurfaceHeightRangeUnk.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/UI/Rendering/TextureRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x0044ccc0 + void TextureRenderCore::setMapSurfaceHeightRangeUnk() + { + this->mapGameSurfaceHeightRange.start = 0; + this->mapGameSurfaceHeightRange.end = 2075; + } + + } // namespace Rendering +} // namespace UI +} // namespace OpenSHC diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/setMenuTabIndexUnk.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/setMenuTabIndexUnk.cpp new file mode 100644 index 000000000..e56bf0c5f --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/setMenuTabIndexUnk.cpp @@ -0,0 +1,15 @@ +#include "../TextureRenderCore.func.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x00454EE0 + void TextureRenderCore::setMenuTabIndexUnk(int indexToSetToMinusOne) + { + this->activeMenuTabIndex = indexToSetToMinusOne + 1; + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/setRenderingRect.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/setRenderingRect.cpp new file mode 100644 index 000000000..fc89f9c71 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/setRenderingRect.cpp @@ -0,0 +1,18 @@ +#include "../TextureRenderCore.func.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x00454990 + void TextureRenderCore::setRenderingRect(int xPos, int yPos, int width, int height) + { + this->renderingRect_16c854.left = xPos; + this->renderingRect_16c854.top = yPos; + this->renderingRect_16c854.right = width; + this->renderingRect_16c854.bottom = height; + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/setRenderingRectToGameResolution.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/setRenderingRectToGameResolution.cpp new file mode 100644 index 000000000..10c888072 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/setRenderingRectToGameResolution.cpp @@ -0,0 +1,20 @@ +#include "../TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x00454960 + void TextureRenderCore::setRenderingRectToGameResolution() + { + this->renderingRect_16c854.left = 0; + this->renderingRect_16c854.top = 0; + this->renderingRect_16c854.right = DAT_WindowAndDirectDraw::instance.resolutionX; + this->renderingRect_16c854.bottom = DAT_WindowAndDirectDraw::instance.resolutionY; + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/setScreenMenuSurfaceHeightRange.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/setScreenMenuSurfaceHeightRange.cpp new file mode 100644 index 000000000..a85b82b99 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/setScreenMenuSurfaceHeightRange.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/UI/Rendering/TextureRenderCore.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x0044cd10 + void TextureRenderCore::setScreenMenuSurfaceHeightRange(int start, int end) + { + this->screenMenuSurfaceHeightRange.start = start; + this->screenMenuSurfaceHeightRange.end = end; + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/setScreenMenuSurfaceHeightRangeToResolution.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/setScreenMenuSurfaceHeightRangeToResolution.cpp new file mode 100644 index 000000000..042ff1659 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/setScreenMenuSurfaceHeightRangeToResolution.cpp @@ -0,0 +1,18 @@ +#include "OpenSHC/UI/Rendering/TextureRenderCore.hpp" + +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x0044cd30 + void TextureRenderCore::setScreenMenuSurfaceHeightRangeToResolution() + { + this->screenMenuSurfaceHeightRange.start = 0; + this->screenMenuSurfaceHeightRange.end = DAT_WindowAndDirectDraw::ptr->resolutionY; + } + + } // namespace Rendering +} // namespace UI +} // namespace OpenSHC diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/temporarySaveMapSurfaceHeightRangeUnk.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/temporarySaveMapSurfaceHeightRangeUnk.cpp new file mode 100644 index 000000000..067aefdca --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/temporarySaveMapSurfaceHeightRangeUnk.cpp @@ -0,0 +1,16 @@ +#include "../TextureRenderCore.func.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x0044CCD0 + void TextureRenderCore::temporarySaveMapSurfaceHeightRangeUnk() + { + this->mapSurfaceRangeTemporaryUnk_0x16c864.start = this->mapGameSurfaceHeightRange.start; + this->mapSurfaceRangeTemporaryUnk_0x16c864.end = this->mapGameSurfaceHeightRange.end; + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/transformTgxCompressedImageToRGB565.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/transformTgxCompressedImageToRGB565.cpp new file mode 100644 index 000000000..4038a632a --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/transformTgxCompressedImageToRGB565.cpp @@ -0,0 +1,23 @@ +#include "../TextureRenderCore.func.hpp" + +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_GMImageOffsets.hpp" +#include "OpenSHC/Globals/DAT_GMImageSizes.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x00455270 + void TextureRenderCore::transformTgxCompressedImageToRGB565(int imageIndex) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::transformTgxFromRGB555ToRGB565, this)( + (ushort*)((byte*)this->gmProcessedImageData + DAT_GMImageOffsets::instance[imageIndex]), + DAT_GMImageSizes::instance[imageIndex]); + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/transformUncompressedImageToRGB565.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/transformUncompressedImageToRGB565.cpp new file mode 100644 index 000000000..f7fe44e60 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/transformUncompressedImageToRGB565.cpp @@ -0,0 +1,21 @@ +#include "../TextureRenderCore.func.hpp" + +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_GMImageOffsets.hpp" +#include "OpenSHC/Globals/DAT_GMImageSizes.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x004552e0 + void TextureRenderCore::transformUncompressedImageToRGB565(int imageIndex) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::transformRawToRGB555To565, this)( + DAT_GMImageOffsets::instance[imageIndex], DAT_GMImageSizes::instance[imageIndex]); + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/transformUncompressedImageWithMarkerUnkToRGB565.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/transformUncompressedImageWithMarkerUnkToRGB565.cpp new file mode 100644 index 000000000..9b6aa6b71 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/transformUncompressedImageWithMarkerUnkToRGB565.cpp @@ -0,0 +1,21 @@ +#include "../TextureRenderCore.func.hpp" + +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_GMImageOffsets.hpp" +#include "OpenSHC/Globals/DAT_GMImageSizes.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x00455250 + void TextureRenderCore::transformUncompressedImageWithMarkerUnkToRGB565(int imageIndex) + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::transformRawWithMarkerUnkToRGB555To565, + this)(DAT_GMImageOffsets::instance[imageIndex], DAT_GMImageSizes::instance[imageIndex]); + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/WindowAndDirectDraw/cleanDirectDraw.cpp b/src/OpenSHC/UI/Rendering/WindowAndDirectDraw/cleanDirectDraw.cpp new file mode 100644 index 000000000..1ea39b0d5 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/WindowAndDirectDraw/cleanDirectDraw.cpp @@ -0,0 +1,20 @@ +#include "OpenSHC/UI/Rendering/WindowAndDirectDraw.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x0046F730 + void WindowAndDirectDraw::cleanDirectDraw() + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::WindowAndDirectDraw_Func::releaseSurfacesAndDirectDraw, this)( + TRUE); + this->drawingReady_0x0 = FALSE; + } + + } +} +} diff --git a/src/OpenSHC/UI/Rendering/WindowAndDirectDraw/finalizeDirectDrawShutdown.cpp b/src/OpenSHC/UI/Rendering/WindowAndDirectDraw/finalizeDirectDrawShutdown.cpp new file mode 100644 index 000000000..4dfd66007 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/WindowAndDirectDraw/finalizeDirectDrawShutdown.cpp @@ -0,0 +1,20 @@ +#include "OpenSHC/UI/Rendering/WindowAndDirectDraw.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace UI { + namespace Rendering { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00467E40 + void WindowAndDirectDraw::finalizeDirectDrawShutdown() + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::WindowAndDirectDraw_Func::releaseSurfacesAndDirectDraw, this)( + TRUE); + CoUninitialize(); + } + + } +} +} diff --git a/src/OpenSHC/Util/Timing/Stopwatch/start.cpp b/src/OpenSHC/Util/Timing/Stopwatch/start.cpp new file mode 100644 index 000000000..7dd58e45f --- /dev/null +++ b/src/OpenSHC/Util/Timing/Stopwatch/start.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/Util/Timing/Stopwatch.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Util { + namespace Timing { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x0046CED0 + void Stopwatch::start() + { + this->startTime_0x8 = timeGetTime(); + this->running_0x4 = TRUE; + } + + } +} +} diff --git a/src/OpenSHC/Util/Timing/Stopwatch/stop.cpp b/src/OpenSHC/Util/Timing/Stopwatch/stop.cpp new file mode 100644 index 000000000..95427de42 --- /dev/null +++ b/src/OpenSHC/Util/Timing/Stopwatch/stop.cpp @@ -0,0 +1,23 @@ +#include "OpenSHC/Util/Timing/Stopwatch.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Util { + namespace Timing { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x0046CEF0 + void Stopwatch::stop() + { + if (this->running_0x4 == FALSE) { + return; + } + this->stopTime_0xc = timeGetTime(); + this->running_0x4 = FALSE; + this->duration_0x0 = this->stopTime_0xc - this->startTime_0x8; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index b80b8635f..58cdae59e 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -381,15 +381,15 @@ SHC_3BB0A8C1_0x00400260 | 0.0% | Pending SHC_3BB0A8C1_0x00400288 | 0.0% | Pending -SHC_3BB0A8C1_0x00401000 | 0.0% | Pending +SHC_3BB0A8C1_0x00401000 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00401040 | 0.0% | Pending +SHC_3BB0A8C1_0x00401040 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00401060 | 0.0% | Pending +SHC_3BB0A8C1_0x00401060 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00401090 | 0.0% | Pending +SHC_3BB0A8C1_0x00401090 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004010B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004010B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004010E0 | 0.0% | Pending @@ -415,13 +415,13 @@ SHC_3BB0A8C1_0x004012F0 | 0.0% | Pending SHC_3BB0A8C1_0x00401380 | 0.0% | Pending -SHC_3BB0A8C1_0x00401400 | 0.0% | Pending +SHC_3BB0A8C1_0x00401400 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00401430 | 0.0% | Pending +SHC_3BB0A8C1_0x00401430 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00401460 | 0.0% | Pending -SHC_3BB0A8C1_0x00401540 | 0.0% | Pending +SHC_3BB0A8C1_0x00401540 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00401570 | 0.0% | Pending @@ -445,11 +445,11 @@ SHC_3BB0A8C1_0x004019D0 | 0.0% | Pending SHC_3BB0A8C1_0x00401A50 | 0.0% | Pending -SHC_3BB0A8C1_0x00401AE0 | 0.0% | Pending +SHC_3BB0A8C1_0x00401AE0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00401B20 | 0.0% | Pending -SHC_3BB0A8C1_0x00401B60 | 0.0% | Pending +SHC_3BB0A8C1_0x00401B60 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00401BA0 | 0.0% | Pending @@ -503,7 +503,7 @@ SHC_3BB0A8C1_0x00402A18 | 0.0% | Pending SHC_3BB0A8C1_0x00402A20 | 0.0% | Pending -SHC_3BB0A8C1_0x00402AB0 | 0.0% | Pending +SHC_3BB0A8C1_0x00402AB0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00402AE0 | 0.0% | Pending @@ -531,7 +531,7 @@ SHC_3BB0A8C1_0x004036F0 | 0.0% | Pending SHC_3BB0A8C1_0x00403790 | 0.0% | Pending -SHC_3BB0A8C1_0x004038A0 | 0.0% | Pending +SHC_3BB0A8C1_0x004038A0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004038B0 | 0.0% | Pending @@ -539,9 +539,9 @@ SHC_3BB0A8C1_0x00403900 | 0.0% | Pending SHC_3BB0A8C1_0x00403980 | 0.0% | Pending -SHC_3BB0A8C1_0x004039B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004039B0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004039F0 | 0.0% | Pending +SHC_3BB0A8C1_0x004039F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00403A20 | 0.0% | Pending @@ -2347,9 +2347,9 @@ SHC_3BB0A8C1_0x00406900 | 0.0% | Pending SHC_3BB0A8C1_0x00406FD0 | 0.0% | Pending -SHC_3BB0A8C1_0x00407130 | 0.0% | Pending +SHC_3BB0A8C1_0x00407130 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00407160 | 0.0% | Pending +SHC_3BB0A8C1_0x00407160 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00407190 | 0.0% | Pending @@ -2597,11 +2597,11 @@ SHC_3BB0A8C1_0x00409200 | 0.0% | Pending SHC_3BB0A8C1_0x004092B0 | 0.0% | Pending -SHC_3BB0A8C1_0x004092C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004092C0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004092E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004092E0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00409300 | 0.0% | Pending +SHC_3BB0A8C1_0x00409300 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00409330 | 0.0% | Pending @@ -5543,15 +5543,15 @@ SHC_3BB0A8C1_0x00417B90 | 0.0% | Pending SHC_3BB0A8C1_0x00417FD0 | 0.0% | Pending -SHC_3BB0A8C1_0x004180E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004180E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00418100 | 0.0% | Pending -SHC_3BB0A8C1_0x004184A0 | 0.0% | Pending +SHC_3BB0A8C1_0x004184A0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004184D0 | 0.0% | Pending +SHC_3BB0A8C1_0x004184D0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00418500 | 0.0% | Pending +SHC_3BB0A8C1_0x00418500 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00418530 | 0.0% | Pending @@ -5559,9 +5559,9 @@ SHC_3BB0A8C1_0x00418640 | 0.0% | Pending SHC_3BB0A8C1_0x00418740 | 0.0% | Pending -SHC_3BB0A8C1_0x00418880 | 0.0% | Pending +SHC_3BB0A8C1_0x00418880 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004188C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004188C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00418900 | 0.0% | Pending @@ -5575,7 +5575,7 @@ SHC_3BB0A8C1_0x00418C80 | 0.0% | Pending SHC_3BB0A8C1_0x00418EC0 | 0.0% | Pending -SHC_3BB0A8C1_0x00418F70 | 0.0% | Pending +SHC_3BB0A8C1_0x00418F70 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00418F90 | 0.0% | Pending @@ -5585,7 +5585,7 @@ SHC_3BB0A8C1_0x00419190 | 0.0% | Pending SHC_3BB0A8C1_0x00419290 | 0.0% | Pending -SHC_3BB0A8C1_0x00419340 | 0.0% | Pending +SHC_3BB0A8C1_0x00419340 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00419370 | 0.0% | Pending @@ -5817,13 +5817,13 @@ SHC_3BB0A8C1_0x00419EB0 | 0.0% | Pending SHC_3BB0A8C1_0x00419FA0 | 0.0% | Pending -SHC_3BB0A8C1_0x0041A060 | 0.0% | Pending +SHC_3BB0A8C1_0x0041A060 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0041A0A0 | 0.0% | Pending +SHC_3BB0A8C1_0x0041A0A0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0041A0B0 | 0.0% | Pending -SHC_3BB0A8C1_0x0041A0D0 | 0.0% | Pending +SHC_3BB0A8C1_0x0041A0D0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0041A100 | 0.0% | Pending @@ -6043,17 +6043,17 @@ SHC_3BB0A8C1_0x0041A2AE | 0.0% | Pending SHC_3BB0A8C1_0x0041A2AF | 0.0% | Pending -SHC_3BB0A8C1_0x0041A2B0 | 0.0% | Pending +SHC_3BB0A8C1_0x0041A2B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0041A2E0 | 0.0% | Pending SHC_3BB0A8C1_0x0041A340 | 0.0% | Pending -SHC_3BB0A8C1_0x0041A390 | 0.0% | Pending +SHC_3BB0A8C1_0x0041A390 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0041A3C0 | 0.0% | Pending +SHC_3BB0A8C1_0x0041A3C0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0041A3F0 | 0.0% | Pending +SHC_3BB0A8C1_0x0041A3F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0041A420 | 0.0% | Pending @@ -6061,17 +6061,17 @@ SHC_3BB0A8C1_0x0041A460 | 0.0% | Pending SHC_3BB0A8C1_0x0041A520 | 0.0% | Pending -SHC_3BB0A8C1_0x0041A5C0 | 0.0% | Pending +SHC_3BB0A8C1_0x0041A5C0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0041A5F0 | 0.0% | Pending +SHC_3BB0A8C1_0x0041A5F0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0041A620 | 0.0% | Pending +SHC_3BB0A8C1_0x0041A620 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0041A650 | 0.0% | Pending SHC_3BB0A8C1_0x0041A680 | 0.0% | Pending -SHC_3BB0A8C1_0x0041A710 | 0.0% | Pending +SHC_3BB0A8C1_0x0041A710 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0041A740 | 100.0% | Reimplemented @@ -6657,13 +6657,13 @@ SHC_3BB0A8C1_0x00424680 | 0.0% | Pending SHC_3BB0A8C1_0x004246B0 | 0.0% | Pending -SHC_3BB0A8C1_0x004246E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004246E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424700 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424720 | 0.0% | Pending -SHC_3BB0A8C1_0x00424770 | 0.0% | Pending +SHC_3BB0A8C1_0x00424770 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004247A0 | 0.0% | Pending @@ -6675,7 +6675,7 @@ SHC_3BB0A8C1_0x00424AD0 | 0.0% | Pending SHC_3BB0A8C1_0x00424B10 | 0.0% | Pending -SHC_3BB0A8C1_0x00424BD0 | 0.0% | Pending +SHC_3BB0A8C1_0x00424BD0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424BE0 | 0.0% | Pending @@ -6769,7 +6769,7 @@ SHC_3BB0A8C1_0x00426570 | 0.0% | Pending SHC_3BB0A8C1_0x00426600 | 0.0% | Pending -SHC_3BB0A8C1_0x004266A0 | 0.0% | Pending +SHC_3BB0A8C1_0x004266A0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004266E0 | 0.0% | Pending @@ -6793,7 +6793,7 @@ SHC_3BB0A8C1_0x00426D30 | 0.0% | Pending SHC_3BB0A8C1_0x00426ED0 | 0.0% | Pending -SHC_3BB0A8C1_0x00426F80 | 0.0% | Pending +SHC_3BB0A8C1_0x00426F80 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00426FB0 | 0.0% | Pending @@ -6803,9 +6803,9 @@ SHC_3BB0A8C1_0x00427110 | 0.0% | Pending SHC_3BB0A8C1_0x00427180 | 0.0% | Pending -SHC_3BB0A8C1_0x004271E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004271E0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00427210 | 0.0% | Pending +SHC_3BB0A8C1_0x00427210 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00427240 | 0.0% | Pending @@ -6867,7 +6867,7 @@ SHC_3BB0A8C1_0x00428480 | 0.0% | Pending SHC_3BB0A8C1_0x00428590 | 0.0% | Pending -SHC_3BB0A8C1_0x004285C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004285C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004285F0 | 0.0% | Pending @@ -6891,7 +6891,7 @@ SHC_3BB0A8C1_0x00428A60 | 0.0% | Pending SHC_3BB0A8C1_0x00428AC0 | 0.0% | Pending -SHC_3BB0A8C1_0x00429630 | 0.0% | Pending +SHC_3BB0A8C1_0x00429630 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00429650 | 0.0% | Pending @@ -6973,9 +6973,9 @@ SHC_3BB0A8C1_0x0042AC34 | 0.0% | Pending SHC_3BB0A8C1_0x0042AC38 | 0.0% | Pending -SHC_3BB0A8C1_0x0042AC40 | 0.0% | Pending +SHC_3BB0A8C1_0x0042AC40 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0042AC60 | 0.0% | Pending +SHC_3BB0A8C1_0x0042AC60 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042AC70 | 0.0% | Pending @@ -7443,7 +7443,7 @@ SHC_3BB0A8C1_0x0042B960 | 0.0% | Pending SHC_3BB0A8C1_0x0042BA50 | 0.0% | Pending -SHC_3BB0A8C1_0x0042BB70 | 0.0% | Pending +SHC_3BB0A8C1_0x0042BB70 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042BB90 | 0.0% | Pending @@ -7453,7 +7453,7 @@ SHC_3BB0A8C1_0x0042BF00 | 0.0% | Pending SHC_3BB0A8C1_0x0042BFC0 | 0.0% | Pending -SHC_3BB0A8C1_0x0042C060 | 0.0% | Pending +SHC_3BB0A8C1_0x0042C060 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042C090 | 0.0% | Pending @@ -8719,7 +8719,7 @@ SHC_3BB0A8C1_0x0042EF78 | 0.0% | Pending SHC_3BB0A8C1_0x0042EF80 | 0.0% | Pending -SHC_3BB0A8C1_0x0042EFE0 | 0.0% | Pending +SHC_3BB0A8C1_0x0042EFE0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042F010 | 0.0% | Pending @@ -8741,7 +8741,7 @@ SHC_3BB0A8C1_0x0042F3BC | 0.0% | Pending SHC_3BB0A8C1_0x0042F3C0 | 0.0% | Pending -SHC_3BB0A8C1_0x0042F3D0 | 0.0% | Pending +SHC_3BB0A8C1_0x0042F3D0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042F3F0 | 0.0% | Pending @@ -9163,7 +9163,7 @@ SHC_3BB0A8C1_0x0042F940 | 0.0% | Pending SHC_3BB0A8C1_0x0042FA10 | 0.0% | Pending -SHC_3BB0A8C1_0x0042FAA0 | 0.0% | Pending +SHC_3BB0A8C1_0x0042FAA0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042FAC0 | 0.0% | Pending @@ -10535,7 +10535,7 @@ SHC_3BB0A8C1_0x00430BF0 | 0.0% | Pending SHC_3BB0A8C1_0x00430CB8 | 0.0% | Pending -SHC_3BB0A8C1_0x00430CC0 | 0.0% | Pending +SHC_3BB0A8C1_0x00430CC0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00430CE0 | 0.0% | Pending @@ -11083,9 +11083,9 @@ SHC_3BB0A8C1_0x00431B60 | 0.0% | Pending SHC_3BB0A8C1_0x00433030 | 0.0% | Pending -SHC_3BB0A8C1_0x00433200 | 0.0% | Pending +SHC_3BB0A8C1_0x00433200 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00433230 | 0.0% | Pending +SHC_3BB0A8C1_0x00433230 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00433260 | 0.0% | Pending @@ -11099,7 +11099,7 @@ SHC_3BB0A8C1_0x00433558 | 0.0% | Pending SHC_3BB0A8C1_0x0043355C | 0.0% | Pending -SHC_3BB0A8C1_0x00433560 | 0.0% | Pending +SHC_3BB0A8C1_0x00433560 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004335A0 | 0.0% | Pending @@ -11135,9 +11135,9 @@ SHC_3BB0A8C1_0x00434224 | 0.0% | Pending SHC_3BB0A8C1_0x00434228 | 0.0% | Pending -SHC_3BB0A8C1_0x00434230 | 0.0% | Pending +SHC_3BB0A8C1_0x00434230 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00434260 | 0.0% | Pending +SHC_3BB0A8C1_0x00434260 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00434270 | 0.0% | Pending @@ -13357,7 +13357,7 @@ SHC_3BB0A8C1_0x0043937C | 0.0% | Pending SHC_3BB0A8C1_0x00439380 | 0.0% | Pending -SHC_3BB0A8C1_0x00439390 | 0.0% | Pending +SHC_3BB0A8C1_0x00439390 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004393C0 | 0.0% | Pending @@ -13389,19 +13389,19 @@ SHC_3BB0A8C1_0x00439724 | 0.0% | Pending SHC_3BB0A8C1_0x00439730 | 0.0% | Pending -SHC_3BB0A8C1_0x00439890 | 0.0% | Pending +SHC_3BB0A8C1_0x00439890 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004398B0 | 0.0% | Pending -SHC_3BB0A8C1_0x0043A850 | 0.0% | Pending +SHC_3BB0A8C1_0x0043A850 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0043A860 | 0.0% | Pending +SHC_3BB0A8C1_0x0043A860 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0043A880 | 0.0% | Pending +SHC_3BB0A8C1_0x0043A880 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0043A8C0 | 0.0% | Pending +SHC_3BB0A8C1_0x0043A8C0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0043A8D0 | 0.0% | Pending +SHC_3BB0A8C1_0x0043A8D0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0043A8E0 | 0.0% | Pending @@ -13595,9 +13595,9 @@ SHC_3BB0A8C1_0x0043E5F0 | 0.0% | Pending SHC_3BB0A8C1_0x0043E6C0 | 0.0% | Pending -SHC_3BB0A8C1_0x0043F2B0 | 0.0% | Pending +SHC_3BB0A8C1_0x0043F2B0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0043F2C0 | 0.0% | Pending +SHC_3BB0A8C1_0x0043F2C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0043F2F0 | 0.0% | Pending @@ -13611,9 +13611,9 @@ SHC_3BB0A8C1_0x0043FBB0 | 0.0% | Pending SHC_3BB0A8C1_0x0043FBF0 | 0.0% | Pending -SHC_3BB0A8C1_0x0043FC80 | 0.0% | Pending +SHC_3BB0A8C1_0x0043FC80 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0043FCA0 | 0.0% | Pending +SHC_3BB0A8C1_0x0043FCA0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0043FCB0 | 0.0% | Pending @@ -13631,13 +13631,13 @@ SHC_3BB0A8C1_0x00440280 | 0.0% | Pending SHC_3BB0A8C1_0x00440360 | 0.0% | Pending -SHC_3BB0A8C1_0x004403D0 | 0.0% | Pending +SHC_3BB0A8C1_0x004403D0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00440400 | 0.0% | Pending +SHC_3BB0A8C1_0x00440400 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00440410 | 0.0% | Pending +SHC_3BB0A8C1_0x00440410 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00440420 | 0.0% | Pending +SHC_3BB0A8C1_0x00440420 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00440430 | 0.0% | Pending @@ -16649,11 +16649,11 @@ SHC_3BB0A8C1_0x0044A720 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0044A830 | 0.0% | Pending -SHC_3BB0A8C1_0x0044AA70 | 0.0% | Pending +SHC_3BB0A8C1_0x0044AA70 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0044AA80 | 0.0% | Pending +SHC_3BB0A8C1_0x0044AA80 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0044AAA0 | 0.0% | Pending +SHC_3BB0A8C1_0x0044AAA0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0044AAB0 | 100.0% | Reimplemented @@ -16867,7 +16867,7 @@ SHC_3BB0A8C1_0x0044B680 | 0.0% | Pending SHC_3BB0A8C1_0x0044B760 | 0.0% | Pending -SHC_3BB0A8C1_0x0044B7D0 | 0.0% | Pending +SHC_3BB0A8C1_0x0044B7D0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0044B800 | 0.0% | Pending @@ -16915,17 +16915,17 @@ SHC_3BB0A8C1_0x0044CBE0 | 0.0% | Pending SHC_3BB0A8C1_0x0044CC30 | 0.0% | Pending -SHC_3BB0A8C1_0x0044CCA0 | 0.0% | Pending +SHC_3BB0A8C1_0x0044CCA0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0044CCC0 | 0.0% | Pending +SHC_3BB0A8C1_0x0044CCC0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0044CCD0 | 0.0% | Pending +SHC_3BB0A8C1_0x0044CCD0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0044CCF0 | 0.0% | Pending +SHC_3BB0A8C1_0x0044CCF0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0044CD10 | 0.0% | Pending +SHC_3BB0A8C1_0x0044CD10 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0044CD30 | 0.0% | Pending +SHC_3BB0A8C1_0x0044CD30 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0044CD40 | 0.0% | Pending @@ -16979,15 +16979,15 @@ SHC_3BB0A8C1_0x00454700 | 0.0% | Pending SHC_3BB0A8C1_0x004547C0 | 0.0% | Pending -SHC_3BB0A8C1_0x004548D0 | 0.0% | Pending +SHC_3BB0A8C1_0x004548D0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00454900 | 0.0% | Pending -SHC_3BB0A8C1_0x00454960 | 0.0% | Pending +SHC_3BB0A8C1_0x00454960 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00454990 | 0.0% | Pending +SHC_3BB0A8C1_0x00454990 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004549C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004549C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004549F0 | 0.0% | Pending @@ -16999,21 +16999,21 @@ SHC_3BB0A8C1_0x00454CE0 | 0.0% | Pending SHC_3BB0A8C1_0x00454D20 | 0.0% | Pending -SHC_3BB0A8C1_0x00454EE0 | 0.0% | Pending +SHC_3BB0A8C1_0x00454EE0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00454EF0 | 0.0% | Pending +SHC_3BB0A8C1_0x00454EF0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00454F00 | 0.0% | Pending SHC_3BB0A8C1_0x00455050 | 0.0% | Pending -SHC_3BB0A8C1_0x00455250 | 0.0% | Pending +SHC_3BB0A8C1_0x00455250 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00455270 | 0.0% | Pending +SHC_3BB0A8C1_0x00455270 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00455290 | 0.0% | Pending -SHC_3BB0A8C1_0x004552E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004552E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00455300 | 0.0% | Pending @@ -17045,7 +17045,7 @@ SHC_3BB0A8C1_0x00455E40 | 0.0% | Pending SHC_3BB0A8C1_0x004560F0 | 0.0% | Pending -SHC_3BB0A8C1_0x004563B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004563B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004563D0 | 0.0% | Pending @@ -17669,7 +17669,7 @@ SHC_3BB0A8C1_0x00457A70 | 0.0% | Pending SHC_3BB0A8C1_0x00457AD0 | 0.0% | Pending -SHC_3BB0A8C1_0x00457B40 | 0.0% | Pending +SHC_3BB0A8C1_0x00457B40 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00457B80 | 0.0% | Pending @@ -17693,15 +17693,15 @@ SHC_3BB0A8C1_0x004585B0 | 0.0% | Pending SHC_3BB0A8C1_0x004585F0 | 0.0% | Pending -SHC_3BB0A8C1_0x004586D0 | 0.0% | Pending +SHC_3BB0A8C1_0x004586D0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004586F0 | 0.0% | Pending -SHC_3BB0A8C1_0x00458700 | 0.0% | Pending +SHC_3BB0A8C1_0x00458700 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00458720 | 0.0% | Pending -SHC_3BB0A8C1_0x00458740 | 0.0% | Pending +SHC_3BB0A8C1_0x00458740 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00458760 | 0.0% | Pending @@ -17713,13 +17713,13 @@ SHC_3BB0A8C1_0x00458820 | 0.0% | Pending SHC_3BB0A8C1_0x00458840 | 0.0% | Pending -SHC_3BB0A8C1_0x00458890 | 0.0% | Pending +SHC_3BB0A8C1_0x00458890 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004588A0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004588D0 | 0.0% | Pending +SHC_3BB0A8C1_0x004588D0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004588F0 | 0.0% | Pending +SHC_3BB0A8C1_0x004588F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00458910 | 100.0% | Reimplemented @@ -17757,11 +17757,11 @@ SHC_3BB0A8C1_0x00458F70 | 0.0% | Pending SHC_3BB0A8C1_0x00459080 | 0.0% | Pending -SHC_3BB0A8C1_0x00459140 | 0.0% | Pending +SHC_3BB0A8C1_0x00459140 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00459170 | 0.0% | Pending +SHC_3BB0A8C1_0x00459170 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004591B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004591B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004591F0 | 0.0% | Pending @@ -17889,7 +17889,7 @@ SHC_3BB0A8C1_0x004595D0 | 0.0% | Pending SHC_3BB0A8C1_0x00459640 | 0.0% | Pending -SHC_3BB0A8C1_0x004596D0 | 0.0% | Pending +SHC_3BB0A8C1_0x004596D0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00459700 | 0.0% | Pending @@ -17907,9 +17907,9 @@ SHC_3BB0A8C1_0x00459A40 | 0.0% | Pending SHC_3BB0A8C1_0x00459B50 | 0.0% | Pending -SHC_3BB0A8C1_0x00459BB0 | 0.0% | Pending +SHC_3BB0A8C1_0x00459BB0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00459BE0 | 0.0% | Pending +SHC_3BB0A8C1_0x00459BE0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00459BF0 | 0.0% | Pending @@ -18025,7 +18025,7 @@ SHC_3BB0A8C1_0x0045AE70 | 0.0% | Pending SHC_3BB0A8C1_0x0045AEB0 | 0.0% | Pending -SHC_3BB0A8C1_0x0045AF00 | 0.0% | Pending +SHC_3BB0A8C1_0x0045AF00 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0045AF30 | 0.0% | Pending @@ -18035,13 +18035,13 @@ SHC_3BB0A8C1_0x0045B3A0 | 0.0% | Pending SHC_3BB0A8C1_0x0045B3E0 | 0.0% | Pending -SHC_3BB0A8C1_0x0045B460 | 0.0% | Pending +SHC_3BB0A8C1_0x0045B460 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0045B4A0 | 0.0% | Pending SHC_3BB0A8C1_0x0045B6B0 | 0.0% | Pending -SHC_3BB0A8C1_0x0045B7F0 | 0.0% | Pending +SHC_3BB0A8C1_0x0045B7F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0045B830 | 0.0% | Pending @@ -18145,11 +18145,11 @@ SHC_3BB0A8C1_0x0045CA20 | 0.0% | Pending SHC_3BB0A8C1_0x0045CD10 | 0.0% | Pending -SHC_3BB0A8C1_0x0045D060 | 0.0% | Pending +SHC_3BB0A8C1_0x0045D060 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0045D080 | 0.0% | Pending -SHC_3BB0A8C1_0x0045D0B0 | 0.0% | Pending +SHC_3BB0A8C1_0x0045D0B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0045D0C0 | 0.0% | Pending @@ -18747,7 +18747,7 @@ SHC_3BB0A8C1_0x0045F0CD | 0.0% | Pending SHC_3BB0A8C1_0x0045F0D0 | 0.0% | Pending -SHC_3BB0A8C1_0x0045F120 | 0.0% | Pending +SHC_3BB0A8C1_0x0045F120 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0045F130 | 0.0% | Pending @@ -19153,7 +19153,7 @@ SHC_3BB0A8C1_0x00462FE0 | 0.0% | Pending SHC_3BB0A8C1_0x00462FF0 | 0.0% | Pending -SHC_3BB0A8C1_0x004630B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004630B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004630D0 | 0.0% | Pending @@ -19843,11 +19843,11 @@ SHC_3BB0A8C1_0x00464856 | 0.0% | Pending SHC_3BB0A8C1_0x00464860 | 0.0% | Pending -SHC_3BB0A8C1_0x004649C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004649C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004649D0 | 0.0% | Pending -SHC_3BB0A8C1_0x00464D90 | 0.0% | Pending +SHC_3BB0A8C1_0x00464D90 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00464DA0 | 0.0% | Pending @@ -19857,19 +19857,19 @@ SHC_3BB0A8C1_0x00464EF0 | 0.0% | Pending SHC_3BB0A8C1_0x00465040 | 0.0% | Pending -SHC_3BB0A8C1_0x00465080 | 0.0% | Pending +SHC_3BB0A8C1_0x00465080 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004650A0 | 0.0% | Pending +SHC_3BB0A8C1_0x004650A0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004650C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004650C0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004650F0 | 0.0% | Pending +SHC_3BB0A8C1_0x004650F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00465110 | 0.0% | Pending SHC_3BB0A8C1_0x00465200 | 0.0% | Pending -SHC_3BB0A8C1_0x004652A0 | 0.0% | Pending +SHC_3BB0A8C1_0x004652A0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004652D0 | 0.0% | Pending @@ -19905,15 +19905,15 @@ SHC_3BB0A8C1_0x00465700 | 0.0% | Pending SHC_3BB0A8C1_0x004657B0 | 0.0% | Pending -SHC_3BB0A8C1_0x00465800 | 0.0% | Pending +SHC_3BB0A8C1_0x00465800 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00465820 | 0.0% | Pending -SHC_3BB0A8C1_0x00465890 | 0.0% | Pending +SHC_3BB0A8C1_0x00465890 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004658B0 | 0.0% | Pending -SHC_3BB0A8C1_0x00465920 | 0.0% | Pending +SHC_3BB0A8C1_0x00465920 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00465950 | 0.0% | Pending @@ -19929,7 +19929,7 @@ SHC_3BB0A8C1_0x00465F20 | 0.0% | Pending SHC_3BB0A8C1_0x00465F90 | 0.0% | Pending -SHC_3BB0A8C1_0x004660B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004660B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004660F0 | 0.0% | Pending @@ -19945,7 +19945,7 @@ SHC_3BB0A8C1_0x00466480 | 0.0% | Pending SHC_3BB0A8C1_0x00466620 | 0.0% | Pending -SHC_3BB0A8C1_0x00466710 | 0.0% | Pending +SHC_3BB0A8C1_0x00466710 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00466730 | 0.0% | Pending @@ -19975,9 +19975,9 @@ SHC_3BB0A8C1_0x004668E0 | 0.0% | Pending SHC_3BB0A8C1_0x004668E4 | 0.0% | Pending -SHC_3BB0A8C1_0x004668F0 | 0.0% | Pending +SHC_3BB0A8C1_0x004668F0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00466920 | 0.0% | Pending +SHC_3BB0A8C1_0x00466920 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00466950 | 0.0% | Pending @@ -19987,9 +19987,9 @@ SHC_3BB0A8C1_0x00466C20 | 0.0% | Pending SHC_3BB0A8C1_0x00466D10 | 0.0% | Pending -SHC_3BB0A8C1_0x00466E00 | 0.0% | Pending +SHC_3BB0A8C1_0x00466E00 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00466E10 | 0.0% | Pending +SHC_3BB0A8C1_0x00466E10 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00466E20 | 0.0% | Pending @@ -20051,7 +20051,7 @@ SHC_3BB0A8C1_0x00467E04 | 0.0% | Pending SHC_3BB0A8C1_0x00467E26 | 0.0% | Pending -SHC_3BB0A8C1_0x00467E40 | 0.0% | Pending +SHC_3BB0A8C1_0x00467E40 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00467E50 | 0.0% | Pending @@ -20059,7 +20059,7 @@ SHC_3BB0A8C1_0x00467EC0 | 0.0% | Pending SHC_3BB0A8C1_0x00467F50 | 0.0% | Pending -SHC_3BB0A8C1_0x00467F60 | 0.0% | Pending +SHC_3BB0A8C1_0x00467F60 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00467F80 | 0.0% | Pending @@ -20097,7 +20097,7 @@ SHC_3BB0A8C1_0x00468C30 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00468C40 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00468C50 | 0.0% | Pending +SHC_3BB0A8C1_0x00468C50 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00468C80 | 0.0% | Pending @@ -20743,11 +20743,11 @@ SHC_3BB0A8C1_0x0046B1B0 | 0.0% | Pending SHC_3BB0A8C1_0x0046B1F0 | 0.0% | Pending -SHC_3BB0A8C1_0x0046B2F0 | 0.0% | Pending +SHC_3BB0A8C1_0x0046B2F0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0046B300 | 0.0% | Pending +SHC_3BB0A8C1_0x0046B300 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0046B320 | 0.0% | Pending +SHC_3BB0A8C1_0x0046B320 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0046B340 | 0.0% | Pending @@ -20893,7 +20893,7 @@ SHC_3BB0A8C1_0x0046BBD0 | 0.0% | Pending SHC_3BB0A8C1_0x0046BC90 | 0.0% | Pending -SHC_3BB0A8C1_0x0046BD20 | 0.0% | Pending +SHC_3BB0A8C1_0x0046BD20 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0046BD50 | 0.0% | Pending @@ -20969,9 +20969,9 @@ SHC_3BB0A8C1_0x0046CEB0 | 0.0% | Pending SHC_3BB0A8C1_0x0046CEC0 | 0.0% | Pending -SHC_3BB0A8C1_0x0046CED0 | 0.0% | Pending +SHC_3BB0A8C1_0x0046CED0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0046CEF0 | 0.0% | Pending +SHC_3BB0A8C1_0x0046CEF0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0046CF10 | 0.0% | Pending @@ -21201,7 +21201,7 @@ SHC_3BB0A8C1_0x0046F690 | 0.0% | Pending SHC_3BB0A8C1_0x0046F6B0 | 0.0% | Pending -SHC_3BB0A8C1_0x0046F730 | 0.0% | Pending +SHC_3BB0A8C1_0x0046F730 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0046F750 | 0.0% | Pending @@ -21327,11 +21327,11 @@ SHC_3BB0A8C1_0x004718C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004718F0 | 0.0% | Pending -SHC_3BB0A8C1_0x004719E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004719E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00471A00 | 0.0% | Pending -SHC_3BB0A8C1_0x00471A80 | 0.0% | Pending +SHC_3BB0A8C1_0x00471A80 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00471AA0 | 0.0% | Pending @@ -22307,7 +22307,7 @@ SHC_3BB0A8C1_0x0047D0D8 | 0.0% | Pending SHC_3BB0A8C1_0x0047D0DC | 0.0% | Pending -SHC_3BB0A8C1_0x0047D0E0 | 0.0% | Pending +SHC_3BB0A8C1_0x0047D0E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0047D100 | 0.0% | Pending @@ -22327,7 +22327,7 @@ SHC_3BB0A8C1_0x0047D3DC | 0.0% | Pending SHC_3BB0A8C1_0x0047D3E0 | 0.0% | Pending -SHC_3BB0A8C1_0x0047D3F0 | 0.0% | Pending +SHC_3BB0A8C1_0x0047D3F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0047D410 | 0.0% | Pending @@ -22373,9 +22373,9 @@ SHC_3BB0A8C1_0x0047E5B0 | 0.0% | Pending SHC_3BB0A8C1_0x0047E5D0 | 0.0% | Pending -SHC_3BB0A8C1_0x0047E7E0 | 0.0% | Pending +SHC_3BB0A8C1_0x0047E7E0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0047E800 | 0.0% | Pending +SHC_3BB0A8C1_0x0047E800 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0047E830 | 0.0% | Pending @@ -22393,7 +22393,7 @@ SHC_3BB0A8C1_0x0047EC10 | 0.0% | Pending SHC_3BB0A8C1_0x0047EDE0 | 0.0% | Pending -SHC_3BB0A8C1_0x0047EEB0 | 0.0% | Pending +SHC_3BB0A8C1_0x0047EEB0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0047EED0 | 0.0% | Pending @@ -22411,13 +22411,13 @@ SHC_3BB0A8C1_0x0047FD50 | 0.0% | Pending SHC_3BB0A8C1_0x0047FEA0 | 0.0% | Pending -SHC_3BB0A8C1_0x0047FFA0 | 0.0% | Pending +SHC_3BB0A8C1_0x0047FFA0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0047FFE0 | 0.0% | Pending SHC_3BB0A8C1_0x00480050 | 0.0% | Pending -SHC_3BB0A8C1_0x004800B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004800B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004800E0 | 0.0% | Pending @@ -22425,7 +22425,7 @@ SHC_3BB0A8C1_0x00480210 | 0.0% | Pending SHC_3BB0A8C1_0x00480440 | 0.0% | Pending -SHC_3BB0A8C1_0x00480570 | 0.0% | Pending +SHC_3BB0A8C1_0x00480570 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00480580 | 0.0% | Pending @@ -22547,7 +22547,7 @@ SHC_3BB0A8C1_0x004821D5 | 0.0% | Pending SHC_3BB0A8C1_0x004821E0 | 0.0% | Pending -SHC_3BB0A8C1_0x00482280 | 0.0% | Pending +SHC_3BB0A8C1_0x00482280 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00482290 | 0.0% | Pending @@ -23167,7 +23167,7 @@ SHC_3BB0A8C1_0x0048BD40 | 0.0% | Pending SHC_3BB0A8C1_0x0048BD80 | 0.0% | Pending -SHC_3BB0A8C1_0x0048BF70 | 0.0% | Pending +SHC_3BB0A8C1_0x0048BF70 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0048BF80 | 0.0% | Pending @@ -23357,7 +23357,7 @@ SHC_3BB0A8C1_0x0048F841 | 0.0% | Pending SHC_3BB0A8C1_0x0048F842 | 0.0% | Pending -SHC_3BB0A8C1_0x0048F850 | 0.0% | Pending +SHC_3BB0A8C1_0x0048F850 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0048F870 | 0.0% | Pending @@ -23373,7 +23373,7 @@ SHC_3BB0A8C1_0x00490060 | 0.0% | Pending SHC_3BB0A8C1_0x00490080 | 0.0% | Pending -SHC_3BB0A8C1_0x00490340 | 0.0% | Pending +SHC_3BB0A8C1_0x00490340 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00490380 | 0.0% | Pending @@ -23407,13 +23407,13 @@ SHC_3BB0A8C1_0x00491680 | 0.0% | Pending SHC_3BB0A8C1_0x004916C0 | 0.0% | Pending -SHC_3BB0A8C1_0x00491730 | 0.0% | Pending +SHC_3BB0A8C1_0x00491730 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00491750 | 0.0% | Pending SHC_3BB0A8C1_0x004917C0 | 0.0% | Pending -SHC_3BB0A8C1_0x00491810 | 0.0% | Pending +SHC_3BB0A8C1_0x00491810 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00491840 | 0.0% | Pending @@ -23421,9 +23421,9 @@ SHC_3BB0A8C1_0x00491A30 | 0.0% | Pending SHC_3BB0A8C1_0x00491AC0 | 0.0% | Pending -SHC_3BB0A8C1_0x00491BF0 | 0.0% | Pending +SHC_3BB0A8C1_0x00491BF0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00491C20 | 0.0% | Pending +SHC_3BB0A8C1_0x00491C20 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00491C50 | 0.0% | Pending @@ -23431,7 +23431,7 @@ SHC_3BB0A8C1_0x00491CE0 | 0.0% | Pending SHC_3BB0A8C1_0x00491D70 | 0.0% | Pending -SHC_3BB0A8C1_0x00491E80 | 0.0% | Pending +SHC_3BB0A8C1_0x00491E80 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00491EB0 | 0.0% | Pending @@ -23485,7 +23485,7 @@ SHC_3BB0A8C1_0x00492654 | 0.0% | Pending SHC_3BB0A8C1_0x00492658 | 0.0% | Pending -SHC_3BB0A8C1_0x00492660 | 0.0% | Pending +SHC_3BB0A8C1_0x00492660 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00492690 | 0.0% | Pending @@ -23501,7 +23501,7 @@ SHC_3BB0A8C1_0x004929BC | 0.0% | Pending SHC_3BB0A8C1_0x004929C0 | 0.0% | Pending -SHC_3BB0A8C1_0x00492A60 | 0.0% | Pending +SHC_3BB0A8C1_0x00492A60 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00492A90 | 0.0% | Pending @@ -23521,7 +23521,7 @@ SHC_3BB0A8C1_0x00492C58 | 0.0% | Pending SHC_3BB0A8C1_0x00492C5C | 0.0% | Pending -SHC_3BB0A8C1_0x00492C60 | 0.0% | Pending +SHC_3BB0A8C1_0x00492C60 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00492C90 | 0.0% | Pending @@ -23629,7 +23629,7 @@ SHC_3BB0A8C1_0x00493690 | 0.0% | Pending SHC_3BB0A8C1_0x004937A4 | 0.0% | Pending -SHC_3BB0A8C1_0x004937B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004937B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004937E0 | 0.0% | Pending @@ -24041,7 +24041,7 @@ SHC_3BB0A8C1_0x004941E7 | 0.0% | Pending SHC_3BB0A8C1_0x004941E8 | 0.0% | Pending -SHC_3BB0A8C1_0x004941F0 | 0.0% | Pending +SHC_3BB0A8C1_0x004941F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00494210 | 0.0% | Pending @@ -24111,7 +24111,7 @@ SHC_3BB0A8C1_0x004948BF | 0.0% | Pending SHC_3BB0A8C1_0x004948C0 | 0.0% | Pending -SHC_3BB0A8C1_0x00494920 | 0.0% | Pending +SHC_3BB0A8C1_0x00494920 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00494950 | 0.0% | Pending @@ -24213,9 +24213,9 @@ SHC_3BB0A8C1_0x00495230 | 0.0% | Pending SHC_3BB0A8C1_0x004954A0 | 0.0% | Pending -SHC_3BB0A8C1_0x00495800 | 0.0% | Pending +SHC_3BB0A8C1_0x00495800 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00495840 | 0.0% | Pending +SHC_3BB0A8C1_0x00495840 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00495860 | 0.0% | Pending @@ -24343,13 +24343,13 @@ SHC_3BB0A8C1_0x00496E19 | 0.0% | Pending SHC_3BB0A8C1_0x00496E1A | 0.0% | Pending -SHC_3BB0A8C1_0x00496E20 | 0.0% | Pending +SHC_3BB0A8C1_0x00496E20 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00496E30 | 0.0% | Pending +SHC_3BB0A8C1_0x00496E30 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00496E40 | 0.0% | Pending -SHC_3BB0A8C1_0x00496EA0 | 0.0% | Pending +SHC_3BB0A8C1_0x00496EA0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00496EC0 | 0.0% | Pending @@ -24417,7 +24417,7 @@ SHC_3BB0A8C1_0x0049AF50 | 0.0% | Pending SHC_3BB0A8C1_0x0049B000 | 0.0% | Pending -SHC_3BB0A8C1_0x0049B1C0 | 0.0% | Pending +SHC_3BB0A8C1_0x0049B1C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0049B1D0 | 0.0% | Pending @@ -25233,7 +25233,7 @@ SHC_3BB0A8C1_0x004A4930 | 0.0% | Pending SHC_3BB0A8C1_0x004A4B30 | 0.0% | Pending -SHC_3BB0A8C1_0x004A4B80 | 0.0% | Pending +SHC_3BB0A8C1_0x004A4B80 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004A4BB0 | 0.0% | Pending @@ -25267,7 +25267,7 @@ SHC_3BB0A8C1_0x004A5B00 | 0.0% | Pending SHC_3BB0A8C1_0x004A5DA0 | 0.0% | Pending -SHC_3BB0A8C1_0x004A5F60 | 0.0% | Pending +SHC_3BB0A8C1_0x004A5F60 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004A5F90 | 0.0% | Pending @@ -25455,7 +25455,7 @@ SHC_3BB0A8C1_0x004A91F7 | 0.0% | Pending SHC_3BB0A8C1_0x004A9200 | 0.0% | Pending -SHC_3BB0A8C1_0x004A94E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004A94E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004A9510 | 0.0% | Pending @@ -25471,17 +25471,17 @@ SHC_3BB0A8C1_0x004A98C0 | 0.0% | Pending SHC_3BB0A8C1_0x004A9B20 | 0.0% | Pending -SHC_3BB0A8C1_0x004A9DD0 | 0.0% | Pending +SHC_3BB0A8C1_0x004A9DD0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004A9E00 | 0.0% | Pending SHC_3BB0A8C1_0x004A9E60 | 0.0% | Pending -SHC_3BB0A8C1_0x004A9E80 | 0.0% | Pending +SHC_3BB0A8C1_0x004A9E80 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004A9E90 | 0.0% | Pending -SHC_3BB0A8C1_0x004A9EB0 | 0.0% | Pending +SHC_3BB0A8C1_0x004A9EB0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004A9ED0 | 0.0% | Pending @@ -25519,37 +25519,37 @@ SHC_3BB0A8C1_0x004AA930 | 0.0% | Pending SHC_3BB0A8C1_0x004AA970 | 0.0% | Pending -SHC_3BB0A8C1_0x004AAA40 | 0.0% | Pending +SHC_3BB0A8C1_0x004AAA40 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AAA60 | 0.0% | Pending +SHC_3BB0A8C1_0x004AAA60 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AAA80 | 0.0% | Pending +SHC_3BB0A8C1_0x004AAA80 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AAAA0 | 0.0% | Pending +SHC_3BB0A8C1_0x004AAAA0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AAAC0 | 0.0% | Pending +SHC_3BB0A8C1_0x004AAAC0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AAAE0 | 0.0% | Pending +SHC_3BB0A8C1_0x004AAAE0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AAB00 | 0.0% | Pending +SHC_3BB0A8C1_0x004AAB00 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AAB20 | 0.0% | Pending +SHC_3BB0A8C1_0x004AAB20 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AAB40 | 0.0% | Pending +SHC_3BB0A8C1_0x004AAB40 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AAB50 | 0.0% | Pending -SHC_3BB0A8C1_0x004AB440 | 0.0% | Pending +SHC_3BB0A8C1_0x004AB440 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AB460 | 0.0% | Pending -SHC_3BB0A8C1_0x004AB4B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004AB4B0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AB4E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004AB4E0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AB510 | 0.0% | Pending +SHC_3BB0A8C1_0x004AB510 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AB540 | 0.0% | Pending +SHC_3BB0A8C1_0x004AB540 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AB570 | 0.0% | Pending @@ -25619,17 +25619,17 @@ SHC_3BB0A8C1_0x004ABB91 | 0.0% | Pending SHC_3BB0A8C1_0x004ABBA0 | 0.0% | Pending -SHC_3BB0A8C1_0x004ABCB0 | 0.0% | Pending +SHC_3BB0A8C1_0x004ABCB0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004ABCE0 | 0.0% | Pending +SHC_3BB0A8C1_0x004ABCE0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004ABD10 | 0.0% | Pending +SHC_3BB0A8C1_0x004ABD10 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004ABD20 | 0.0% | Pending -SHC_3BB0A8C1_0x004ABE50 | 0.0% | Pending +SHC_3BB0A8C1_0x004ABE50 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004ABE80 | 0.0% | Pending +SHC_3BB0A8C1_0x004ABE80 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004ABEB0 | 0.0% | Pending @@ -25779,7 +25779,7 @@ SHC_3BB0A8C1_0x004AC24E | 0.0% | Pending SHC_3BB0A8C1_0x004AC24F | 0.0% | Pending -SHC_3BB0A8C1_0x004AC250 | 0.0% | Pending +SHC_3BB0A8C1_0x004AC250 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AC280 | 0.0% | Pending @@ -25903,31 +25903,31 @@ SHC_3BB0A8C1_0x004AF4C0 | 0.0% | Pending SHC_3BB0A8C1_0x004AF5E0 | 0.0% | Pending -SHC_3BB0A8C1_0x004AF630 | 0.0% | Pending +SHC_3BB0A8C1_0x004AF630 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AF650 | 0.0% | Pending +SHC_3BB0A8C1_0x004AF650 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AF680 | 0.0% | Pending +SHC_3BB0A8C1_0x004AF680 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AF6B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004AF6B0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AF6E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004AF6E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AF700 | 0.0% | Pending -SHC_3BB0A8C1_0x004AF800 | 0.0% | Pending +SHC_3BB0A8C1_0x004AF800 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AF820 | 0.0% | Pending +SHC_3BB0A8C1_0x004AF820 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004AF840 | 0.0% | Pending +SHC_3BB0A8C1_0x004AF840 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AF860 | 0.0% | Pending -SHC_3BB0A8C1_0x004AFA50 | 0.0% | Pending +SHC_3BB0A8C1_0x004AFA50 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AFA80 | 0.0% | Pending -SHC_3BB0A8C1_0x004AFB00 | 0.0% | Pending +SHC_3BB0A8C1_0x004AFB00 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AFB30 | 0.0% | Pending @@ -25967,7 +25967,7 @@ SHC_3BB0A8C1_0x004B0F70 | 0.0% | Pending SHC_3BB0A8C1_0x004B1000 | 0.0% | Pending -SHC_3BB0A8C1_0x004B1090 | 0.0% | Pending +SHC_3BB0A8C1_0x004B1090 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B10D0 | 0.0% | Pending @@ -26001,7 +26001,7 @@ SHC_3BB0A8C1_0x004B1E60 | 0.0% | Pending SHC_3BB0A8C1_0x004B1EB0 | 0.0% | Pending -SHC_3BB0A8C1_0x004B20B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004B20B0 | 82.4% | shared arm fold direction SHC_3BB0A8C1_0x004B2280 | 0.0% | Pending @@ -26881,7 +26881,7 @@ SHC_3BB0A8C1_0x004B51A0 | 0.0% | Pending SHC_3BB0A8C1_0x004B5280 | 0.0% | Pending -SHC_3BB0A8C1_0x004B5300 | 0.0% | Pending +SHC_3BB0A8C1_0x004B5300 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B5330 | 0.0% | Pending @@ -26905,7 +26905,7 @@ SHC_3BB0A8C1_0x004B6480 | 0.0% | Pending SHC_3BB0A8C1_0x004B64D0 | 0.0% | Pending -SHC_3BB0A8C1_0x004B6500 | 0.0% | Pending +SHC_3BB0A8C1_0x004B6500 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B6530 | 0.0% | Pending @@ -26915,9 +26915,9 @@ SHC_3BB0A8C1_0x004B65A0 | 0.0% | Pending SHC_3BB0A8C1_0x004B65F0 | 0.0% | Pending -SHC_3BB0A8C1_0x004B6640 | 0.0% | Pending +SHC_3BB0A8C1_0x004B6640 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004B6680 | 0.0% | Pending +SHC_3BB0A8C1_0x004B6680 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B66C0 | 0.0% | Pending @@ -27071,17 +27071,17 @@ SHC_3BB0A8C1_0x004B7530 | 0.0% | Pending SHC_3BB0A8C1_0x004B7600 | 0.0% | Pending -SHC_3BB0A8C1_0x004B7700 | 0.0% | Pending +SHC_3BB0A8C1_0x004B7700 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B7730 | 0.0% | Pending SHC_3BB0A8C1_0x004B77A0 | 0.0% | Pending -SHC_3BB0A8C1_0x004B77E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004B77E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B7800 | 0.0% | Pending -SHC_3BB0A8C1_0x004B7890 | 0.0% | Pending +SHC_3BB0A8C1_0x004B7890 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B78D0 | 0.0% | Pending @@ -27097,19 +27097,19 @@ SHC_3BB0A8C1_0x004B7AF0 | 0.0% | Pending SHC_3BB0A8C1_0x004B7C90 | 0.0% | Pending -SHC_3BB0A8C1_0x004B7F60 | 0.0% | Pending +SHC_3BB0A8C1_0x004B7F60 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B7FA0 | 0.0% | Pending SHC_3BB0A8C1_0x004B8000 | 0.0% | Pending -SHC_3BB0A8C1_0x004B8050 | 0.0% | Pending +SHC_3BB0A8C1_0x004B8050 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B8080 | 0.0% | Pending -SHC_3BB0A8C1_0x004B8200 | 0.0% | Pending +SHC_3BB0A8C1_0x004B8200 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004B8210 | 0.0% | Pending +SHC_3BB0A8C1_0x004B8210 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B8220 | 0.0% | Pending @@ -27639,7 +27639,7 @@ SHC_3BB0A8C1_0x004B9528 | 0.0% | Pending SHC_3BB0A8C1_0x004B9530 | 0.0% | Pending -SHC_3BB0A8C1_0x004B9610 | 0.0% | Pending +SHC_3BB0A8C1_0x004B9610 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004B9620 | 0.0% | Pending @@ -29119,7 +29119,7 @@ SHC_3BB0A8C1_0x004BAEC0 | 0.0% | Pending SHC_3BB0A8C1_0x004BB010 | 0.0% | Pending -SHC_3BB0A8C1_0x004BB0B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004BB0B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004BB0D0 | 0.0% | Pending @@ -29287,11 +29287,11 @@ SHC_3BB0A8C1_0x004BB52C | 0.0% | Pending SHC_3BB0A8C1_0x004BB530 | 0.0% | Pending -SHC_3BB0A8C1_0x004BB540 | 0.0% | Pending +SHC_3BB0A8C1_0x004BB540 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004BB570 | 0.0% | Pending -SHC_3BB0A8C1_0x004BB650 | 0.0% | Pending +SHC_3BB0A8C1_0x004BB650 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004BB680 | 0.0% | Pending @@ -29315,9 +29315,9 @@ SHC_3BB0A8C1_0x004BB900 | 0.0% | Pending SHC_3BB0A8C1_0x004BB990 | 0.0% | Pending -SHC_3BB0A8C1_0x004BB9F0 | 0.0% | Pending +SHC_3BB0A8C1_0x004BB9F0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004BBA20 | 0.0% | Pending +SHC_3BB0A8C1_0x004BBA20 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004BBA30 | 0.0% | Pending @@ -30089,13 +30089,13 @@ SHC_3BB0A8C1_0x004BC620 | 0.0% | Pending SHC_3BB0A8C1_0x004BC630 | 0.0% | Pending -SHC_3BB0A8C1_0x004BC690 | 0.0% | Pending +SHC_3BB0A8C1_0x004BC690 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004BC6C0 | 0.0% | Pending SHC_3BB0A8C1_0x004BC6F0 | 0.0% | Pending -SHC_3BB0A8C1_0x004BC770 | 0.0% | Pending +SHC_3BB0A8C1_0x004BC770 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004BC790 | 0.0% | Pending @@ -30491,7 +30491,7 @@ SHC_3BB0A8C1_0x004BEA90 | 0.0% | Pending SHC_3BB0A8C1_0x004BEB20 | 0.0% | Pending -SHC_3BB0A8C1_0x004BEC10 | 0.0% | Pending +SHC_3BB0A8C1_0x004BEC10 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004BEC40 | 0.0% | Pending @@ -35833,7 +35833,7 @@ SHC_3BB0A8C1_0x004D6D14 | 0.0% | Pending SHC_3BB0A8C1_0x004D6D20 | 0.0% | Pending -SHC_3BB0A8C1_0x004D6EF0 | 0.0% | Pending +SHC_3BB0A8C1_0x004D6EF0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004D6F20 | 0.0% | Pending @@ -35999,7 +35999,7 @@ SHC_3BB0A8C1_0x004D8A18 | 0.0% | Pending SHC_3BB0A8C1_0x004D8A20 | 0.0% | Pending -SHC_3BB0A8C1_0x004D8AB0 | 0.0% | Pending +SHC_3BB0A8C1_0x004D8AB0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004D8AE0 | 0.0% | Pending @@ -36019,7 +36019,7 @@ SHC_3BB0A8C1_0x004D91D0 | 0.0% | Pending SHC_3BB0A8C1_0x004D9230 | 0.0% | Pending -SHC_3BB0A8C1_0x004D9270 | 0.0% | Pending +SHC_3BB0A8C1_0x004D9270 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004D9290 | 0.0% | Pending @@ -36027,7 +36027,7 @@ SHC_3BB0A8C1_0x004D9400 | 0.0% | Pending SHC_3BB0A8C1_0x004D9520 | 0.0% | Pending -SHC_3BB0A8C1_0x004D9700 | 0.0% | Pending +SHC_3BB0A8C1_0x004D9700 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004D9730 | 0.0% | Pending @@ -36053,9 +36053,9 @@ SHC_3BB0A8C1_0x004D9C10 | 0.0% | Pending SHC_3BB0A8C1_0x004D9CC0 | 0.0% | Pending -SHC_3BB0A8C1_0x004D9D60 | 0.0% | Pending +SHC_3BB0A8C1_0x004D9D60 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004D9D90 | 0.0% | Pending +SHC_3BB0A8C1_0x004D9D90 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004D9DB0 | 0.0% | Pending @@ -36135,7 +36135,7 @@ SHC_3BB0A8C1_0x004DA360 | 0.0% | Pending SHC_3BB0A8C1_0x004DA570 | 0.0% | Pending -SHC_3BB0A8C1_0x004DA640 | 0.0% | Pending +SHC_3BB0A8C1_0x004DA640 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DA670 | 0.0% | Pending @@ -36145,15 +36145,15 @@ SHC_3BB0A8C1_0x004DA750 | 0.0% | Pending SHC_3BB0A8C1_0x004DA7A0 | 0.0% | Pending -SHC_3BB0A8C1_0x004DA7E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004DA7E0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004DA810 | 0.0% | Pending +SHC_3BB0A8C1_0x004DA810 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004DA840 | 0.0% | Pending +SHC_3BB0A8C1_0x004DA840 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004DA870 | 0.0% | Pending +SHC_3BB0A8C1_0x004DA870 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004DA8A0 | 0.0% | Pending +SHC_3BB0A8C1_0x004DA8A0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DA8D0 | 0.0% | Pending @@ -36171,7 +36171,7 @@ SHC_3BB0A8C1_0x004DAB80 | 0.0% | Pending SHC_3BB0A8C1_0x004DABB0 | 0.0% | Pending -SHC_3BB0A8C1_0x004DABF0 | 0.0% | Pending +SHC_3BB0A8C1_0x004DABF0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DAC30 | 0.0% | Pending @@ -36257,7 +36257,7 @@ SHC_3BB0A8C1_0x004DC500 | 0.0% | Pending SHC_3BB0A8C1_0x004DC9E0 | 0.0% | Pending -SHC_3BB0A8C1_0x004DCC70 | 0.0% | Pending +SHC_3BB0A8C1_0x004DCC70 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DCC90 | 0.0% | Pending @@ -36375,7 +36375,7 @@ SHC_3BB0A8C1_0x004E12C0 | 0.0% | Pending SHC_3BB0A8C1_0x004E1810 | 0.0% | Pending -SHC_3BB0A8C1_0x004E1A20 | 0.0% | Pending +SHC_3BB0A8C1_0x004E1A20 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004E1A50 | 0.0% | Pending @@ -36399,7 +36399,7 @@ SHC_3BB0A8C1_0x004E2460 | 0.0% | Pending SHC_3BB0A8C1_0x004E25A0 | 0.0% | Pending -SHC_3BB0A8C1_0x004E2600 | 0.0% | Pending +SHC_3BB0A8C1_0x004E2600 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004E2630 | 0.0% | Pending @@ -36985,7 +36985,7 @@ SHC_3BB0A8C1_0x004E66F0 | 0.0% | Pending SHC_3BB0A8C1_0x004E7770 | 0.0% | Pending -SHC_3BB0A8C1_0x004E7800 | 0.0% | Pending +SHC_3BB0A8C1_0x004E7800 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004E7810 | 0.0% | Pending @@ -37335,11 +37335,11 @@ SHC_3BB0A8C1_0x004E8C4C | 0.0% | Pending SHC_3BB0A8C1_0x004E8C50 | 0.0% | Pending -SHC_3BB0A8C1_0x004E8C90 | 0.0% | Pending +SHC_3BB0A8C1_0x004E8C90 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004E8CA0 | 0.0% | Pending +SHC_3BB0A8C1_0x004E8CA0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004E8CC0 | 0.0% | Pending +SHC_3BB0A8C1_0x004E8CC0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004E8CF0 | 0.0% | Pending @@ -38463,7 +38463,7 @@ SHC_3BB0A8C1_0x004F28E4 | 0.0% | Pending SHC_3BB0A8C1_0x004F28E8 | 0.0% | Pending -SHC_3BB0A8C1_0x004F28F0 | 0.0% | Pending +SHC_3BB0A8C1_0x004F28F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004F2920 | 0.0% | Pending @@ -38561,9 +38561,9 @@ SHC_3BB0A8C1_0x004F2E00 | 0.0% | Pending SHC_3BB0A8C1_0x004F2E90 | 0.0% | Pending -SHC_3BB0A8C1_0x004F2FB0 | 0.0% | Pending +SHC_3BB0A8C1_0x004F2FB0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004F2FE0 | 0.0% | Pending +SHC_3BB0A8C1_0x004F2FE0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004F3010 | 0.0% | Pending @@ -38579,7 +38579,7 @@ SHC_3BB0A8C1_0x004F3560 | 0.0% | Pending SHC_3BB0A8C1_0x004F3610 | 0.0% | Pending -SHC_3BB0A8C1_0x004F3700 | 0.0% | Pending +SHC_3BB0A8C1_0x004F3700 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004F3730 | 0.0% | Pending @@ -38589,9 +38589,9 @@ SHC_3BB0A8C1_0x004F3840 | 0.0% | Pending SHC_3BB0A8C1_0x004F38A0 | 0.0% | Pending -SHC_3BB0A8C1_0x004F3900 | 0.0% | Pending +SHC_3BB0A8C1_0x004F3900 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004F3930 | 0.0% | Pending +SHC_3BB0A8C1_0x004F3930 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004F3960 | 0.0% | Pending @@ -38599,7 +38599,7 @@ SHC_3BB0A8C1_0x004F3B90 | 0.0% | Pending SHC_3BB0A8C1_0x004F3C50 | 0.0% | Pending -SHC_3BB0A8C1_0x004F3D30 | 0.0% | Pending +SHC_3BB0A8C1_0x004F3D30 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004F3D60 | 0.0% | Pending @@ -38633,9 +38633,9 @@ SHC_3BB0A8C1_0x004F4290 | 0.0% | Pending SHC_3BB0A8C1_0x004F49D0 | 0.0% | Pending -SHC_3BB0A8C1_0x004F4C30 | 0.0% | Pending +SHC_3BB0A8C1_0x004F4C30 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004F4C60 | 0.0% | Pending +SHC_3BB0A8C1_0x004F4C60 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004F4C80 | 0.0% | Pending @@ -38697,7 +38697,7 @@ SHC_3BB0A8C1_0x004F6460 | 0.0% | Pending SHC_3BB0A8C1_0x004F6464 | 0.0% | Pending -SHC_3BB0A8C1_0x004F6470 | 0.0% | Pending +SHC_3BB0A8C1_0x004F6470 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004F64A0 | 0.0% | Pending @@ -38733,9 +38733,9 @@ SHC_3BB0A8C1_0x004F69D0 | 0.0% | Pending SHC_3BB0A8C1_0x004F6A20 | 0.0% | Pending -SHC_3BB0A8C1_0x004F6A60 | 0.0% | Pending +SHC_3BB0A8C1_0x004F6A60 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004F6A70 | 0.0% | Pending +SHC_3BB0A8C1_0x004F6A70 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004F6A80 | 0.0% | Pending @@ -38755,11 +38755,11 @@ SHC_3BB0A8C1_0x004F6F90 | 0.0% | Pending SHC_3BB0A8C1_0x004F6FD0 | 0.0% | Pending -SHC_3BB0A8C1_0x004F70B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004F70B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004F70D0 | 0.0% | Pending -SHC_3BB0A8C1_0x004F70E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004F70E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004F70F0 | 0.0% | Pending @@ -41419,19 +41419,19 @@ SHC_3BB0A8C1_0x00500090 | 0.0% | Pending SHC_3BB0A8C1_0x00500091 | 0.0% | Pending -SHC_3BB0A8C1_0x005000A0 | 0.0% | Pending +SHC_3BB0A8C1_0x005000A0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x005000E0 | 0.0% | Pending SHC_3BB0A8C1_0x00500180 | 0.0% | Pending -SHC_3BB0A8C1_0x00500210 | 0.0% | Pending +SHC_3BB0A8C1_0x00500210 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00500250 | 0.0% | Pending SHC_3BB0A8C1_0x00500290 | 0.0% | Pending -SHC_3BB0A8C1_0x005002D0 | 0.0% | Pending +SHC_3BB0A8C1_0x005002D0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00500310 | 0.0% | Pending @@ -41443,19 +41443,19 @@ SHC_3BB0A8C1_0x00500500 | 0.0% | Pending SHC_3BB0A8C1_0x005005F0 | 0.0% | Pending -SHC_3BB0A8C1_0x00500640 | 0.0% | Pending +SHC_3BB0A8C1_0x00500640 | 46.2% | register allocation differs -SHC_3BB0A8C1_0x00500680 | 0.0% | Pending +SHC_3BB0A8C1_0x00500680 | 100.0% | Reimplemented SHC_3BB0A8C1_0x005006C0 | 0.0% | Pending -SHC_3BB0A8C1_0x00500720 | 0.0% | Pending +SHC_3BB0A8C1_0x00500720 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00500750 | 0.0% | Pending +SHC_3BB0A8C1_0x00500750 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00500790 | 0.0% | Pending -SHC_3BB0A8C1_0x005007D0 | 0.0% | Pending +SHC_3BB0A8C1_0x005007D0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00500800 | 0.0% | Pending @@ -41473,13 +41473,13 @@ SHC_3BB0A8C1_0x00500BB0 | 0.0% | Pending SHC_3BB0A8C1_0x00500C20 | 0.0% | Pending -SHC_3BB0A8C1_0x00500C80 | 0.0% | Pending +SHC_3BB0A8C1_0x00500C80 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00500CB0 | 0.0% | Pending SHC_3BB0A8C1_0x00500CF0 | 0.0% | Pending -SHC_3BB0A8C1_0x00500D30 | 0.0% | Pending +SHC_3BB0A8C1_0x00500D30 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00500D60 | 0.0% | Pending @@ -41503,19 +41503,19 @@ SHC_3BB0A8C1_0x005010B8 | 0.0% | Pending SHC_3BB0A8C1_0x005010BC | 0.0% | Pending -SHC_3BB0A8C1_0x005010C0 | 0.0% | Pending +SHC_3BB0A8C1_0x005010C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x005010D0 | 0.0% | Pending -SHC_3BB0A8C1_0x005010E0 | 0.0% | Pending +SHC_3BB0A8C1_0x005010E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00501110 | 0.0% | Pending -SHC_3BB0A8C1_0x00501180 | 0.0% | Pending +SHC_3BB0A8C1_0x00501180 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x005011A0 | 0.0% | Pending +SHC_3BB0A8C1_0x005011A0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x005011C0 | 0.0% | Pending +SHC_3BB0A8C1_0x005011C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x005011F0 | 0.0% | Pending @@ -41535,11 +41535,11 @@ SHC_3BB0A8C1_0x005016D0 | 0.0% | Pending SHC_3BB0A8C1_0x005016E0 | 0.0% | Pending -SHC_3BB0A8C1_0x00501730 | 0.0% | Pending +SHC_3BB0A8C1_0x00501730 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00501760 | 0.0% | Pending -SHC_3BB0A8C1_0x005017A0 | 0.0% | Pending +SHC_3BB0A8C1_0x005017A0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x005017C0 | 0.0% | Pending @@ -42067,7 +42067,7 @@ SHC_3BB0A8C1_0x00504ED0 | 0.0% | Pending SHC_3BB0A8C1_0x00504ED1 | 0.0% | Pending -SHC_3BB0A8C1_0x00504EE0 | 0.0% | Pending +SHC_3BB0A8C1_0x00504EE0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00504F10 | 0.0% | Pending @@ -44739,7 +44739,7 @@ SHC_3BB0A8C1_0x005127B0 | 0.0% | Pending SHC_3BB0A8C1_0x005127D0 | 0.0% | Pending -SHC_3BB0A8C1_0x00512920 | 0.0% | Pending +SHC_3BB0A8C1_0x00512920 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00512940 | 0.0% | Pending @@ -45743,7 +45743,7 @@ SHC_3BB0A8C1_0x00518180 | 0.0% | Pending SHC_3BB0A8C1_0x005182A0 | 0.0% | Pending -SHC_3BB0A8C1_0x00518350 | 0.0% | Pending +SHC_3BB0A8C1_0x00518350 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00518380 | 0.0% | Pending @@ -45773,7 +45773,7 @@ SHC_3BB0A8C1_0x00519850 | 0.0% | Pending SHC_3BB0A8C1_0x005198C0 | 0.0% | Pending -SHC_3BB0A8C1_0x00519960 | 0.0% | Pending +SHC_3BB0A8C1_0x00519960 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00519990 | 0.0% | Pending @@ -45839,9 +45839,9 @@ SHC_3BB0A8C1_0x0051AB60 | 0.0% | Pending SHC_3BB0A8C1_0x0051ABB0 | 0.0% | Pending -SHC_3BB0A8C1_0x0051AC80 | 0.0% | Pending +SHC_3BB0A8C1_0x0051AC80 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0051ACB0 | 0.0% | Pending +SHC_3BB0A8C1_0x0051ACB0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0051ACE0 | 0.0% | Pending @@ -45879,7 +45879,7 @@ SHC_3BB0A8C1_0x0051B420 | 0.0% | Pending SHC_3BB0A8C1_0x0051B570 | 0.0% | Pending -SHC_3BB0A8C1_0x0051B680 | 0.0% | Pending +SHC_3BB0A8C1_0x0051B680 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0051B690 | 0.0% | Pending @@ -46161,7 +46161,7 @@ SHC_3BB0A8C1_0x0051D5D0 | 0.0% | Pending SHC_3BB0A8C1_0x0051D5E0 | 0.0% | Pending -SHC_3BB0A8C1_0x0051D680 | 0.0% | Pending +SHC_3BB0A8C1_0x0051D680 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0051D690 | 0.0% | Pending @@ -46379,11 +46379,11 @@ SHC_3BB0A8C1_0x00520CD0 | 0.0% | Pending SHC_3BB0A8C1_0x00520F70 | 0.0% | Pending -SHC_3BB0A8C1_0x00521180 | 0.0% | Pending +SHC_3BB0A8C1_0x00521180 | 100.0% | Reimplemented SHC_3BB0A8C1_0x005211B0 | 0.0% | Pending -SHC_3BB0A8C1_0x00521210 | 0.0% | Pending +SHC_3BB0A8C1_0x00521210 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00521240 | 0.0% | Pending @@ -46633,7 +46633,7 @@ SHC_3BB0A8C1_0x00521EA5 | 0.0% | Pending SHC_3BB0A8C1_0x00521EA6 | 0.0% | Pending -SHC_3BB0A8C1_0x00521EB0 | 0.0% | Pending +SHC_3BB0A8C1_0x00521EB0 | 76.5% | pop esi scheduling SHC_3BB0A8C1_0x00521EF0 | 0.0% | Pending @@ -46765,11 +46765,11 @@ SHC_3BB0A8C1_0x00522083 | 0.0% | Pending SHC_3BB0A8C1_0x00522090 | 0.0% | Pending -SHC_3BB0A8C1_0x00522110 | 0.0% | Pending +SHC_3BB0A8C1_0x00522110 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00522150 | 0.0% | Pending +SHC_3BB0A8C1_0x00522150 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00522160 | 0.0% | Pending +SHC_3BB0A8C1_0x00522160 | 100.0% | Reimplemented SHC_3BB0A8C1_0x005221A0 | 0.0% | Pending @@ -46779,15 +46779,15 @@ SHC_3BB0A8C1_0x00522210 | 0.0% | Pending SHC_3BB0A8C1_0x005222B0 | 0.0% | Pending -SHC_3BB0A8C1_0x00522360 | 0.0% | Pending +SHC_3BB0A8C1_0x00522360 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00522390 | 0.0% | Pending SHC_3BB0A8C1_0x00522410 | 0.0% | Pending -SHC_3BB0A8C1_0x005224E0 | 0.0% | Pending +SHC_3BB0A8C1_0x005224E0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00522520 | 0.0% | Pending +SHC_3BB0A8C1_0x00522520 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00522550 | 0.0% | Pending @@ -46807,11 +46807,11 @@ SHC_3BB0A8C1_0x005229C0 | 0.0% | Pending SHC_3BB0A8C1_0x00522B00 | 0.0% | Pending -SHC_3BB0A8C1_0x00522BC0 | 0.0% | Pending +SHC_3BB0A8C1_0x00522BC0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00522BF0 | 0.0% | Pending +SHC_3BB0A8C1_0x00522BF0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00522C20 | 0.0% | Pending +SHC_3BB0A8C1_0x00522C20 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00522C50 | 0.0% | Pending @@ -46833,13 +46833,13 @@ SHC_3BB0A8C1_0x005232E0 | 0.0% | Pending SHC_3BB0A8C1_0x005232F0 | 0.0% | Pending -SHC_3BB0A8C1_0x00523340 | 0.0% | Pending +SHC_3BB0A8C1_0x00523340 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00523370 | 0.0% | Pending +SHC_3BB0A8C1_0x00523370 | 100.0% | Reimplemented SHC_3BB0A8C1_0x005233A0 | 0.0% | Pending -SHC_3BB0A8C1_0x005233E0 | 0.0% | Pending +SHC_3BB0A8C1_0x005233E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00523410 | 0.0% | Pending @@ -46851,7 +46851,7 @@ SHC_3BB0A8C1_0x00523630 | 0.0% | Pending SHC_3BB0A8C1_0x005236A0 | 0.0% | Pending -SHC_3BB0A8C1_0x00523730 | 0.0% | Pending +SHC_3BB0A8C1_0x00523730 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00523750 | 0.0% | Pending @@ -46865,11 +46865,11 @@ SHC_3BB0A8C1_0x00523A30 | 0.0% | Pending SHC_3BB0A8C1_0x00523B00 | 0.0% | Pending -SHC_3BB0A8C1_0x00523E00 | 0.0% | Pending +SHC_3BB0A8C1_0x00523E00 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00523E30 | 0.0% | Pending -SHC_3BB0A8C1_0x00523EB0 | 0.0% | Pending +SHC_3BB0A8C1_0x00523EB0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00523EF0 | 0.0% | Pending @@ -46917,7 +46917,7 @@ SHC_3BB0A8C1_0x00524EF0 | 0.0% | Pending SHC_3BB0A8C1_0x00525060 | 0.0% | Pending -SHC_3BB0A8C1_0x00525090 | 0.0% | Pending +SHC_3BB0A8C1_0x00525090 | 100.0% | Reimplemented SHC_3BB0A8C1_0x005250B0 | 0.0% | Pending @@ -46947,7 +46947,7 @@ SHC_3BB0A8C1_0x00525970 | 0.0% | Pending SHC_3BB0A8C1_0x00525A70 | 0.0% | Pending -SHC_3BB0A8C1_0x00525B70 | 0.0% | Pending +SHC_3BB0A8C1_0x00525B70 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00525BA0 | 0.0% | Pending @@ -46959,7 +46959,7 @@ SHC_3BB0A8C1_0x005261B0 | 0.0% | Pending SHC_3BB0A8C1_0x005262A0 | 0.0% | Pending -SHC_3BB0A8C1_0x00526370 | 0.0% | Pending +SHC_3BB0A8C1_0x00526370 | 100.0% | Reimplemented SHC_3BB0A8C1_0x005263A0 | 0.0% | Pending @@ -49233,7 +49233,7 @@ SHC_3BB0A8C1_0x0052B9E4 | 0.0% | Pending SHC_3BB0A8C1_0x0052B9E8 | 0.0% | Pending -SHC_3BB0A8C1_0x0052B9F0 | 0.0% | Pending +SHC_3BB0A8C1_0x0052B9F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0052BA10 | 0.0% | Pending @@ -49317,9 +49317,9 @@ SHC_3BB0A8C1_0x0052EED0 | 0.0% | Pending SHC_3BB0A8C1_0x0052F010 | 0.0% | Pending -SHC_3BB0A8C1_0x0052F070 | 0.0% | Pending +SHC_3BB0A8C1_0x0052F070 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0052F0A0 | 0.0% | Pending +SHC_3BB0A8C1_0x0052F0A0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0052F0D0 | 0.0% | Pending @@ -49345,9 +49345,9 @@ SHC_3BB0A8C1_0x0052F730 | 0.0% | Pending SHC_3BB0A8C1_0x0052F7E0 | 0.0% | Pending -SHC_3BB0A8C1_0x0052FBB0 | 0.0% | Pending +SHC_3BB0A8C1_0x0052FBB0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0052FBF0 | 0.0% | Pending +SHC_3BB0A8C1_0x0052FBF0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0052FC30 | 0.0% | Pending @@ -49361,7 +49361,7 @@ SHC_3BB0A8C1_0x0052FE90 | 0.0% | Pending SHC_3BB0A8C1_0x0052FF80 | 0.0% | Pending -SHC_3BB0A8C1_0x00530080 | 0.0% | Pending +SHC_3BB0A8C1_0x00530080 | 100.0% | Reimplemented SHC_3BB0A8C1_0x005300B0 | 0.0% | Pending @@ -49649,7 +49649,7 @@ SHC_3BB0A8C1_0x00530C40 | 0.0% | Pending SHC_3BB0A8C1_0x00530CF0 | 0.0% | Pending -SHC_3BB0A8C1_0x00530D50 | 0.0% | Pending +SHC_3BB0A8C1_0x00530D50 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00530D70 | 0.0% | Pending @@ -49659,11 +49659,11 @@ SHC_3BB0A8C1_0x00530EB0 | 0.0% | Pending SHC_3BB0A8C1_0x00530F20 | 0.0% | Pending -SHC_3BB0A8C1_0x00530FD0 | 0.0% | Pending +SHC_3BB0A8C1_0x00530FD0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00531000 | 0.0% | Pending -SHC_3BB0A8C1_0x005311F0 | 0.0% | Pending +SHC_3BB0A8C1_0x005311F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00531220 | 0.0% | Pending @@ -50643,7 +50643,7 @@ SHC_3BB0A8C1_0x00532F5D | 0.0% | Pending SHC_3BB0A8C1_0x00532F5E | 0.0% | Pending -SHC_3BB0A8C1_0x00532F60 | 0.0% | Pending +SHC_3BB0A8C1_0x00532F60 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00532F80 | 0.0% | Pending @@ -50677,19 +50677,19 @@ SHC_3BB0A8C1_0x00533630 | 0.0% | Pending SHC_3BB0A8C1_0x00533810 | 0.0% | Pending -SHC_3BB0A8C1_0x00533920 | 0.0% | Pending +SHC_3BB0A8C1_0x00533920 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00533960 | 0.0% | Pending SHC_3BB0A8C1_0x005339A0 | 0.0% | Pending -SHC_3BB0A8C1_0x005339F0 | 0.0% | Pending +SHC_3BB0A8C1_0x005339F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00533A10 | 0.0% | Pending SHC_3BB0A8C1_0x00533B30 | 0.0% | Pending -SHC_3BB0A8C1_0x00533C70 | 0.0% | Pending +SHC_3BB0A8C1_0x00533C70 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00533CA0 | 0.0% | Pending @@ -50777,7 +50777,7 @@ SHC_3BB0A8C1_0x00533F84 | 0.0% | Pending SHC_3BB0A8C1_0x00533F85 | 0.0% | Pending -SHC_3BB0A8C1_0x00533F90 | 0.0% | Pending +SHC_3BB0A8C1_0x00533F90 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00533FC0 | 0.0% | Pending @@ -50809,7 +50809,7 @@ SHC_3BB0A8C1_0x005343C0 | 0.0% | Pending SHC_3BB0A8C1_0x005343F0 | 0.0% | Pending -SHC_3BB0A8C1_0x00534460 | 0.0% | Pending +SHC_3BB0A8C1_0x00534460 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00534490 | 0.0% | Pending @@ -50857,7 +50857,7 @@ SHC_3BB0A8C1_0x005350B0 | 0.0% | Pending SHC_3BB0A8C1_0x00535150 | 0.0% | Pending -SHC_3BB0A8C1_0x00535190 | 0.0% | Pending +SHC_3BB0A8C1_0x00535190 | 100.0% | Reimplemented SHC_3BB0A8C1_0x005351C0 | 0.0% | Pending @@ -51065,11 +51065,11 @@ SHC_3BB0A8C1_0x00535513 | 0.0% | Pending SHC_3BB0A8C1_0x00535514 | 0.0% | Pending -SHC_3BB0A8C1_0x00535520 | 0.0% | Pending +SHC_3BB0A8C1_0x00535520 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00535550 | 0.0% | Pending +SHC_3BB0A8C1_0x00535550 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00535560 | 0.0% | Pending +SHC_3BB0A8C1_0x00535560 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00535580 | 0.0% | Pending @@ -51077,15 +51077,15 @@ SHC_3BB0A8C1_0x005355E0 | 0.0% | Pending SHC_3BB0A8C1_0x00535680 | 0.0% | Pending -SHC_3BB0A8C1_0x00535700 | 0.0% | Pending +SHC_3BB0A8C1_0x00535700 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00535730 | 0.0% | Pending SHC_3BB0A8C1_0x005357E0 | 0.0% | Pending -SHC_3BB0A8C1_0x00535810 | 0.0% | Pending +SHC_3BB0A8C1_0x00535810 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00535840 | 0.0% | Pending +SHC_3BB0A8C1_0x00535840 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00535870 | 0.0% | Pending @@ -51103,7 +51103,7 @@ SHC_3BB0A8C1_0x00535B00 | 0.0% | Pending SHC_3BB0A8C1_0x00535BC0 | 0.0% | Pending -SHC_3BB0A8C1_0x00535DF0 | 0.0% | Pending +SHC_3BB0A8C1_0x00535DF0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00535E20 | 0.0% | Pending @@ -51205,9 +51205,9 @@ SHC_3BB0A8C1_0x00536A60 | 0.0% | Pending SHC_3BB0A8C1_0x00536C70 | 0.0% | Pending -SHC_3BB0A8C1_0x00536C90 | 0.0% | Pending +SHC_3BB0A8C1_0x00536C90 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00536CC0 | 0.0% | Pending +SHC_3BB0A8C1_0x00536CC0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00536CF0 | 0.0% | Pending @@ -51221,17 +51221,17 @@ SHC_3BB0A8C1_0x00536E30 | 0.0% | Pending SHC_3BB0A8C1_0x00537070 | 0.0% | Pending -SHC_3BB0A8C1_0x005370C0 | 0.0% | Pending +SHC_3BB0A8C1_0x005370C0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00537100 | 0.0% | Pending +SHC_3BB0A8C1_0x00537100 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00537130 | 0.0% | Pending +SHC_3BB0A8C1_0x00537130 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00537160 | 0.0% | Pending +SHC_3BB0A8C1_0x00537160 | 100.0% | Reimplemented SHC_3BB0A8C1_0x005371A0 | 0.0% | Pending -SHC_3BB0A8C1_0x005371E0 | 0.0% | Pending +SHC_3BB0A8C1_0x005371E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x005371F0 | 0.0% | Pending @@ -59625,9 +59625,9 @@ SHC_3BB0A8C1_0x0053B210 | 0.0% | Pending SHC_3BB0A8C1_0x0053B260 | 0.0% | Pending -SHC_3BB0A8C1_0x0053B310 | 0.0% | Pending +SHC_3BB0A8C1_0x0053B310 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0053B340 | 0.0% | Pending +SHC_3BB0A8C1_0x0053B340 | 90.91% | jne vs jl due to loop unroll prevention via != SHC_3BB0A8C1_0x0053B380 | 0.0% | Pending @@ -59637,25 +59637,25 @@ SHC_3BB0A8C1_0x0053B3E0 | 0.0% | Pending SHC_3BB0A8C1_0x0053B4F0 | 0.0% | Pending -SHC_3BB0A8C1_0x0053B530 | 0.0% | Pending +SHC_3BB0A8C1_0x0053B530 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0053B570 | 0.0% | Pending +SHC_3BB0A8C1_0x0053B570 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0053B5A0 | 0.0% | Pending -SHC_3BB0A8C1_0x0053B5E0 | 0.0% | Pending +SHC_3BB0A8C1_0x0053B5E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0053B610 | 0.0% | Pending SHC_3BB0A8C1_0x0053B800 | 0.0% | Pending -SHC_3BB0A8C1_0x0053B8B0 | 0.0% | Pending +SHC_3BB0A8C1_0x0053B8B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0053B8E0 | 0.0% | Pending SHC_3BB0A8C1_0x0053BB10 | 0.0% | Pending -SHC_3BB0A8C1_0x0053BB70 | 0.0% | Pending +SHC_3BB0A8C1_0x0053BB70 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0053BB90 | 0.0% | Pending @@ -59669,7 +59669,7 @@ SHC_3BB0A8C1_0x0053C400 | 0.0% | Pending SHC_3BB0A8C1_0x0053C590 | 0.0% | Pending -SHC_3BB0A8C1_0x0053CAC0 | 0.0% | Pending +SHC_3BB0A8C1_0x0053CAC0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0053CAE0 | 0.0% | Pending @@ -60095,7 +60095,7 @@ SHC_3BB0A8C1_0x0053E820 | 0.0% | Pending SHC_3BB0A8C1_0x0053E870 | 0.0% | Pending -SHC_3BB0A8C1_0x0053E8D0 | 0.0% | Pending +SHC_3BB0A8C1_0x0053E8D0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0053E900 | 0.0% | Pending @@ -68321,7 +68321,7 @@ SHC_3BB0A8C1_0x00584001 | 0.0% | Pending SHC_3BB0A8C1_0x0058401B | 0.0% | Pending -SHC_3BB0A8C1_0x00584026 | 0.0% | Pending +SHC_3BB0A8C1_0x00584026 | 0.0% | instruction selection differs SHC_3BB0A8C1_0x00584030 | 0.0% | Pending