diff --git a/src/OpenSHC/AI/AICState/shouldNotBuildKillingPits.cpp b/src/OpenSHC/AI/AICState/shouldNotBuildKillingPits.cpp new file mode 100644 index 00000000..fe582223 --- /dev/null +++ b/src/OpenSHC/AI/AICState/shouldNotBuildKillingPits.cpp @@ -0,0 +1,24 @@ +#include "OpenSHC/AI/AICState.func.hpp" +#include "OpenSHC/Commands/MappersEnum.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +#include "OpenSHC/Globals/DAT_AIVState.hpp" + +namespace OpenSHC { +namespace AI { + + using OpenSHC::Commands::MappersEnum; + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004ECA90 + BOOLEnum AICState::shouldNotBuildKillingPits(int playerID, MappersEnum commandBuildingType) + { + BOOLEnum _totalAbove99 = FALSE; + if (commandBuildingType == OpenSHC::Commands::M_MAPPER_KILLING_PIT) { + _totalAbove99 = 100 <= DAT_AIVState::instance.mapExtraInfo.playerTotalKillingPits[playerID]; + } + return _totalAbove99; + } + +} +} diff --git a/src/OpenSHC/AI/AIVState/clearTheHeatmaps.cpp b/src/OpenSHC/AI/AIVState/clearTheHeatmaps.cpp new file mode 100644 index 00000000..d35fd06d --- /dev/null +++ b/src/OpenSHC/AI/AIVState/clearTheHeatmaps.cpp @@ -0,0 +1,17 @@ +#include "OpenSHC/AI/AIVState.func.hpp" +#include "OpenSHC/IO/LowLevelMemory.func.hpp" + +#include "OpenSHC/Globals/DAT_LowLevelMemory.hpp" + +namespace OpenSHC { +namespace AI { + + // FUNCTION: STRONGHOLDCRUSADER 0x004EDC90 + void AIVState::clearTheHeatmaps() + { + MACRO_CALL_MEMBER(OpenSHC::IO::LowLevelMemory_Func::fillMemory_ByteValue, DAT_LowLevelMemory::ptr)( + 307200, '\0', (void*)((int)(this->heatMaps))); + } + +} // namespace AI +} // namespace OpenSHC diff --git a/src/OpenSHC/Audio/ResetGreatestLordGenieSpeechState.cpp b/src/OpenSHC/Audio/ResetGreatestLordGenieSpeechState.cpp index 53ff473a..1d16b204 100644 --- a/src/OpenSHC/Audio/ResetGreatestLordGenieSpeechState.cpp +++ b/src/OpenSHC/Audio/ResetGreatestLordGenieSpeechState.cpp @@ -21,7 +21,7 @@ namespace OpenSHC { namespace Audio { // FUNCTION: STRONGHOLDCRUSADER 0x0044A720 - void __cdecl ResetGreatestLordGenieSpeechState() + void ResetGreatestLordGenieSpeechState() { DAT_CurrentPlayerRanking::instance = -1; INT_00b98698::instance = -1; diff --git a/src/OpenSHC/Audio/SFX/ComputeCurrentPlayerRanking.cpp b/src/OpenSHC/Audio/SFX/ComputeCurrentPlayerRanking.cpp new file mode 100644 index 00000000..5c33b08d --- /dev/null +++ b/src/OpenSHC/Audio/SFX/ComputeCurrentPlayerRanking.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/Audio/SFX.func.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace Audio { + + // FUNCTION: STRONGHOLDCRUSADER 0x0044C400 + int SFX::ComputeCurrentPlayerRanking() + { + return MACRO_CALL(OpenSHC::Audio::SFX_Func::ComputePlayerRanking)( + DAT_GameSynchronyState::instance.currentPlayerSlotID); + } + +} +} diff --git a/src/OpenSHC/Audio/SFX/UpdateUnitLossSpeechFeedback.cpp b/src/OpenSHC/Audio/SFX/UpdateUnitLossSpeechFeedback.cpp index 55eb522b..e5c31a35 100644 --- a/src/OpenSHC/Audio/SFX/UpdateUnitLossSpeechFeedback.cpp +++ b/src/OpenSHC/Audio/SFX/UpdateUnitLossSpeechFeedback.cpp @@ -22,7 +22,7 @@ namespace Audio { namespace SFX { // FUNCTION: STRONGHOLDCRUSADER 0x0044B840 - void __stdcall UpdateUnitLossSpeechFeedback() + void UpdateUnitLossSpeechFeedback() { if (DAT_GameCore::instance.currentMenuViewType != UI::Enums::MVT_BUILD_MENU) { return; @@ -180,7 +180,7 @@ namespace Audio { } // FUNCTION: STRONGHOLDCRUSADER 0x0044AAB0 - int __cdecl UpdateUnitLossSpeechFeedback_RelativeValueForGenie(int larger, int smaller) + int UpdateUnitLossSpeechFeedback_RelativeValueForGenie(int larger, int smaller) { if (larger < 1) { larger = 1; diff --git a/src/OpenSHC/Audio/mss/RegisterMilesAILShutdown.cpp b/src/OpenSHC/Audio/mss/RegisterMilesAILShutdown.cpp index dfa7378a..b7ec3f26 100644 --- a/src/OpenSHC/Audio/mss/RegisterMilesAILShutdown.cpp +++ b/src/OpenSHC/Audio/mss/RegisterMilesAILShutdown.cpp @@ -8,10 +8,10 @@ namespace OpenSHC { namespace Audio { namespace MSS { - void __cdecl AIL_shutdown_proxy() { AIL_shutdown(); } + void AIL_shutdown_proxy() { AIL_shutdown(); } // FUNCTION: STRONGHOLDCRUSADER 0x0057E160 - int __cdecl RegisterMilesAILShutdown() + int RegisterMilesAILShutdown() { MACRO_CALL(OS_Func::_atexit)(AIL_shutdown_proxy); return 0; diff --git a/src/OpenSHC/Audio/mss/SoundSystem/markMusicChangePending.cpp b/src/OpenSHC/Audio/mss/SoundSystem/markMusicChangePending.cpp index b626e2db..16c08d09 100644 --- a/src/OpenSHC/Audio/mss/SoundSystem/markMusicChangePending.cpp +++ b/src/OpenSHC/Audio/mss/SoundSystem/markMusicChangePending.cpp @@ -1,4 +1,4 @@ -#include "../SoundSystem.func.hpp" +#include "OpenSHC/Audio/MSS/SoundSystem.func.hpp" namespace OpenSHC { namespace Audio { diff --git a/src/OpenSHC/Audio/mss/SoundSystem/setSection1079_28_4_.cpp b/src/OpenSHC/Audio/mss/SoundSystem/setSection1079_28_4_.cpp index 5723e377..e03a04b2 100644 --- a/src/OpenSHC/Audio/mss/SoundSystem/setSection1079_28_4_.cpp +++ b/src/OpenSHC/Audio/mss/SoundSystem/setSection1079_28_4_.cpp @@ -1,4 +1,4 @@ -#include "../SoundSystem.func.hpp" +#include "OpenSHC/Audio/MSS/SoundSystem.func.hpp" #include "OpenSHC/Globals/DAT_SoundEffectsHelperData1.hpp" @@ -9,7 +9,7 @@ namespace Audio { // FUNCTION: STRONGHOLDCRUSADER 0x0047A570 void SoundSystem::setSection1079_28_4_(int param_1) { - DAT_SoundEffectsHelperData1::ptr->SEC_Section1079.field7_0x1c = param_1; + DAT_SoundEffectsHelperData1::instance.SEC_Section1079.field7_0x1c = param_1; } } diff --git a/src/OpenSHC/Game/GameCore/setTabToSwitchTo.cpp b/src/OpenSHC/Game/GameCore/setTabToSwitchTo.cpp new file mode 100644 index 00000000..b1b3fb84 --- /dev/null +++ b/src/OpenSHC/Game/GameCore/setTabToSwitchTo.cpp @@ -0,0 +1,20 @@ +#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 00000000..15441316 --- /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 00000000..f3711c65 --- /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/GameStateStructures/activateTraderState.cpp b/src/OpenSHC/Game/GameStateStructures/activateTraderState.cpp new file mode 100644 index 00000000..73a785d7 --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/activateTraderState.cpp @@ -0,0 +1,14 @@ +#include "OpenSHC/Game/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/getBatchBuyPrice.cpp b/src/OpenSHC/Game/GameStateStructures/getBatchBuyPrice.cpp new file mode 100644 index 00000000..dc456d60 --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/getBatchBuyPrice.cpp @@ -0,0 +1,13 @@ +#include "OpenSHC/Game/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/isFullIDEqualsToMinus1.cpp b/src/OpenSHC/Game/GameStateStructures/isFullIDEqualsToMinus1.cpp new file mode 100644 index 00000000..414a85c0 --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/isFullIDEqualsToMinus1.cpp @@ -0,0 +1,18 @@ +#include "OpenSHC/Game/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 param_1) + { + return DAT_GameSynchronyState::instance.currentPlayerFullIDArray[param_1] == -1; + } + +} +} diff --git a/src/OpenSHC/Game/GameStateStructures/resetTraderState.cpp b/src/OpenSHC/Game/GameStateStructures/resetTraderState.cpp new file mode 100644 index 00000000..2f1e4bad --- /dev/null +++ b/src/OpenSHC/Game/GameStateStructures/resetTraderState.cpp @@ -0,0 +1,29 @@ +#include "OpenSHC/Game/GameStateStructures.func.hpp" + + + + + +namespace OpenSHC { +namespace Game { + + + + +/* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + + +// FUNCTION: STRONGHOLDCRUSADER 0x004586F0 +void GameStateStructures::resetTraderState() + +{ +this->mapAndTime.traderRelated2 = 0; +this->mapAndTime.traderRelatedCounter1 = 0; +return; +} + + +} +} \ No newline at end of file diff --git a/src/OpenSHC/Game/UpdateUnitValueLoss.cpp b/src/OpenSHC/Game/UpdateUnitValueLoss.cpp new file mode 100644 index 00000000..306f1adc --- /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 (0 < value) { + 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 00000000..005ab6a1 --- /dev/null +++ b/src/OpenSHC/Global/PrintToDestination.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/Global.func.hpp" +#include "OpenSHC/OS.func.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x0045D060 +void Global::PrintToDestination(wchar_t* destination, wchar_t* format, ...) +{ + // fixme: The calls that call PrintToDestination() use 2, 3, or 4 arguments, but the original assembly + // always uses add esp, 0xc suggesting three parameters. Currently this optimizes to a jump directly. + va_list args; + va_start(args, format); + MACRO_CALL(OpenSHC::OS_Func::__vswprintf)(destination, format, args); +} + +} diff --git a/src/OpenSHC/IO/Base64EncodeCharacterLookup.cpp b/src/OpenSHC/IO/Base64EncodeCharacterLookup.cpp new file mode 100644 index 00000000..d4cbc7f7 --- /dev/null +++ b/src/OpenSHC/IO/Base64EncodeCharacterLookup.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/IO.func.hpp" + +#include "OpenSHC/Globals/DAT_ProtocolDefinedData.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x00487090 +byte IO::Base64EncodeCharacterLookup(char param_1) +{ + if ('?' < param_1) { + return (byte)(0x3d); + } + return DAT_ProtocolDefinedData::instance.field136_0x4f4[param_1]; +} + +} diff --git a/src/OpenSHC/IO/Base64EncodeInit.cpp b/src/OpenSHC/IO/Base64EncodeInit.cpp new file mode 100644 index 00000000..581623b2 --- /dev/null +++ b/src/OpenSHC/IO/Base64EncodeInit.cpp @@ -0,0 +1,16 @@ + +#include "OpenSHC/IO/Base64State.hpp" + +namespace OpenSHC { +namespace IO { + + // FUNCTION: STRONGHOLDCRUSADER 0x00487080 + void Base64EncodeInit(Base64State* state) + { + state->phase = 0; + *(unsigned char*)&state->carryByte = 0; + state->lineCharacterCounter = 0; + } + +} // namespace IO +} // namespace OpenSHC diff --git a/src/OpenSHC/IO/DecoderBuffer/ReadBufferAndComputeHash.cpp b/src/OpenSHC/IO/DecoderBuffer/ReadBufferAndComputeHash.cpp index b093095d..cf37526c 100644 --- a/src/OpenSHC/IO/DecoderBuffer/ReadBufferAndComputeHash.cpp +++ b/src/OpenSHC/IO/DecoderBuffer/ReadBufferAndComputeHash.cpp @@ -9,7 +9,7 @@ namespace IO { namespace DecoderBuffer { // FUNCTION: STRONGHOLDCRUSADER 0x0046D270 - unsigned int __cdecl ReadBufferAndComputeHash(char* buf, unsigned int* size, void* param) + unsigned int ReadBufferAndComputeHash(char* buf, unsigned int* size, void* param) { uint bytesToLoad = *size; BufferHelper* bufferHelper = (BufferHelper*)param; diff --git a/src/OpenSHC/IO/DecoderBuffer/WriteBufferAndComputeHash.cpp b/src/OpenSHC/IO/DecoderBuffer/WriteBufferAndComputeHash.cpp index c0271829..069d5bcc 100644 --- a/src/OpenSHC/IO/DecoderBuffer/WriteBufferAndComputeHash.cpp +++ b/src/OpenSHC/IO/DecoderBuffer/WriteBufferAndComputeHash.cpp @@ -9,7 +9,7 @@ namespace IO { namespace DecoderBuffer { // FUNCTION: STRONGHOLDCRUSADER 0x0046D300 - void __cdecl WriteBufferAndComputeHash(char* buf, unsigned int* size, void* param) + void WriteBufferAndComputeHash(char* buf, unsigned int* size, void* param) { uint bytesToWrite = *size; BufferHelper* bufferHelper = (BufferHelper*)param; diff --git a/src/OpenSHC/IO/SwapInts.cpp b/src/OpenSHC/IO/SwapInts.cpp new file mode 100644 index 00000000..4e01811a --- /dev/null +++ b/src/OpenSHC/IO/SwapInts.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/IO.hpp" + +namespace OpenSHC { +namespace IO { + + // FUNCTION: STRONGHOLDCRUSADER 0x0041a740 + void SwapInts(int* param_1, int* param_2) + { + int temp; + temp = *param_1; + *param_1 = *param_2; + *param_2 = temp; + } +} +} diff --git a/src/OpenSHC/Input/MouseState/updateMouseWheelStatus.cpp b/src/OpenSHC/Input/MouseState/updateMouseWheelStatus.cpp new file mode 100644 index 00000000..583130b9 --- /dev/null +++ b/src/OpenSHC/Input/MouseState/updateMouseWheelStatus.cpp @@ -0,0 +1,10 @@ +#include "OpenSHC/Input/MouseState.hpp" + +namespace OpenSHC { +namespace Input { + + // FUNCTION: STRONGHOLDCRUSADER 0x004680b0 + void MouseState::updateMouseWheelStatus(int delta) { this->mouseWheelDelta = (unsigned short)delta; } + +} // namespace Input +} // namespace OpenSHC diff --git a/src/OpenSHC/Input/getCurrentTutorialStep.cpp b/src/OpenSHC/Input/getCurrentTutorialStep.cpp new file mode 100644 index 00000000..4f93809a --- /dev/null +++ b/src/OpenSHC/Input/getCurrentTutorialStep.cpp @@ -0,0 +1,11 @@ +#include "OpenSHC/Input.func.hpp" + +#include "OpenSHC/Globals/DAT_TutorialCurrentStep.hpp" + +namespace OpenSHC { +namespace Input { + + // FUNCTION: STRONGHOLDCRUSADER 0x004BC620 + undefined4 OpenSHC::Input::GetCurrentTutorialStep(void) { return DAT_TutorialCurrentStep::instance; } +} +} diff --git a/src/OpenSHC/Map/Buildings/BuildingsState/applyVersionUpgradeAccessibilityRecompute.cpp b/src/OpenSHC/Map/Buildings/BuildingsState/applyVersionUpgradeAccessibilityRecompute.cpp new file mode 100644 index 00000000..e223c865 --- /dev/null +++ b/src/OpenSHC/Map/Buildings/BuildingsState/applyVersionUpgradeAccessibilityRecompute.cpp @@ -0,0 +1,20 @@ +#include "OpenSHC/Map/Buildings/BuildingsState.func.hpp" +#include "OpenSHC/IO/PackagedFileMagicNum.hpp" + +namespace OpenSHC { +namespace Map { + namespace Buildings { + + using OpenSHC::IO::PackagedFileMagicNum; + + // FUNCTION: STRONGHOLDCRUSADER 0x00424310 + void BuildingsState::applyVersionUpgradeAccessibilityRecompute( + PackagedFileMagicNum receivedMapVersion, PackagedFileMagicNum packagerMapVersion) + { + MACRO_CALL_MEMBER( + OpenSHC::Map::Buildings::BuildingsState_Func::recomputeAccessibilityForAllBuildings, this)(); + } + + } +} +} diff --git a/src/OpenSHC/Map/Buildings/BuildingsState/getBuildingFlag1.cpp b/src/OpenSHC/Map/Buildings/BuildingsState/getBuildingFlag1.cpp new file mode 100644 index 00000000..d77078c6 --- /dev/null +++ b/src/OpenSHC/Map/Buildings/BuildingsState/getBuildingFlag1.cpp @@ -0,0 +1,12 @@ +#include "OpenSHC/Map/Buildings/BuildingsState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Buildings { + + // FUNCTION: STRONGHOLDCRUSADER 0x0040F440 + int BuildingsState::getBuildingFlag1(int param_1) { return this->buildings[param_1].flag1; } + + } +} +} diff --git a/src/OpenSHC/Map/Buildings/BuildingsState/getBuildingFlag3.cpp b/src/OpenSHC/Map/Buildings/BuildingsState/getBuildingFlag3.cpp new file mode 100644 index 00000000..0bbd1f2d --- /dev/null +++ b/src/OpenSHC/Map/Buildings/BuildingsState/getBuildingFlag3.cpp @@ -0,0 +1,12 @@ +#include "OpenSHC/Map/Buildings/BuildingsState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Buildings { + + // FUNCTION: STRONGHOLDCRUSADER 0x0040F420 + int BuildingsState::getBuildingFlag3(int param_1) { return this->buildings[param_1].unknownFlag3; } + + } +} +} diff --git a/src/OpenSHC/Map/Buildings/BuildingsState/getBuildingStorageTypeForResourceType.cpp b/src/OpenSHC/Map/Buildings/BuildingsState/getBuildingStorageTypeForResourceType.cpp new file mode 100644 index 00000000..f938cfd7 --- /dev/null +++ b/src/OpenSHC/Map/Buildings/BuildingsState/getBuildingStorageTypeForResourceType.cpp @@ -0,0 +1,22 @@ +#include "OpenSHC/Map/Buildings/BuildingsState.func.hpp" +#include "OpenSHC/Game/Resources/ResourceType.hpp" +#include "OpenSHC/Map/Buildings/BuildingType.hpp" + +#include "OpenSHC/Globals/DAT_BuildingDefinedData.hpp" + +namespace OpenSHC { +namespace Map { + namespace Buildings { + + using OpenSHC::Game::Resources::ResourceType; + using OpenSHC::Map::Buildings::BuildingType; + + // FUNCTION: STRONGHOLDCRUSADER 0x0040BFD0 + BuildingType BuildingsState::getBuildingStorageTypeForResourceType(ResourceType resourceType) + { + return (BuildingType)(DAT_BuildingDefinedData::instance.StorageBuildingTypeArray[resourceType]); + } + + } +} +} diff --git a/src/OpenSHC/Map/Buildings/BuildingsState/setBuildingToAppleFarm.cpp b/src/OpenSHC/Map/Buildings/BuildingsState/setBuildingToAppleFarm.cpp new file mode 100644 index 00000000..ba414ee0 --- /dev/null +++ b/src/OpenSHC/Map/Buildings/BuildingsState/setBuildingToAppleFarm.cpp @@ -0,0 +1,12 @@ +#include "OpenSHC/Map/Buildings/BuildingsState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Buildings { + + // FUNCTION: STRONGHOLDCRUSADER 0x0040F3D0 + void BuildingsState::setBuildingToAppleFarm(int buildingID) { this->buildings[buildingID].field66_0xbe = 0x20; } + + } +} +} diff --git a/src/OpenSHC/Map/Buildings/UpdateBadBuildingCessPitOrDancingBearUnk.cpp b/src/OpenSHC/Map/Buildings/UpdateBadBuildingCessPitOrDancingBearUnk.cpp new file mode 100644 index 00000000..d6984bae --- /dev/null +++ b/src/OpenSHC/Map/Buildings/UpdateBadBuildingCessPitOrDancingBearUnk.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 0x00418F70 + void Buildings::UpdateBadBuildingCessPitOrDancingBearUnk() + { + int iVar1 = DAT_CurrentBuildingID::instance; + DAT_BuildingsState::instance.buildings[DAT_CurrentBuildingID::instance].renderAnimation = 0; + DAT_BuildingsState::instance.buildings[iVar1].displayOwnerFlag = 0; + } + +} +} diff --git a/src/OpenSHC/Map/Buildings/UpdateBuildingShared1.cpp b/src/OpenSHC/Map/Buildings/UpdateBuildingShared1.cpp new file mode 100644 index 00000000..1931c7de --- /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/LandscapeState/getRandomRockImageOffset.cpp b/src/OpenSHC/Map/LandscapeState/getRandomRockImageOffset.cpp new file mode 100644 index 00000000..e223377e --- /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 param_1) + { + return DAT_OrganismDefinedData::instance.RandomRockImageGMImageOffsets[param_1]; + } + +} +} diff --git a/src/OpenSHC/Map/MapPropertiesState/isValueInRangeOneToTwenty.cpp b/src/OpenSHC/Map/MapPropertiesState/isValueInRangeOneToTwenty.cpp new file mode 100644 index 00000000..68158533 --- /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 param_1) { return param_1 + -1 < 0x14; } + +} +} diff --git a/src/OpenSHC/Map/Navigation/PathFindingState/bindPathPlanToAlgorithmStateAndReset.cpp b/src/OpenSHC/Map/Navigation/PathFindingState/bindPathPlanToAlgorithmStateAndReset.cpp new file mode 100644 index 00000000..def1d655 --- /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/getComputationalTileIndex.cpp b/src/OpenSHC/Map/Navigation/PathFindingState/getComputationalTileIndex.cpp new file mode 100644 index 00000000..b5329ac1 --- /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 00000000..1b76cae8 --- /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 00000000..7e1e89c5 --- /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/TileMapState/getUnownedMoatCount.cpp b/src/OpenSHC/Map/TileMapState/getUnownedMoatCount.cpp new file mode 100644 index 00000000..352e8297 --- /dev/null +++ b/src/OpenSHC/Map/TileMapState/getUnownedMoatCount.cpp @@ -0,0 +1,21 @@ +#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/setMapRotation.cpp b/src/OpenSHC/Map/TileMapState/setMapRotation.cpp new file mode 100644 index 00000000..fb91f8b3 --- /dev/null +++ b/src/OpenSHC/Map/TileMapState/setMapRotation.cpp @@ -0,0 +1,10 @@ +#include "OpenSHC/Map/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/toggleFlatView.cpp b/src/OpenSHC/Map/TileMapState/toggleFlatView.cpp new file mode 100644 index 00000000..becb2628 --- /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 param_1) + { + if (param_1 != this->flatViewToggleValue1) { + this->flatViewToggleValue1 = param_1; + this->flatViewToggleValue2 = param_1; + } + } + +} +} diff --git a/src/OpenSHC/Map/Units/CheckUnitProductionPaused.cpp b/src/OpenSHC/Map/Units/CheckUnitProductionPaused.cpp new file mode 100644 index 00000000..5c1b88a5 --- /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 param_1) + { + return DAT_UnitsState::instance.units[param_1].field166_0x2fe == 1; + } + +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/markTribeAsAnimalTribe.cpp b/src/OpenSHC/Map/Units/TribesState/markTribeAsAnimalTribe.cpp new file mode 100644 index 00000000..e6423dbb --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/markTribeAsAnimalTribe.cpp @@ -0,0 +1,12 @@ +#include "OpenSHC/Map/Units/TribesState.func.hpp" + +namespace OpenSHC { +namespace Map { + namespace Units { + + // FUNCTION: STRONGHOLDCRUSADER 0x00523730 + void TribesState::markTribeAsAnimalTribe(int param_1) { this->tribes[param_1].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 00000000..c2d0d337 --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/playArcherCommandSpeech.cpp @@ -0,0 +1,25 @@ +#include "OpenSHC/Audio/SFX/SFXState.func.hpp" +#include "OpenSHC/Map/Units/TribesState.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) + { + int actionID = 0x1f; + UnitType _majorityUnitType = MACRO_CALL_MEMBER( + OpenSHC::Map::Units::TribesState_Func::getMajorityArcherTypeEuropeanOrArabian, this)(selectionID); + MACRO_CALL_MEMBER(OpenSHC::Audio::SFX::SFXState_Func::playUnitSpeech, DAT_SFXState::ptr)( + _majorityUnitType, actionID); + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/TribesState/playTunnelerCommandSpeech.cpp b/src/OpenSHC/Map/Units/TribesState/playTunnelerCommandSpeech.cpp new file mode 100644 index 00000000..fe8e7bf9 --- /dev/null +++ b/src/OpenSHC/Map/Units/TribesState/playTunnelerCommandSpeech.cpp @@ -0,0 +1,22 @@ +#include "OpenSHC/Audio/SFX/SFXState.func.hpp" +#include "OpenSHC/Map/Units/TribesState.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/TroopValueState/constructTroopValueState.cpp b/src/OpenSHC/Map/Units/TroopValueState/constructTroopValueState.cpp new file mode 100644 index 00000000..acfc2761 --- /dev/null +++ b/src/OpenSHC/Map/Units/TroopValueState/constructTroopValueState.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::constructTroopValueState() + { + MACRO_CALL_MEMBER(OpenSHC::Map::Units::TroopValueState_Func::clearAttackInfo, this)(); + return this; + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/getArmySize.cpp b/src/OpenSHC/Map/Units/UnitsState/getArmySize.cpp new file mode 100644 index 00000000..cb7d8835 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/getArmySize.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/Map/Units/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/queueStopCommand.cpp b/src/OpenSHC/Map/Units/UnitsState/queueStopCommand.cpp new file mode 100644 index 00000000..33cea6a5 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/queueStopCommand.cpp @@ -0,0 +1,23 @@ +#include "OpenSHC/Map/Units/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 0x00536C70 + void UnitsState::queueStopCommand() + { + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)( + (GameCommandType)0xf); + } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/relayTribeInstruction.cpp b/src/OpenSHC/Map/Units/UnitsState/relayTribeInstruction.cpp new file mode 100644 index 00000000..30028e08 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/relayTribeInstruction.cpp @@ -0,0 +1,22 @@ +#include "OpenSHC/Map/Units/TribesState.func.hpp" +#include "OpenSHC/Map/Units/UnitsState.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 00000000..06a3245d --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/returnFalseStub.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/Map/Units/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() { return FALSE; } + + } +} +} diff --git a/src/OpenSHC/Map/Units/UnitsState/selectionHasArchers.cpp b/src/OpenSHC/Map/Units/UnitsState/selectionHasArchers.cpp new file mode 100644 index 00000000..03edc06d --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/selectionHasArchers.cpp @@ -0,0 +1,33 @@ +#include "OpenSHC/Map/Units/UnitsState.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + + + + + +namespace OpenSHC { +namespace Map { +namespace Units { + +using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + +/* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + + +// FUNCTION: STRONGHOLDCRUSADER 0x00535560 +BOOLEnum UnitsState::selectionHasArchers() + +{ +if (this->selectionEuropeanArchers != 0) { +return TRUE; +} +return (uint)(this->selectionArabArcher != 0); +} + + +} +} +} \ No newline at end of file diff --git a/src/OpenSHC/Map/Units/UnitsState/selectionHasEngineers.cpp b/src/OpenSHC/Map/Units/UnitsState/selectionHasEngineers.cpp new file mode 100644 index 00000000..c4755947 --- /dev/null +++ b/src/OpenSHC/Map/Units/UnitsState/selectionHasEngineers.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/Map/Units/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/Version/UpdateDestroyedBuildingCountData.cpp b/src/OpenSHC/Map/Version/UpdateDestroyedBuildingCountData.cpp new file mode 100644 index 00000000..85a59922 --- /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 param_1) + { + DAT_DestroyedBuildingsCountHistory::instance[0] = DAT_DestroyedBuildingsCountHistory::instance[0] + param_1; + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpdateUnitLossData.cpp b/src/OpenSHC/Map/Version/UpdateUnitLossData.cpp new file mode 100644 index 00000000..a131fecc --- /dev/null +++ b/src/OpenSHC/Map/Version/UpdateUnitLossData.cpp @@ -0,0 +1,24 @@ +#include "OpenSHC/Map/Version.func.hpp" + +#include "OpenSHC/Globals/DAT_UnitValueLossesPerEnemyPlayer.hpp" + +namespace OpenSHC { +namespace Map { + + /* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + + // FUNCTION: STRONGHOLDCRUSADER 0x0044AA80 + void __cdecl Version::UpdateUnitLossData(int lossValue, int playerID) + + { + if (lossValue < 0) { + DAT_UnitValueLossesPerEnemyPlayer::instance[playerID] + = DAT_UnitValueLossesPerEnemyPlayer::instance[playerID] - lossValue; + } + return; + } + +} +} diff --git a/src/OpenSHC/Map/Version/UpgradeSetCurrentEntityID3000.cpp b/src/OpenSHC/Map/Version/UpgradeSetCurrentEntityID3000.cpp new file mode 100644 index 00000000..97b23d68 --- /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/WildlifeState/clearWildlifeState.cpp b/src/OpenSHC/Map/WildlifeState/clearWildlifeState.cpp new file mode 100644 index 00000000..9f810b72 --- /dev/null +++ b/src/OpenSHC/Map/WildlifeState/clearWildlifeState.cpp @@ -0,0 +1,17 @@ +#include "OpenSHC/IO/LowLevelMemory.func.hpp" +#include "OpenSHC/Map/WildlifeState.func.hpp" + +#include "OpenSHC/Globals/DAT_LowLevelMemory.hpp" + +namespace OpenSHC { +namespace Map { + + // FUNCTION: STRONGHOLDCRUSADER 0x0052B9F0 + void WildlifeState::clearWildlifeState() + { + MACRO_CALL_MEMBER(OpenSHC::IO::LowLevelMemory_Func::fillMemory_ByteValue, DAT_LowLevelMemory::ptr)( + 256000, '\0', this); + } + +} +} diff --git a/src/OpenSHC/OS/OS.cpp b/src/OpenSHC/OS/OS.cpp index 1200943c..05797263 100644 --- a/src/OpenSHC/OS/OS.cpp +++ b/src/OpenSHC/OS/OS.cpp @@ -46,10 +46,10 @@ namespace OS { // This seems to be the games main free function // STUB: STRONGHOLDCRUSADER 0x0057FA74 - void __cdecl _free_base(void* _Memory) { free(_Memory); } + void _free_base(void* _Memory) { free(_Memory); } // STUB: STRONGHOLDCRUSADER 0x0057FC19 - int __cdecl __tolower(int _C) { return tolower(_C); }; + int __tolower(int _C) { return tolower(_C); }; // STUB: STRONGHOLDCRUSADER 0x0057FCB2 int _fclose(FILE* _File) { return fclose(_File); } @@ -67,7 +67,7 @@ namespace OS { long _ftell(FILE* _File) { return ftell(_File); } // STUB: STRONGHOLDCRUSADER 0x00580384 - int __cdecl _fseek(FILE* _File, long _Offset, DWORD _Origin) { return fseek(_File, _Offset, _Origin); } + int _fseek(FILE* _File, long _Offset, DWORD _Origin) { return fseek(_File, _Offset, _Origin); } // STUB: STRONGHOLDCRUSADER 0x005804CD FILE* _fopen(char const* _Filename, char const* _Mode) { return fopen(_Filename, _Mode); } @@ -89,7 +89,7 @@ namespace OS { // Only jumps to _free in game version // STUB: STRONGHOLDCRUSADER 0x00580DC1 - void __cdecl _free(void* _Memory) { free(_Memory); } + void _free(void* _Memory) { free(_Memory); } // STUB: STRONGHOLDCRUSADER 0x00580DC6 errno_t _memcpy_s(void* _Dst, rsize_t _DstSize, void* _Src, rsize_t _MaxCount) @@ -99,7 +99,7 @@ namespace OS { // Only jumps to _free // STUB: STRONGHOLDCRUSADER 0x00580E9C - void __cdecl _free_cpp(void* _Memory) { free(_Memory); } + void _free_cpp(void* _Memory) { free(_Memory); } // STUB: STRONGHOLDCRUSADER 0x00580F38 int _ucrt_close(int fileDescriptor) { return _close(fileDescriptor); } @@ -126,10 +126,10 @@ namespace OS { void* _memcpy(void* _Dst, void* _Src, size_t _Size) { return memcpy(_Dst, _Src, _Size); } // STUB: STRONGHOLDCRUSADER 0x005824CD - int __cdecl __toupper(int _C) { return toupper(_C); } + int __toupper(int _C) { return toupper(_C); } // STUB: STRONGHOLDCRUSADER 0x005826FB - int __cdecl _ucrt_tell(int handle) { return _tell(handle); } + int _ucrt_tell(int handle) { return _tell(handle); } // STUB: STRONGHOLDCRUSADER 0x0058277E int _ucrt_lseek(int fileDescriptor, long lDistanceToMove, DWORD moveMethod) diff --git a/src/OpenSHC/Random/RNG/setTimeBasedSeed.cpp b/src/OpenSHC/Random/RNG/setTimeBasedSeed.cpp index 5d469e1c..41dad9fc 100644 --- a/src/OpenSHC/Random/RNG/setTimeBasedSeed.cpp +++ b/src/OpenSHC/Random/RNG/setTimeBasedSeed.cpp @@ -8,11 +8,7 @@ namespace OpenSHC { namespace Random { // FUNCTION: STRONGHOLDCRUSADER 0x0046A740 - void RNG::setTimeBasedSeed() - { - __time64_t time = MACRO_CALL(OpenSHC::OS_Func::__time64)((__time64_t*)0x0); - this->seed = (int)time; - } + void RNG::setTimeBasedSeed() { this->seed = (__time64_t)MACRO_CALL(OpenSHC::OS_Func::__time64)((__time64_t*)0x0); } } } diff --git a/src/OpenSHC/Rendering/Bink/AIMessageQueue/playNextStoredBinkVideo.cpp b/src/OpenSHC/Rendering/Bink/AIMessageQueue/playNextStoredBinkVideo.cpp new file mode 100644 index 00000000..d1f1154c --- /dev/null +++ b/src/OpenSHC/Rendering/Bink/AIMessageQueue/playNextStoredBinkVideo.cpp @@ -0,0 +1,22 @@ +#include "OpenSHC/Rendering/Bink/AIMessageQueue.func.hpp" +#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" + +namespace OpenSHC { +namespace Rendering { + namespace Bink { + + using OpenSHC::WindowsHelper::Enums::BOOLEnum; + + // FUNCTION: STRONGHOLDCRUSADER 0x004C62A0 + void AIMessageQueue::playNextStoredBinkVideo() + + { + if (this->messagePlaying_0x0 != FALSE) { + MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::AIMessageQueue_Func::playNextStoredAIMessage, this)(); + } + this->storedMessages_0x924 = 0; + } + + } +} +} diff --git a/src/OpenSHC/Rendering/Bink/BinkControlClass/stopAllBinkPlayback.cpp b/src/OpenSHC/Rendering/Bink/BinkControlClass/stopAllBinkPlayback.cpp new file mode 100644 index 00000000..f7815eb7 --- /dev/null +++ b/src/OpenSHC/Rendering/Bink/BinkControlClass/stopAllBinkPlayback.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/Rendering/Bink/BinkControlClass.func.hpp" + +namespace OpenSHC { +namespace Rendering { + namespace Bink { + + // FUNCTION: STRONGHOLDCRUSADER 0x00408EB0 + void BinkControlClass::stopAllBinkPlayback() + { + for (int binkObjIndex = 0; binkObjIndex < 2; binkObjIndex++) + MACRO_CALL_MEMBER(BinkControlClass_Func::stopBinkPlayback, this)(binkObjIndex); + } + + } // namespace Bink +} // namespace Rendering +} // namespace OpenSHC diff --git a/src/OpenSHC/Rendering/Bink/BinkControlClass/stopAllBinkPlaybackThunk.cpp b/src/OpenSHC/Rendering/Bink/BinkControlClass/stopAllBinkPlaybackThunk.cpp new file mode 100644 index 00000000..fe5c0ce5 --- /dev/null +++ b/src/OpenSHC/Rendering/Bink/BinkControlClass/stopAllBinkPlaybackThunk.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/Rendering/Bink/BinkControlClass.func.hpp" + +namespace OpenSHC { +namespace Rendering { + namespace Bink { + + // FUNCTION: STRONGHOLDCRUSADER 0x004092B0 + void BinkControlClass::stopAllBinkPlaybackThunk() + { + MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::BinkControlClass_Func::stopAllBinkPlayback, this)(); + } + + } +} +} diff --git a/src/OpenSHC/Rendering/ViewportRenderState/computeTileXOffset.cpp b/src/OpenSHC/Rendering/ViewportRenderState/computeTileXOffset.cpp new file mode 100644 index 00000000..b30fabf6 --- /dev/null +++ b/src/OpenSHC/Rendering/ViewportRenderState/computeTileXOffset.cpp @@ -0,0 +1,13 @@ +#include "OpenSHC/Rendering/ViewportRenderState.func.hpp" + +namespace OpenSHC { +namespace Rendering { + + // FUNCTION: STRONGHOLDCRUSADER 0x004092E0 + int ViewportRenderState::computeTileXOffset(int param_1, int param_2) + { + return param_1 - this->translationMatrix[param_2].addXgetTile; + } + +} +} diff --git a/src/OpenSHC/Rendering/ViewportRenderState/focusOnCoordinate.cpp b/src/OpenSHC/Rendering/ViewportRenderState/focusOnCoordinate.cpp new file mode 100644 index 00000000..a2a9c1d2 --- /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/resetupViewportThunk.cpp b/src/OpenSHC/Rendering/ViewportRenderState/resetupViewportThunk.cpp new file mode 100644 index 00000000..d3eb6027 --- /dev/null +++ b/src/OpenSHC/Rendering/ViewportRenderState/resetupViewportThunk.cpp @@ -0,0 +1,14 @@ +#include "OpenSHC/Rendering/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 00000000..41736049 --- /dev/null +++ b/src/OpenSHC/Rendering/ViewportRenderState/restoreFocusTile.cpp @@ -0,0 +1,13 @@ +#include "OpenSHC/Rendering/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 00000000..fb37d0e2 --- /dev/null +++ b/src/OpenSHC/Rendering/ViewportRenderState/translateXYToTile.cpp @@ -0,0 +1,10 @@ +#include "OpenSHC/Rendering/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/Synchrony/Actions/ChangeRations.cpp b/src/OpenSHC/Synchrony/Actions/ChangeRations.cpp new file mode 100644 index 00000000..d627dde8 --- /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 00000000..dae8f1c0 --- /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/Commands/QueueChangeGameIntensityOrBalance.cpp b/src/OpenSHC/Synchrony/Commands/QueueChangeGameIntensityOrBalance.cpp new file mode 100644 index 00000000..a285da65 --- /dev/null +++ b/src/OpenSHC/Synchrony/Commands/QueueChangeGameIntensityOrBalance.cpp @@ -0,0 +1,23 @@ +#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 00000000..3336d85a --- /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/computeSomeHashOnUnitArray.cpp b/src/OpenSHC/Synchrony/GameSynchronyState/computeSomeHashOnUnitArray.cpp new file mode 100644 index 00000000..0ce2b524 --- /dev/null +++ b/src/OpenSHC/Synchrony/GameSynchronyState/computeSomeHashOnUnitArray.cpp @@ -0,0 +1,18 @@ +#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 (int)(MACRO_CALL_MEMBER(OpenSHC::Map::Navigation::DirectionAlgorithmState_Func::computeHash, + DAT_DirectionAlgorithmState::ptr)(2920000, (int*)((int)(DAT_UnitsState::instance.units)))); + } + +} +} diff --git a/src/OpenSHC/Synchrony/GameSynchronyState/getGameCommandArrayIndex.cpp b/src/OpenSHC/Synchrony/GameSynchronyState/getGameCommandArrayIndex.cpp new file mode 100644 index 00000000..fb01abc8 --- /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/Text/TextEditorState/getNextHelpColorEntryIndex.cpp b/src/OpenSHC/Text/TextEditorState/getNextHelpColorEntryIndex.cpp new file mode 100644 index 00000000..4414ada2 --- /dev/null +++ b/src/OpenSHC/Text/TextEditorState/getNextHelpColorEntryIndex.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/Text/TextEditorState.func.hpp" + +#include "OpenSHC/Globals/DAT_UserHelpDefinedData.hpp" + +namespace OpenSHC { +namespace Text { + + // FUNCTION: STRONGHOLDCRUSADER 0x0045DA20 + int TextEditorState::getNextHelpColorEntryIndex(int param_1) + { + int iVar1 = param_1 + 1; + if (DAT_UserHelpDefinedData::instance.field6_0x7a16c[iVar1].name_0x0 == (char*)NULL) { + iVar1 = 0; + } + return iVar1; + } + +} +} diff --git a/src/OpenSHC/Text/TextEditorState/renderHelpDialogIfOpen.cpp b/src/OpenSHC/Text/TextEditorState/renderHelpDialogIfOpen.cpp new file mode 100644 index 00000000..5f5756a5 --- /dev/null +++ b/src/OpenSHC/Text/TextEditorState/renderHelpDialogIfOpen.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/Text/TextEditorState.func.hpp" + +namespace OpenSHC { +namespace Text { + + // FUNCTION: STRONGHOLDCRUSADER 0x00461550 + void TextEditorState::renderHelpDialogIfOpen() + { + if (this->isDialogStateInitialized != 0) { + MACRO_CALL_MEMBER(OpenSHC::Text::TextEditorState_Func::drawHelpWindowBackground, this)(); + MACRO_CALL_MEMBER(OpenSHC::Text::TextEditorState_Func::setTextRenderingLogic, this)(); + } + } + +} +} diff --git a/src/OpenSHC/Text/TextManager/getCharWidth.cpp b/src/OpenSHC/Text/TextManager/getCharWidth.cpp new file mode 100644 index 00000000..d7a95432 --- /dev/null +++ b/src/OpenSHC/Text/TextManager/getCharWidth.cpp @@ -0,0 +1,17 @@ +#include "OpenSHC/Text/FontSizeClass.func.hpp" +#include "OpenSHC/Text/TextManager.func.hpp" + +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" + +namespace OpenSHC { +namespace Text { + + // FUNCTION: STRONGHOLDCRUSADER 0x0046A720 + int TextManager::getCharWidth(char character, int fontSize) + { + return MACRO_CALL_MEMBER(OpenSHC::Text::FontSizeClass_Func::getCharWidthUnk, + &DAT_TextManagerObject::instance.fontSizeClassArray[fontSize])(character); + } + +} +} diff --git a/src/OpenSHC/Text/TextManager/resetTextClipRange.cpp b/src/OpenSHC/Text/TextManager/resetTextClipRange.cpp new file mode 100644 index 00000000..d9690eb3 --- /dev/null +++ b/src/OpenSHC/Text/TextManager/resetTextClipRange.cpp @@ -0,0 +1,29 @@ +#include "OpenSHC/Text/TextManager.func.hpp" + + + + + +namespace OpenSHC { +namespace Text { + + + + +/* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + + +// FUNCTION: STRONGHOLDCRUSADER 0x00469F40 +void TextManager::resetTextClipRange() + +{ +this->field2_0x8 = 0; +this->field3_0xc = 10000; +return; +} + + +} +} \ No newline at end of file diff --git a/src/OpenSHC/Text/TextManager/setTextClipRange.cpp b/src/OpenSHC/Text/TextManager/setTextClipRange.cpp new file mode 100644 index 00000000..d08882ca --- /dev/null +++ b/src/OpenSHC/Text/TextManager/setTextClipRange.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/Text/TextManager.func.hpp" + +namespace OpenSHC { +namespace Text { + + // FUNCTION: STRONGHOLDCRUSADER 0x00469F20 + void TextManager::setTextClipRange(dword param_1, dword param_2) + + { + this->field2_0x8 = param_1; + this->field3_0xc = param_2; + } + +} +} diff --git a/src/OpenSHC/Text/UserTextHandler/getCurrentFontSize.cpp b/src/OpenSHC/Text/UserTextHandler/getCurrentFontSize.cpp new file mode 100644 index 00000000..c713f3da --- /dev/null +++ b/src/OpenSHC/Text/UserTextHandler/getCurrentFontSize.cpp @@ -0,0 +1,10 @@ +#include "OpenSHC/Text/UserTextHandler.func.hpp" + +namespace OpenSHC { +namespace Text { + + // FUNCTION: STRONGHOLDCRUSADER 0x00469860 + int UserTextHandler::getCurrentFontSize() { return this->textArrayFontSizes[this->textArrayIndex]; } + +} +} diff --git a/src/OpenSHC/Text/UserTextHandler/getCurrentText.cpp b/src/OpenSHC/Text/UserTextHandler/getCurrentText.cpp new file mode 100644 index 00000000..6c088050 --- /dev/null +++ b/src/OpenSHC/Text/UserTextHandler/getCurrentText.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/Text/UserTextHandler.func.hpp" + +namespace OpenSHC { +namespace Text { + + // FUNCTION: STRONGHOLDCRUSADER 0x004697C0 + char* UserTextHandler::getCurrentText() + { + if (this->unknown01 == 0) { + return (char*)NULL; + } + return this->textArray[this->textArrayIndex]; + } + +} +} diff --git a/src/OpenSHC/Text/UserTextHandler/getTextArrayPointer.cpp b/src/OpenSHC/Text/UserTextHandler/getTextArrayPointer.cpp new file mode 100644 index 00000000..b95880dd --- /dev/null +++ b/src/OpenSHC/Text/UserTextHandler/getTextArrayPointer.cpp @@ -0,0 +1,10 @@ +#include "OpenSHC/Text/UserTextHandler.func.hpp" + +namespace OpenSHC { +namespace Text { + + // FUNCTION: STRONGHOLDCRUSADER 0x004697E0 + char* UserTextHandler::getTextArrayPointer(int param_1) { return this->textArray[param_1]; } + +} +} diff --git a/src/OpenSHC/Text/UserTextHandler/handleLeftKey.cpp b/src/OpenSHC/Text/UserTextHandler/handleLeftKey.cpp new file mode 100644 index 00000000..5cb56e28 --- /dev/null +++ b/src/OpenSHC/Text/UserTextHandler/handleLeftKey.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/Text/UserTextHandler.func.hpp" + +namespace OpenSHC { +namespace Text { + + // FUNCTION: STRONGHOLDCRUSADER 0x004698A0 + void UserTextHandler::handleLeftKey() + { + if (0 < this->textCursorIndexArray[this->textArrayIndex]) { + this->textCursorIndexArray[this->textArrayIndex] -= 1; + } + } + +} +} diff --git a/src/OpenSHC/Text/UserTextHandler/handleReturnKey.cpp b/src/OpenSHC/Text/UserTextHandler/handleReturnKey.cpp new file mode 100644 index 00000000..52a58801 --- /dev/null +++ b/src/OpenSHC/Text/UserTextHandler/handleReturnKey.cpp @@ -0,0 +1,10 @@ +#include "OpenSHC/Text/UserTextHandler.func.hpp" + +namespace OpenSHC { +namespace Text { + + // FUNCTION: STRONGHOLDCRUSADER 0x00469870 + void UserTextHandler::handleReturnKey() { this->returnPressed = 1; } + +} +} diff --git a/src/OpenSHC/Text/UserTextHandler/handleRightKey.cpp b/src/OpenSHC/Text/UserTextHandler/handleRightKey.cpp new file mode 100644 index 00000000..dcf317bd --- /dev/null +++ b/src/OpenSHC/Text/UserTextHandler/handleRightKey.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/Text/UserTextHandler.func.hpp" + +namespace OpenSHC { +namespace Text { + + // FUNCTION: STRONGHOLDCRUSADER 0x00469880 + void UserTextHandler::handleRightKey() + { + if (this->textCursorIndexArray[this->textArrayIndex] < this->textContentLengthArray[this->textArrayIndex]) { + this->textCursorIndexArray[this->textArrayIndex] += 1; + } + } + +} +} diff --git a/src/OpenSHC/Text/UserTextHandler/moveCursorToEnd.cpp b/src/OpenSHC/Text/UserTextHandler/moveCursorToEnd.cpp new file mode 100644 index 00000000..b884aa34 --- /dev/null +++ b/src/OpenSHC/Text/UserTextHandler/moveCursorToEnd.cpp @@ -0,0 +1,14 @@ +#include "OpenSHC/Text/UserTextHandler.hpp" + +namespace OpenSHC { + +namespace Text { + + // FUNCTION: STRONGHOLDCRUSADER 0x004698d0 + void UserTextHandler::moveCursorToEnd() + { + this->textCursorIndexArray[this->textArrayIndex] = this->textContentLengthArray[this->textArrayIndex]; + } + +} +} diff --git a/src/OpenSHC/Text/UserTextHandler/resetCursorToStart.cpp b/src/OpenSHC/Text/UserTextHandler/resetCursorToStart.cpp new file mode 100644 index 00000000..1b1ca3d2 --- /dev/null +++ b/src/OpenSHC/Text/UserTextHandler/resetCursorToStart.cpp @@ -0,0 +1,10 @@ +#include "OpenSHC/Text/UserTextHandler.func.hpp" + +namespace OpenSHC { +namespace Text { + + // FUNCTION: STRONGHOLDCRUSADER 0x004698C0 + void UserTextHandler::resetCursorToStart() { this->textCursorIndexArray[this->textArrayIndex] = 0; } + +} +} diff --git a/src/OpenSHC/UI/CaptureCurrentTimeToUnknownTime01.cpp b/src/OpenSHC/UI/CaptureCurrentTimeToUnknownTime01.cpp new file mode 100644 index 00000000..2dec9bba --- /dev/null +++ b/src/OpenSHC/UI/CaptureCurrentTimeToUnknownTime01.cpp @@ -0,0 +1,10 @@ +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_UnknownTime_01.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x004B9610 +void UI::CaptureCurrentTimeToUnknownTime01() { DAT_UnknownTime_01::instance = timeGetTime(); } + +} diff --git a/src/OpenSHC/UI/DisableMercPostPortraits.cpp b/src/OpenSHC/UI/DisableMercPostPortraits.cpp new file mode 100644 index 00000000..a29b6169 --- /dev/null +++ b/src/OpenSHC/UI/DisableMercPostPortraits.cpp @@ -0,0 +1,10 @@ +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_DisableMercPostPortraits.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x00466E10 +void UI::DisableMercPostPortraits() { DAT_DisableMercPostPortraits::instance = 1; } + +} diff --git a/src/OpenSHC/UI/Helpers/SetEnoughGoldForRequestedUnitToTrueUnk.cpp b/src/OpenSHC/UI/Helpers/SetEnoughGoldForRequestedUnitToTrueUnk.cpp new file mode 100644 index 00000000..22b974ab --- /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/SumUnitPoints.cpp b/src/OpenSHC/UI/Helpers/SumUnitPoints.cpp new file mode 100644 index 00000000..3dfb0682 --- /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/HoveredState/clearHoveredState.cpp b/src/OpenSHC/UI/HoveredState/clearHoveredState.cpp new file mode 100644 index 00000000..b9664fc1 --- /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/LoadTGX_shc_back.cpp b/src/OpenSHC/UI/LoadTGX_shc_back.cpp new file mode 100644 index 00000000..cbaa7741 --- /dev/null +++ b/src/OpenSHC/UI/LoadTGX_shc_back.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/UI.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x00424BD0 +void UI::LoadTGX_shc_back() +{ + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + "shc_back.tgx"); +} + +} diff --git a/src/OpenSHC/UI/MenuItemActionHandler_BuildingAndStatusMenu_BuildingHelpTextButton.cpp b/src/OpenSHC/UI/MenuItemActionHandler_BuildingAndStatusMenu_BuildingHelpTextButton.cpp new file mode 100644 index 00000000..3b6072a8 --- /dev/null +++ b/src/OpenSHC/UI/MenuItemActionHandler_BuildingAndStatusMenu_BuildingHelpTextButton.cpp @@ -0,0 +1,18 @@ +#include "OpenSHC/Text/TextEditorState.func.hpp" +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" +#include "OpenSHC/Globals/DAT_TextEditorState.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x0043A860 +void UI::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/MenuItemActionHandler_BuildingAndStatusMenu_PopularityMenuSwitchButtonUnk.cpp b/src/OpenSHC/UI/MenuItemActionHandler_BuildingAndStatusMenu_PopularityMenuSwitchButtonUnk.cpp new file mode 100644 index 00000000..afc23912 --- /dev/null +++ b/src/OpenSHC/UI/MenuItemActionHandler_BuildingAndStatusMenu_PopularityMenuSwitchButtonUnk.cpp @@ -0,0 +1,13 @@ +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x0043F2B0 +void UI::MenuItemActionHandler_BuildingAndStatusMenu_PopularityMenuSwitchButtonUnk() +{ + DAT_GameCore::instance.field80_0x144 = DAT_GameCore::instance.field80_0x144 ^ 1; +} + +} diff --git a/src/OpenSHC/UI/MenuItemActionHandler_BuildingAndStatusMenu_UnknownMin1Unk.cpp b/src/OpenSHC/UI/MenuItemActionHandler_BuildingAndStatusMenu_UnknownMin1Unk.cpp new file mode 100644 index 00000000..9b89280d --- /dev/null +++ b/src/OpenSHC/UI/MenuItemActionHandler_BuildingAndStatusMenu_UnknownMin1Unk.cpp @@ -0,0 +1,10 @@ +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/INT_00df335c.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x00464D90 +void UI::MenuItemActionHandler_BuildingAndStatusMenu_UnknownMin1Unk() { INT_00df335c::instance = -1; } + +} diff --git a/src/OpenSHC/UI/MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Countdown.cpp b/src/OpenSHC/UI/MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Countdown.cpp new file mode 100644 index 00000000..27ee080d --- /dev/null +++ b/src/OpenSHC/UI/MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Countdown.cpp @@ -0,0 +1,10 @@ +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x0043A850 +void UI::MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Countdown() { DAT_GameCore::instance.countdown = 1; } + +} diff --git a/src/OpenSHC/UI/MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Min1.cpp b/src/OpenSHC/UI/MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Min1.cpp new file mode 100644 index 00000000..cdd10b3d --- /dev/null +++ b/src/OpenSHC/UI/MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Min1.cpp @@ -0,0 +1,10 @@ +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_00df3350.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x004649C0 +void UI::MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Min1() { DAT_00df3350::instance = 0xffffffff; } + +} diff --git a/src/OpenSHC/UI/MenuItemActionHandler_Chat_TauntButtons.cpp b/src/OpenSHC/UI/MenuItemActionHandler_Chat_TauntButtons.cpp new file mode 100644 index 00000000..caed3023 --- /dev/null +++ b/src/OpenSHC/UI/MenuItemActionHandler_Chat_TauntButtons.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/UI.func.hpp" +#include "OpenSHC/Commands/GameCommandType.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { + +using OpenSHC::Commands::GameCommandType; + +// FUNCTION: STRONGHOLDCRUSADER 0x0048F850 +void UI::MenuItemActionHandler_Chat_TauntButtons(int param_1, ...) +{ + DAT_GameSynchronyState::instance.DAT_ChatTauntOrMessage = param_1; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, DAT_GameSynchronyState::ptr)( + OpenSHC::Commands::GCT_TAUNT_OR_CHAT); +} + +} diff --git a/src/OpenSHC/UI/MenuItemActionHandler_ChooseNetworkServiceProvider_ModemTableRows.cpp b/src/OpenSHC/UI/MenuItemActionHandler_ChooseNetworkServiceProvider_ModemTableRows.cpp new file mode 100644 index 00000000..1d46e798 --- /dev/null +++ b/src/OpenSHC/UI/MenuItemActionHandler_ChooseNetworkServiceProvider_ModemTableRows.cpp @@ -0,0 +1,17 @@ +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x0047D0E0 +void UI::MenuItemActionHandler_ChooseNetworkServiceProvider_ModemTableRows(int param_1, ...) + +{ + if (DAT_GameSynchronyState::instance.modemScrollBarOffset + param_1 + < DAT_GameSynchronyState::instance.modemScrollbarCount) { + DAT_GameSynchronyState::instance.modemScrollbarIndex = param_1; + } +} + +} diff --git a/src/OpenSHC/UI/MenuItemActionHandler_FindingNetworkSessions_EnumerateDPlaySessions.cpp b/src/OpenSHC/UI/MenuItemActionHandler_FindingNetworkSessions_EnumerateDPlaySessions.cpp new file mode 100644 index 00000000..77918da0 --- /dev/null +++ b/src/OpenSHC/UI/MenuItemActionHandler_FindingNetworkSessions_EnumerateDPlaySessions.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x0048BF70 +void UI::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/MenuItemActionHandler_FindingNetworkSessions_TableRows.cpp b/src/OpenSHC/UI/MenuItemActionHandler_FindingNetworkSessions_TableRows.cpp new file mode 100644 index 00000000..0cac54c2 --- /dev/null +++ b/src/OpenSHC/UI/MenuItemActionHandler_FindingNetworkSessions_TableRows.cpp @@ -0,0 +1,17 @@ +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x0047D3F0 +void UI::MenuItemActionHandler_FindingNetworkSessions_TableRows(int param_1, ...) + +{ + if (DAT_GameSynchronyState::instance.scrollBarItemOffset + param_1 + < DAT_GameSynchronyState::instance.DPLAY_SessionsCount) { + DAT_GameSynchronyState::instance.scrollBarIndex = param_1; + } +} + +} diff --git a/src/OpenSHC/UI/MenuItemActionHandler_General_DisplayConditionalText.cpp b/src/OpenSHC/UI/MenuItemActionHandler_General_DisplayConditionalText.cpp new file mode 100644 index 00000000..51354f3c --- /dev/null +++ b/src/OpenSHC/UI/MenuItemActionHandler_General_DisplayConditionalText.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/UI.func.hpp" +#include "OpenSHC/UI/BottomLeftTextDisplayState.func.hpp" + +#include "OpenSHC/Globals/DAT_BottomLeftTextDisplayState.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x004F6A60 +void UI::MenuItemActionHandler_General_DisplayConditionalText(int param_1, ...) +{ + MACRO_CALL_MEMBER(OpenSHC::UI::BottomLeftTextDisplayState_Func::renderCurrentlyDisplayedTextConstructionCost, + DAT_BottomLeftTextDisplayState::ptr)(param_1); +} + +} diff --git a/src/OpenSHC/UI/MenuItemActionHandler_General_RemoveConditionalTextOrReleaseHoverUnk.cpp b/src/OpenSHC/UI/MenuItemActionHandler_General_RemoveConditionalTextOrReleaseHoverUnk.cpp new file mode 100644 index 00000000..34bce71c --- /dev/null +++ b/src/OpenSHC/UI/MenuItemActionHandler_General_RemoveConditionalTextOrReleaseHoverUnk.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/UI.func.hpp" +#include "OpenSHC/UI/BottomLeftTextDisplayState.func.hpp" + +#include "OpenSHC/Globals/DAT_BottomLeftTextDisplayState.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x004F6A70 +void UI::MenuItemActionHandler_General_RemoveConditionalTextOrReleaseHoverUnk(int param_1, ...) +{ + MACRO_CALL_MEMBER(OpenSHC::UI::BottomLeftTextDisplayState_Func::hasPassedCountdownOrDuration, + DAT_BottomLeftTextDisplayState::ptr)(); +} + +} diff --git a/src/OpenSHC/UI/MenuItemActionHandler_General_Unknown2.cpp b/src/OpenSHC/UI/MenuItemActionHandler_General_Unknown2.cpp new file mode 100644 index 00000000..32f61b0e --- /dev/null +++ b/src/OpenSHC/UI/MenuItemActionHandler_General_Unknown2.cpp @@ -0,0 +1,10 @@ +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x00434260 +void UI::MenuItemActionHandler_General_Unknown2(int param_1, ...) { DAT_GameCore::instance.field12_0x30 = param_1; } + +} diff --git a/src/OpenSHC/UI/MenuItemActionHandler_NetworkOptions_LeaveButtonUnk.cpp b/src/OpenSHC/UI/MenuItemActionHandler_NetworkOptions_LeaveButtonUnk.cpp new file mode 100644 index 00000000..2912f089 --- /dev/null +++ b/src/OpenSHC/UI/MenuItemActionHandler_NetworkOptions_LeaveButtonUnk.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/UI.func.hpp" +#include "OpenSHC/UI/MenuTextInputState.func.hpp" + +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x004941F0 +void UI::MenuItemActionHandler_NetworkOptions_LeaveButtonUnk(int param_1, ...) +{ + if (param_1 == 0x11) { + MACRO_CALL_MEMBER(OpenSHC::UI::MenuTextInputState_Func::popModalDialog, DAT_MenuTextInputState::ptr)(); + } +} + +} diff --git a/src/OpenSHC/UI/MenuItemActionHandler_UnusedOldTitleMenu_General.cpp b/src/OpenSHC/UI/MenuItemActionHandler_UnusedOldTitleMenu_General.cpp new file mode 100644 index 00000000..33e1ff0f --- /dev/null +++ b/src/OpenSHC/UI/MenuItemActionHandler_UnusedOldTitleMenu_General.cpp @@ -0,0 +1,13 @@ +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x00440420 +void UI::MenuItemActionHandler_UnusedOldTitleMenu_General(int param_1, ...) +{ + DAT_WindowAndDirectDraw::instance.postWindowCloseMessage = 1; +} + +} diff --git a/src/OpenSHC/UI/MenuItemFunction_General_Unknown.cpp b/src/OpenSHC/UI/MenuItemFunction_General_Unknown.cpp new file mode 100644 index 00000000..101381b3 --- /dev/null +++ b/src/OpenSHC/UI/MenuItemFunction_General_Unknown.cpp @@ -0,0 +1,10 @@ +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_StopHandlingMenuItems.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x00440410 +void UI::MenuItemFunction_General_Unknown(int param_1, ...) { DAT_StopHandlingMenuItems::instance = 0; } + +} diff --git a/src/OpenSHC/UI/MenuItemRenderFunction_BuildingAndStatusMenu_ArmyStatusSwitchButton.cpp b/src/OpenSHC/UI/MenuItemRenderFunction_BuildingAndStatusMenu_ArmyStatusSwitchButton.cpp new file mode 100644 index 00000000..6d16c144 --- /dev/null +++ b/src/OpenSHC/UI/MenuItemRenderFunction_BuildingAndStatusMenu_ArmyStatusSwitchButton.cpp @@ -0,0 +1,12 @@ +#include "OpenSHC/UI.func.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x0043FCA0 +void UI::MenuItemRenderFunction_BuildingAndStatusMenu_ArmyStatusSwitchButton() +{ + MACRO_CALL( + OpenSHC::UI_Func::MenuItemRenderFunction_General_RenderCurrentButtonWithPossibleAlphaTexOnScreenMenuSurface)(); +} + +} diff --git a/src/OpenSHC/UI/MenuItemRenderFunction_BuildingAndStatusMenu_BarracksAndMercenaryPostHelpText.cpp b/src/OpenSHC/UI/MenuItemRenderFunction_BuildingAndStatusMenu_BarracksAndMercenaryPostHelpText.cpp new file mode 100644 index 00000000..32e73fbe --- /dev/null +++ b/src/OpenSHC/UI/MenuItemRenderFunction_BuildingAndStatusMenu_BarracksAndMercenaryPostHelpText.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x0043A8C0 +void UI::MenuItemRenderFunction_BuildingAndStatusMenu_BarracksAndMercenaryPostHelpText(int param_1, ...) +{ + if (DAT_BuildingsState::instance.field24_0x18e04c != 0) { + MACRO_CALL(OpenSHC::UI_Func:: + MenuItemRenderFunction_General_RenderCurrentButtonWithPossibleAlphaTexOnScreenMenuSurface)(); + } +} + +} diff --git a/src/OpenSHC/UI/MenuItemRenderFunction_DisplayScenarioHelpText_AnotherButtonUnk.cpp b/src/OpenSHC/UI/MenuItemRenderFunction_DisplayScenarioHelpText_AnotherButtonUnk.cpp new file mode 100644 index 00000000..67c927cb --- /dev/null +++ b/src/OpenSHC/UI/MenuItemRenderFunction_DisplayScenarioHelpText_AnotherButtonUnk.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_TextEditorState.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x0045F120 +void UI::MenuItemRenderFunction_DisplayScenarioHelpText_AnotherButtonUnk(int param_1, ...) +{ + if (DAT_TextEditorState::instance.helpSectionHistoryStack[0] != -1) { + MACRO_CALL(OpenSHC::UI_Func:: + MenuItemRenderFunction_General_RenderCurrentButtonWithPossibleAlphaTexOnScreenMenuSurface)(); + } +} + +} diff --git a/src/OpenSHC/UI/MenuItemRenderFunction_LobbyMenu_Unknown.cpp b/src/OpenSHC/UI/MenuItemRenderFunction_LobbyMenu_Unknown.cpp new file mode 100644 index 00000000..e6f4b8ec --- /dev/null +++ b/src/OpenSHC/UI/MenuItemRenderFunction_LobbyMenu_Unknown.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI.func.hpp" +#include "OpenSHC/UI/BottomLeftTextDisplayState.func.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" + +#include "OpenSHC/Globals/DAT_BottomLeftTextDisplayState.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" + +namespace OpenSHC { + +using OpenSHC::UI::Enums::MenuModalType; + +// FUNCTION: STRONGHOLDCRUSADER 0x0042AC40 +void UI::MenuItemRenderFunction_LobbyMenu_Unknown(int param_1, ...) +{ + if (DAT_MenuModalComposition1::instance.activeModalDialogID == OpenSHC::UI::Enums::MMT_NONE) { + MACRO_CALL_MEMBER(OpenSHC::UI::BottomLeftTextDisplayState_Func::renderCurrentlyDisplayedTextConstructionCost, + DAT_BottomLeftTextDisplayState::ptr)(param_1); + } +} + +} diff --git a/src/OpenSHC/UI/MenuModalRenderFunction_DisplayAiLordMessage.cpp b/src/OpenSHC/UI/MenuModalRenderFunction_DisplayAiLordMessage.cpp new file mode 100644 index 00000000..52d3ea64 --- /dev/null +++ b/src/OpenSHC/UI/MenuModalRenderFunction_DisplayAiLordMessage.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/Rendering/Bink/AIMessageQueue.func.hpp" +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_VideoBikQueue.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x004AB440 +void UI::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/MenuModalRenderFunction_TextEditor.cpp b/src/OpenSHC/UI/MenuModalRenderFunction_TextEditor.cpp new file mode 100644 index 00000000..ee70d322 --- /dev/null +++ b/src/OpenSHC/UI/MenuModalRenderFunction_TextEditor.cpp @@ -0,0 +1,14 @@ +#include "OpenSHC/Text/TextEditorState.func.hpp" +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_TextEditorState.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x004AAB40 +void UI::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/MenuModalRenderFunction_TutorialBox_Thunk.cpp b/src/OpenSHC/UI/MenuModalRenderFunction_TutorialBox_Thunk.cpp new file mode 100644 index 00000000..153d2a1b --- /dev/null +++ b/src/OpenSHC/UI/MenuModalRenderFunction_TutorialBox_Thunk.cpp @@ -0,0 +1,15 @@ + + +#include "OpenSHC/UI.func.hpp" + +namespace OpenSHC { +namespace UI { + + // FUNCTION: STRONGHOLDCRUSADER 0x004abd10 + void MenuModalRenderFunction_TutorialBox_Thunk(int x, int y, int width, int height) + { + MACRO_CALL(UI_Func::MenuModalRenderFunction_TutorialBox)(x, y, width, height); + } + +} // namespace UI +} // namespace OpenSHC diff --git a/src/OpenSHC/UI/MenuTextInputState/clearModalDialog2to6.cpp b/src/OpenSHC/UI/MenuTextInputState/clearModalDialog2to6.cpp new file mode 100644 index 00000000..6c4ae6b2 --- /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/MenuView_UnusedHelpTextEditor_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuView_UnusedHelpTextEditor_DoEveryFrame.cpp new file mode 100644 index 00000000..49307f81 --- /dev/null +++ b/src/OpenSHC/UI/MenuView_UnusedHelpTextEditor_DoEveryFrame.cpp @@ -0,0 +1,14 @@ +#include "OpenSHC/Text/TextEditorState.func.hpp" +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_TextEditorState.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x00440400 +void UI::MenuView_UnusedHelpTextEditor_DoEveryFrame() +{ + MACRO_CALL_MEMBER(OpenSHC::Text::TextEditorState_Func::renderHelpDialogIfOpen, DAT_TextEditorState::ptr)(); +} + +} diff --git a/src/OpenSHC/UI/Rendering/AlphaAndButtonSurface/freeMemory.cpp b/src/OpenSHC/UI/Rendering/AlphaAndButtonSurface/freeMemory.cpp new file mode 100644 index 00000000..6b4777c8 --- /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 != (ushort*)0x0) { + 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 00000000..11821b29 --- /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 00000000..591bc1a2 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/ButtonGmData/getPictureNumberInGm.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI/Rendering/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/RenderBuildingMenu_RecruitingBuilding.cpp b/src/OpenSHC/UI/Rendering/RenderBuildingMenu_RecruitingBuilding.cpp new file mode 100644 index 00000000..dbf86c5a --- /dev/null +++ b/src/OpenSHC/UI/Rendering/RenderBuildingMenu_RecruitingBuilding.cpp @@ -0,0 +1,17 @@ +#include "OpenSHC/Map/Buildings/BuildingsState.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" + +#include "OpenSHC/Globals/DAT_BuildingsState.hpp" + +namespace OpenSHC { +namespace UI { + + // FUNCTION: STRONGHOLDCRUSADER 0x0043A8D0 + void Rendering::RenderBuildingMenu_RecruitingBuilding() + { + MACRO_CALL_MEMBER(OpenSHC::Map::Buildings::BuildingsState_Func::createEntityForAssemblyPointsForActiveTabType, + DAT_BuildingsState::ptr)(); + } + +} +} diff --git a/src/OpenSHC/UI/Rendering/RenderInGameChatDisplayElement.cpp b/src/OpenSHC/UI/Rendering/RenderInGameChatDisplayElement.cpp new file mode 100644 index 00000000..1b0d4f7f --- /dev/null +++ b/src/OpenSHC/UI/Rendering/RenderInGameChatDisplayElement.cpp @@ -0,0 +1,17 @@ +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" + +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" + +namespace OpenSHC { +namespace UI { + + // FUNCTION: STRONGHOLDCRUSADER 0x004AF800 + void Rendering::RenderInGameChatDisplayElement(int posX, int posY, DWORD elementState) + { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::renderInGameChat, DAT_GameSynchronyState::ptr)( + posX, posY, (int)((int)(elementState))); + } + +} +} diff --git a/src/OpenSHC/UI/Rendering/TextureRenderCore/restoreMapSurfaceHeightRangeFromTemporaryUnk.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/restoreMapSurfaceHeightRangeFromTemporaryUnk.cpp new file mode 100644 index 00000000..66de7746 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/restoreMapSurfaceHeightRangeFromTemporaryUnk.cpp @@ -0,0 +1,16 @@ +#include "OpenSHC/UI/Rendering/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 00000000..3ef586ac --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/setActiveMenuTabIndexToZero.cpp @@ -0,0 +1,12 @@ +#include "OpenSHC/UI/Rendering/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 00000000..8fb4c0f5 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/setMapSurfaceHeightRange.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/UI/Rendering/TextureRenderCore.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 00000000..aadc8d8f --- /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 = 0x81b; + } + + } // 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 00000000..dbfdfea9 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/setMenuTabIndexUnk.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/UI/Rendering/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/setScreenMenuSurfaceHeightRange.cpp b/src/OpenSHC/UI/Rendering/TextureRenderCore/setScreenMenuSurfaceHeightRange.cpp new file mode 100644 index 00000000..a85b82b9 --- /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 00000000..042ff165 --- /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 00000000..fc3fc6e2 --- /dev/null +++ b/src/OpenSHC/UI/Rendering/TextureRenderCore/temporarySaveMapSurfaceHeightRangeUnk.cpp @@ -0,0 +1,17 @@ +#include "OpenSHC/UI/Rendering/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/WindowAndDirectDraw/cleanDirectDraw.cpp b/src/OpenSHC/UI/Rendering/WindowAndDirectDraw/cleanDirectDraw.cpp new file mode 100644 index 00000000..1ea39b0d --- /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 00000000..4dfd6600 --- /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/UI/RestoreScenarioGold.cpp b/src/OpenSHC/UI/RestoreScenarioGold.cpp new file mode 100644 index 00000000..f1b24f8f --- /dev/null +++ b/src/OpenSHC/UI/RestoreScenarioGold.cpp @@ -0,0 +1,14 @@ +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_CopyOfScenarioGold.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x004B8210 +void UI::RestoreScenarioGold() +{ + DAT_GameState::instance.mapAndTime.scenarioGold = (short)DAT_CopyOfScenarioGold::instance; +} + +} diff --git a/src/OpenSHC/UI/SetActiveCreditsSequenceIndex.cpp b/src/OpenSHC/UI/SetActiveCreditsSequenceIndex.cpp new file mode 100644 index 00000000..ac8f3889 --- /dev/null +++ b/src/OpenSHC/UI/SetActiveCreditsSequenceIndex.cpp @@ -0,0 +1,21 @@ +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_00ed3120.hpp" +#include "OpenSHC/Globals/DAT_00ed3124.hpp" + +namespace OpenSHC { + +/* + decompilerscript: committed: 2025-01-30 21:57:43.216000 + */ + +// FUNCTION: STRONGHOLDCRUSADER 0x004D9270 +void __cdecl UI::SetActiveCreditsSequenceIndex(undefined4 param_1) + +{ + DAT_00ed3124::instance = param_1; + DAT_00ed3120::instance = 0; + return; +} + +} diff --git a/src/OpenSHC/UI/SetTutorialHintActiveWithTimestamp.cpp b/src/OpenSHC/UI/SetTutorialHintActiveWithTimestamp.cpp new file mode 100644 index 00000000..3e305229 --- /dev/null +++ b/src/OpenSHC/UI/SetTutorialHintActiveWithTimestamp.cpp @@ -0,0 +1,15 @@ +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_00df5564.hpp" +#include "OpenSHC/Globals/DWORD_00df5568.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x004BC770 +void UI::SetTutorialHintActiveWithTimestamp() +{ + DAT_00df5564::instance = 1; + DWORD_00df5568::instance = timeGetTime(); +} + +} diff --git a/src/OpenSHC/UI/TacticalPowersFill.cpp b/src/OpenSHC/UI/TacticalPowersFill.cpp new file mode 100644 index 00000000..a6599a69 --- /dev/null +++ b/src/OpenSHC/UI/TacticalPowersFill.cpp @@ -0,0 +1,19 @@ +#include "OpenSHC/UI.func.hpp" + +#include "OpenSHC/Globals/DAT_MissionDefinedData.hpp" +#include "OpenSHC/Globals/DAT_TacticalPowersHelpTextDisplayBool.hpp" + +namespace OpenSHC { + +// FUNCTION: STRONGHOLDCRUSADER 0x004D9D90 +void UI::TacticalPowersFill() + +{ + if ((DAT_TacticalPowersHelpTextDisplayBool::instance != '\0') + && (DAT_MissionDefinedData::instance.field39_0x1370 = DAT_MissionDefinedData::instance.field39_0x1370 + -1, + DAT_MissionDefinedData::instance.field39_0x1370 == 0)) { + DAT_TacticalPowersHelpTextDisplayBool::instance = '\0'; + } +} + +} diff --git a/src/OpenSHC/Util/Timing/Stopwatch/start.cpp b/src/OpenSHC/Util/Timing/Stopwatch/start.cpp new file mode 100644 index 00000000..c3a69197 --- /dev/null +++ b/src/OpenSHC/Util/Timing/Stopwatch/start.cpp @@ -0,0 +1,20 @@ +#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() + { + DWORD _currentTime = timeGetTime(); + this->startTime_0x8 = _currentTime; + this->running_0x4 = TRUE; + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index c00bd8f3..01113103 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -383,7 +383,7 @@ SHC_3BB0A8C1_0x00400288 | 0.0% | Pending SHC_3BB0A8C1_0x00401000 | 0.0% | Pending -SHC_3BB0A8C1_0x00401040 | 0.0% | Pending +SHC_3BB0A8C1_0x00401040 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00401060 | 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 @@ -2575,7 +2575,7 @@ SHC_3BB0A8C1_0x00408E30 | 0.0% | Pending SHC_3BB0A8C1_0x00408E70 | 0.0% | Pending -SHC_3BB0A8C1_0x00408EB0 | 0.0% | Pending +SHC_3BB0A8C1_0x00408EB0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00408ED0 | 0.0% | Pending @@ -2599,7 +2599,7 @@ SHC_3BB0A8C1_0x004092B0 | 0.0% | Pending SHC_3BB0A8C1_0x004092C0 | 0.0% | Pending -SHC_3BB0A8C1_0x004092E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004092E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00409300 | 0.0% | Pending @@ -4331,7 +4331,7 @@ SHC_3BB0A8C1_0x0040BF40 | 0.0% | Pending SHC_3BB0A8C1_0x0040BFA0 | 0.0% | Pending -SHC_3BB0A8C1_0x0040BFD0 | 0.0% | Pending +SHC_3BB0A8C1_0x0040BFD0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0040BFE0 | 0.0% | Pending @@ -5029,13 +5029,13 @@ SHC_3BB0A8C1_0x0040F240 | 0.0% | Pending SHC_3BB0A8C1_0x0040F360 | 0.0% | Pending -SHC_3BB0A8C1_0x0040F3D0 | 0.0% | Pending +SHC_3BB0A8C1_0x0040F3D0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0040F3F0 | 0.0% | Pending -SHC_3BB0A8C1_0x0040F420 | 0.0% | Pending +SHC_3BB0A8C1_0x0040F420 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0040F440 | 0.0% | Pending +SHC_3BB0A8C1_0x0040F440 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0040F460 | 0.0% | Pending @@ -5543,7 +5543,7 @@ 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 @@ -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 @@ -6073,7 +6073,7 @@ SHC_3BB0A8C1_0x0041A680 | 0.0% | Pending SHC_3BB0A8C1_0x0041A710 | 0.0% | Pending -SHC_3BB0A8C1_0x0041A740 | 0.0% | Pending +SHC_3BB0A8C1_0x0041A740 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0041A760 | 0.0% | Pending @@ -6657,7 +6657,7 @@ 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 @@ -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 @@ -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,7 +6973,7 @@ 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 @@ -11137,7 +11137,7 @@ SHC_3BB0A8C1_0x00434228 | 0.0% | Pending SHC_3BB0A8C1_0x00434230 | 0.0% | Pending -SHC_3BB0A8C1_0x00434260 | 0.0% | Pending +SHC_3BB0A8C1_0x00434260 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00434270 | 0.0% | Pending @@ -13393,15 +13393,15 @@ SHC_3BB0A8C1_0x00439890 | 0.0% | Pending 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_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 @@ -13633,11 +13633,11 @@ SHC_3BB0A8C1_0x00440360 | 0.0% | Pending SHC_3BB0A8C1_0x004403D0 | 0.0% | Pending -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 @@ -16891,7 +16891,7 @@ SHC_3BB0A8C1_0x0044C3F0 | 0.0% | Pending SHC_3BB0A8C1_0x0044C3F4 | 0.0% | Pending -SHC_3BB0A8C1_0x0044C400 | 0.0% | Pending +SHC_3BB0A8C1_0x0044C400 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0044C410 | 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 @@ -16999,9 +16999,9 @@ 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 @@ -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 @@ -17693,9 +17693,9 @@ 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_0x004586F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00458700 | 0.0% | Pending @@ -17713,7 +17713,7 @@ 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 | 0.0% | Pending @@ -18017,7 +18017,7 @@ SHC_3BB0A8C1_0x0045ACC0 | 0.0% | Pending SHC_3BB0A8C1_0x0045AD10 | 0.0% | Pending -SHC_3BB0A8C1_0x0045AE00 | 0.0% | Pending +SHC_3BB0A8C1_0x0045AE00 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0045AE10 | 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% | Our version optimizes to a jump, while the original re-pushes the args SHC_3BB0A8C1_0x0045D080 | 0.0% | Pending -SHC_3BB0A8C1_0x0045D0B0 | 0.0% | Pending +SHC_3BB0A8C1_0x0045D0B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0045D0C0 | 0.0% | Pending @@ -18351,7 +18351,7 @@ SHC_3BB0A8C1_0x0045D990 | 0.0% | Pending SHC_3BB0A8C1_0x0045D9E0 | 0.0% | Pending -SHC_3BB0A8C1_0x0045DA20 | 0.0% | Pending +SHC_3BB0A8C1_0x0045DA20 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0045DA40 | 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 @@ -18833,7 +18833,7 @@ SHC_3BB0A8C1_0x004614F0 | 0.0% | Pending SHC_3BB0A8C1_0x00461520 | 0.0% | Pending -SHC_3BB0A8C1_0x00461550 | 0.0% | Pending +SHC_3BB0A8C1_0x00461550 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00461570 | 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 @@ -19905,11 +19905,11 @@ 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 @@ -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 @@ -20065,7 +20065,7 @@ SHC_3BB0A8C1_0x00467F80 | 0.0% | Pending SHC_3BB0A8C1_0x00468030 | 0.0% | Pending -SHC_3BB0A8C1_0x004680B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004680B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004680C0 | 0.0% | Pending @@ -20123,23 +20123,23 @@ SHC_3BB0A8C1_0x004694A0 | 0.0% | Pending SHC_3BB0A8C1_0x00469790 | 0.0% | Pending -SHC_3BB0A8C1_0x004697C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004697C0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004697E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004697E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00469800 | 0.0% | Pending SHC_3BB0A8C1_0x00469860 | 0.0% | Pending -SHC_3BB0A8C1_0x00469870 | 0.0% | Pending +SHC_3BB0A8C1_0x00469870 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00469880 | 0.0% | Pending +SHC_3BB0A8C1_0x00469880 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004698A0 | 0.0% | Pending +SHC_3BB0A8C1_0x004698A0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004698C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004698C0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004698D0 | 0.0% | Pending +SHC_3BB0A8C1_0x004698D0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004698F0 | 0.0% | Pending @@ -20167,9 +20167,9 @@ SHC_3BB0A8C1_0x00469E70 | 0.0% | Pending SHC_3BB0A8C1_0x00469F10 | 0.0% | Pending -SHC_3BB0A8C1_0x00469F20 | 0.0% | Pending +SHC_3BB0A8C1_0x00469F20 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00469F40 | 0.0% | Pending +SHC_3BB0A8C1_0x00469F40 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00469F50 | 0.0% | Pending @@ -20695,7 +20695,7 @@ SHC_3BB0A8C1_0x0046A4C8 | 0.0% | Pending SHC_3BB0A8C1_0x0046A4D0 | 0.0% | Pending -SHC_3BB0A8C1_0x0046A720 | 0.0% | Pending +SHC_3BB0A8C1_0x0046A720 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0046A740 | 100.0% | Reimplemented @@ -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 @@ -20969,7 +20969,7 @@ 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -23049,9 +23049,9 @@ SHC_3BB0A8C1_0x00486C60 | 0.0% | Pending SHC_3BB0A8C1_0x00486F20 | 0.0% | Pending -SHC_3BB0A8C1_0x00487080 | 0.0% | Pending +SHC_3BB0A8C1_0x00487080 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00487090 | 0.0% | Pending +SHC_3BB0A8C1_0x00487090 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004870B0 | 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 @@ -23407,7 +23407,7 @@ 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 @@ -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 @@ -24345,11 +24345,11 @@ SHC_3BB0A8C1_0x00496E1A | 0.0% | Pending SHC_3BB0A8C1_0x00496E20 | 0.0% | Pending -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 @@ -25535,11 +25535,11 @@ SHC_3BB0A8C1_0x004AAB00 | 0.0% | Pending SHC_3BB0A8C1_0x004AAB20 | 0.0% | Pending -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 @@ -25915,7 +25915,7 @@ SHC_3BB0A8C1_0x004AF6E0 | 0.0% | Pending SHC_3BB0A8C1_0x004AF700 | 0.0% | Pending -SHC_3BB0A8C1_0x004AF800 | 0.0% | Pending +SHC_3BB0A8C1_0x004AF800 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004AF820 | 0.0% | Pending @@ -27077,7 +27077,7 @@ 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 @@ -27107,9 +27107,9 @@ SHC_3BB0A8C1_0x004B8050 | 0.0% | Pending 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 @@ -30095,7 +30095,7 @@ 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 @@ -34139,7 +34139,7 @@ SHC_3BB0A8C1_0x004C6294 | 0.0% | Pending SHC_3BB0A8C1_0x004C6298 | 0.0% | Pending -SHC_3BB0A8C1_0x004C62A0 | 0.0% | Pending +SHC_3BB0A8C1_0x004C62A0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004C62C0 | 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 @@ -36055,7 +36055,7 @@ SHC_3BB0A8C1_0x004D9CC0 | 0.0% | Pending SHC_3BB0A8C1_0x004D9D60 | 0.0% | Pending -SHC_3BB0A8C1_0x004D9D90 | 0.0% | Pending +SHC_3BB0A8C1_0x004D9D90 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004D9DB0 | 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,9 +37335,9 @@ 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 @@ -37933,7 +37933,7 @@ SHC_3BB0A8C1_0x004ED3B0 | 0.0% | Pending SHC_3BB0A8C1_0x004ED410 | 0.0% | Pending -SHC_3BB0A8C1_0x004EDC90 | 0.0% | Pending +SHC_3BB0A8C1_0x004EDC90 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004EDCB0 | 0.0% | Pending @@ -38471,7 +38471,7 @@ SHC_3BB0A8C1_0x004F2970 | 0.0% | Pending SHC_3BB0A8C1_0x004F29C0 | 0.0% | Pending -SHC_3BB0A8C1_0x004F2A10 | 0.0% | Pending +SHC_3BB0A8C1_0x004F2A10 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004F2A20 | 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 @@ -41425,7 +41425,7 @@ 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 @@ -41503,7 +41503,7 @@ 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 @@ -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 @@ -46767,7 +46767,7 @@ SHC_3BB0A8C1_0x00522090 | 0.0% | Pending SHC_3BB0A8C1_0x00522110 | 0.0% | Pending -SHC_3BB0A8C1_0x00522150 | 0.0% | Pending +SHC_3BB0A8C1_0x00522150 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00522160 | 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -51067,9 +51067,9 @@ SHC_3BB0A8C1_0x00535514 | 0.0% | Pending SHC_3BB0A8C1_0x00535520 | 0.0% | Pending -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 @@ -51203,7 +51203,7 @@ SHC_3BB0A8C1_0x00536A51 | 0.0% | Pending SHC_3BB0A8C1_0x00536A60 | 0.0% | Pending -SHC_3BB0A8C1_0x00536C70 | 0.0% | Pending +SHC_3BB0A8C1_0x00536C70 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00536C90 | 0.0% | Pending @@ -51231,7 +51231,7 @@ SHC_3BB0A8C1_0x00537160 | 0.0% | Pending SHC_3BB0A8C1_0x005371A0 | 0.0% | Pending -SHC_3BB0A8C1_0x005371E0 | 0.0% | Pending +SHC_3BB0A8C1_0x005371E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x005371F0 | 0.0% | Pending @@ -88158,3 +88158,4 @@ SHC_3BB0A8C1_0x02490930 | 0.0% | Pending SHC_3BB0A8C1_0x02490936 | 0.0% | Pending SHC_3BB0A8C1_0x02490954 | 0.0% | Pending +