Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
a6e0111
reimplement: SHC_3BB0A8C1_0x00408EB0 100%
Aug 22, 2026
10c442d
reimplement: SHC_3BB0A8C1_0x004092B0 100%
Aug 22, 2026
910c6a7
reimplement: SHC_3BB0A8C1_0x0043FCA0 100%
Aug 22, 2026
c7952ca
reimplement: SHC_3BB0A8C1_0x004ABD10 100%
Aug 22, 2026
7058727
reimplement: SHC_3BB0A8C1_0x00533090 100%
Aug 22, 2026
bfe5986
reimplement: SHC_3BB0A8C1_0x004BC620 100%
Aug 22, 2026
0dcfd17
reimplement: SHC_3BB0A8C1_0x00469860 100%
Aug 22, 2026
63755c2
reimplement: SHC_3BB0A8C1_0x00480570 100%
Aug 22, 2026
2f8d555
reimplement: SHC_3BB0A8C1_0x00496E20 100%
Aug 23, 2026
9f02adc
reimplement: SHC_3BB0A8C1_0x00424310 100%
Aug 23, 2026
c454125
reimplement: SHC_3BB0A8C1_0x0043F2B0 100%
Aug 23, 2026
f2e3ccc
reimplement: SHC_3BB0A8C1_0x004038A0 100%
Aug 23, 2026
6b8084e
reimplement: SHC_3BB0A8C1_0x0040BFD0 100%
Aug 23, 2026
5abdb7c
reimplement: SHC_3BB0A8C1_0x00434260 100%
Aug 23, 2026
d9795fd
many 100%
Aug 23, 2026
a00566d
remove __cdecl
Aug 23, 2026
4f778fe
batch 2
Aug 23, 2026
7e31945
repair vararg
Aug 23, 2026
7d5e7f6
revert va_list
Aug 23, 2026
3e2209b
batch 2: percentage not yet checked, but compiling
Aug 24, 2026
9af1a6c
reimplement: SHC_3BB0A8C1_0x00401000 100%
Aug 25, 2026
8455eec
reimplement: SHC_3BB0A8C1_0x00401B60 100%
Aug 25, 2026
2f97473
reimplement: SHC_3BB0A8C1_0x0040F3F0 100%
Aug 25, 2026
e53a366
reimplement: SHC_3BB0A8C1_0x0041A060 100%
Aug 26, 2026
4cd723c
100%
Aug 26, 2026
06eff4b
reimplement: SHC_3BB0A8C1_0x0041A0D0 100%
Aug 26, 2026
7d15271
reimplement: SHC_3BB0A8C1_0x0041A2B0 100%
Aug 26, 2026
9f2447e
reimplement: SHC_3BB0A8C1_0x0041A390 100%
Aug 26, 2026
34663a3
reimplement: SHC_3BB0A8C1_0x0041A3C0 100%
Aug 26, 2026
bee1a24
progress
Aug 26, 2026
b683b6d
reimplement: SHC_3BB0A8C1_0x0041A3C0 72% stuck
Aug 26, 2026
122f0a2
reimplement: SHC_3BB0A8C1_0x0042AC60 100%
Aug 26, 2026
66c6b97
reimplement: 100%
Aug 26, 2026
6a5bead
reimplement: SHC_3BB0A8C1_0x00439390 100%
Aug 27, 2026
c280e0d
reimplement: SHC_3BB0A8C1_0x00424770 100%
Aug 27, 2026
1f1e7d2
reimplement: SHC_3BB0A8C1_0x004549C0 100% different register allocation
Aug 27, 2026
c4d42cf
progress
Aug 27, 2026
983fe9f
reimplement: SHC_3BB0A8C1_0x0045D060 100%
Aug 27, 2026
f5c4e15
progress
Aug 27, 2026
9505221
reimplement: SHC_3BB0A8C1_0x0045D690 60%
Aug 27, 2026
30ced40
reimplement: SHC_3BB0A8C1_0x0045D9E0 100%
Aug 27, 2026
0e7d624
reimplement: SHC_3BB0A8C1_0x00462150 27%
Aug 27, 2026
1793bbb
reimplement: SHC_3BB0A8C1_0x00468C50 100%
Aug 27, 2026
e517480
progress
Aug 27, 2026
dfc83e8
progress
Aug 31, 2026
4dbcfb4
flush with main
Sep 1, 2026
f0fd693
reimplement: SHC_3BB0A8C1_0x00462150 100%
Sep 2, 2026
2a9d556
reimplement: 100%
Sep 2, 2026
b666f9f
remove WideCharMultiByteState
Sep 2, 2026
05d7133
reimplement: 100%
Sep 3, 2026
834e057
reimplement: 100%
Sep 3, 2026
b363b36
reimplement: 100%
Sep 3, 2026
9e10eb8
reimplement: 100%
Sep 4, 2026
ec8d6fb
reimplement: 100%
Sep 4, 2026
1178bbe
reimplement: 100%
Sep 4, 2026
3c75f77
reimplement: 100%
Sep 4, 2026
6189fe2
reimplement: 100%
Sep 4, 2026
7b04f19
checkout cpp files already on main
Sep 6, 2026
5b9da3d
reimplement: 100%
Sep 6, 2026
8e4a5fb
reimplement: 100%
Sep 7, 2026
3062b27
progress
Sep 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions cmake/compiler-flags-gl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ src/OpenSHC/IO/ResourceManager/swapMapDataWithNextMap.cpp
src/OpenSHC/UI/Rendering/WindowAndDirectDraw/takeScreenshot.cpp
src/OpenSHC/IO/ResourceManager/readFirstPartOfCurrentResourceIntoMemory.cpp
src/OpenSHC/IO/ResourceManager/readNextPartOfCurrentResourceIntoMemory.cpp
src/OpenSHC/Map/TileMapState/updateMoatCountdownTimers.cpp
src/OpenSHC/Map/TileMapState/recountTotalOwnedMoats.cpp
44 changes: 44 additions & 0 deletions src/OpenSHC/AI/AICState/aiFarmChoice.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include "OpenSHC/AI/AICState.func.hpp"
#include "OpenSHC/Game/Player/PlayerID.hpp"
#include "OpenSHC/AI/AITypeInt.hpp"
#include "OpenSHC/AI/AIType.hpp"



#include "OpenSHC/Globals/DAT_GameState.hpp"
#include "OpenSHC/Globals/DAT_EntityState.hpp"

namespace OpenSHC {
namespace AI {

using OpenSHC::Game::Player::PlayerID;
using OpenSHC::AI::AITypeInt;
using OpenSHC::AI::AIType;


/*
decompilerscript: committed: 2025-01-30 21:57:43.216000
*/


// FUNCTION: STRONGHOLDCRUSADER 0x004CB180
int AICState::aiFarmChoice(PlayerID playerID)

{
AITypeInt AVar1;

AVar1 = DAT_GameState::instance.playerDataArray[playerID].aiType;
if (AVar1 == OpenSHC::AI::AIT_NULL) {
return 0;
}
/*
ugly because EAX is always 1 or higher
*/

return *(int *)((int)DAT_EntityState::instance.seagullArray +
(AVar1 * 0xa9 + DAT_GameState::instance.playerDataArray[playerID].aiFarmIndex) * 4 + 0x24a0);
}


}
}
41 changes: 41 additions & 0 deletions src/OpenSHC/AI/AICState/getResourceRebuildDelay.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#include "OpenSHC/AI/AICState.func.hpp"
#include "OpenSHC/AI/AITypeInt.hpp"
#include "OpenSHC/AI/AIType.hpp"



#include "OpenSHC/Globals/DAT_GameState.hpp"
#include "OpenSHC/Globals/DAT_EntityState.hpp"

namespace OpenSHC {
namespace AI {

using OpenSHC::AI::AITypeInt;
using OpenSHC::AI::AIType;


/*
decompilerscript: committed: 2025-01-30 21:57:43.216000
*/


// FUNCTION: STRONGHOLDCRUSADER 0x004CB150
int AICState::getResourceRebuildDelay(int param_1)

{
AITypeInt AVar1;

AVar1 = DAT_GameState::instance.playerDataArray[param_1].aiType;
if (AVar1 == OpenSHC::AI::AIT_NULL) {
return 0;
}
/*
access resourceBuildDelay
*/

return *(int *)((int)DAT_EntityState::instance.seagullArray + AVar1 * 0x2a4 + 0x24ec);
}


}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#include "OpenSHC/AI/AICState.func.hpp"
#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp"
#include "OpenSHC/Commands/MappersEnum.hpp"



#include "OpenSHC/Globals/DAT_AIVState.hpp"

namespace OpenSHC {
namespace AI {

using OpenSHC::WindowsHelper::Enums::BOOLEnum;
using OpenSHC::Commands::MappersEnum;


/*
WARNING: Enum "MappersEnum": Some values do not have unique names
*/

/*
WARNING: Enum "MappersEnumShort": Some values do not have unique names
*/

/*
decompilerscript: committed: 2025-01-30 21:57:43.216000
*/


// FUNCTION: STRONGHOLDCRUSADER 0x004ECAB0
BOOLEnum AICState::mapperIsWoodCuttersHutWhileNoWoodAvailable(undefined4 playerID,MappersEnum param_2)

{
if ((param_2 == OpenSHC::Commands::M_MAPPER_WOODSMAN) && (DAT_AIVState::instance.mapExtraInfo.totalWoodAvailable < 1)) {
return TRUE;
}
return FALSE;
}


}
}
37 changes: 37 additions & 0 deletions src/OpenSHC/AI/AICState/playJokeBikFromAIToHuman.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include "OpenSHC/AI/AICState.func.hpp"
#include "OpenSHC/Map/Units/UnitsState.func.hpp"
#include "OpenSHC/Rendering/Bink/AIMessageQueue.func.hpp"



#include "OpenSHC/Globals/DAT_VideoBikQueue.hpp"
#include "OpenSHC/Globals/DAT_UnitsState.hpp"

namespace OpenSHC {
namespace AI {




/*
decompilerscript: committed: 2025-01-30 21:57:43.216000
*/


// FUNCTION: STRONGHOLDCRUSADER 0x004D0F90
void AICState::playJokeBikFromAIToHuman(int playerID,int aiType)

{
int iVar1;

iVar1 = MACRO_CALL_MEMBER(OpenSHC::Map::Units::UnitsState_Func::getAliveLordForPlayer, DAT_UnitsState::ptr)(playerID);
if (iVar1 != 0) {
MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::AIMessageQueue_Func::playBikVideoFromPlayer, DAT_VideoBikQueue::ptr)(playerID, aiType, 0x14)
;
}
return;
}


}
}
35 changes: 35 additions & 0 deletions src/OpenSHC/AI/AICState/setTriggerForAITauntResponse.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include "OpenSHC/AI/AICState.func.hpp"
#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp"
#include "OpenSHC/Game/GameCore.func.hpp"



#include "OpenSHC/Globals/DAT_GameCore.hpp"

namespace OpenSHC {
namespace AI {

using OpenSHC::WindowsHelper::Enums::BOOLEnum;


/*
decompilerscript: committed: 2025-01-30 21:57:43.216000
*/


// FUNCTION: STRONGHOLDCRUSADER 0x004D1090
void AICState::setTriggerForAITauntResponse()

{
BOOLEnum BVar1;

BVar1 = MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::getAreWeInAInGameMenu, DAT_GameCore::ptr)();
if (BVar1 != FALSE) {
this->aiTauntResponseTimeWindow = timeGetTime();
}
return;
}


}
}
39 changes: 39 additions & 0 deletions src/OpenSHC/AI/AICState/shouldNotBeBuildingArmoury.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#include "OpenSHC/AI/AICState.func.hpp"
#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp"
#include "OpenSHC/Game/Player/PlayerID.hpp"
#include "OpenSHC/Commands/MappersEnum.hpp"



#include "OpenSHC/Globals/DAT_GameState.hpp"

namespace OpenSHC {
namespace AI {

using OpenSHC::WindowsHelper::Enums::BOOLEnum;
using OpenSHC::Game::Player::PlayerID;
using OpenSHC::Commands::MappersEnum;


/*
WARNING: Enum "MappersEnum": Some values do not have unique names
*/

/*
decompilerscript: committed: 2025-01-30 21:57:43.216000
*/


// FUNCTION: STRONGHOLDCRUSADER 0x004ECA60
BOOLEnum AICState::shouldNotBeBuildingArmoury(PlayerID playerID,MappersEnum param_2)

{
if (param_2 != OpenSHC::Commands::M_MAPPER_ARMOURY) {
return FALSE;
}
return (uint)(DAT_GameState::instance.playerDataArray[playerID].isArmouryAlmostFilledUp == 0);
}


}
}
37 changes: 37 additions & 0 deletions src/OpenSHC/AI/AICState/shouldNotBeBuildingGranary.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include "OpenSHC/AI/AICState.func.hpp"
#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp"
#include "OpenSHC/Commands/MappersEnum.hpp"



#include "OpenSHC/Globals/DAT_GameState.hpp"

namespace OpenSHC {
namespace AI {

using OpenSHC::WindowsHelper::Enums::BOOLEnum;
using OpenSHC::Commands::MappersEnum;


/*
WARNING: Enum "MappersEnum": Some values do not have unique names
*/

/*
decompilerscript: committed: 2025-01-30 21:57:43.216000
*/


// FUNCTION: STRONGHOLDCRUSADER 0x004ECA30
BOOLEnum AICState::shouldNotBeBuildingGranary(int playerID,MappersEnum param_2)

{
if (param_2 != OpenSHC::Commands::M_MAPPER_GRANARY) {
return FALSE;
}
return (uint)(DAT_GameState::instance.playerDataArray[playerID].granaryIsAlmostFilledUp == FALSE);
}


}
}
24 changes: 24 additions & 0 deletions src/OpenSHC/AI/AICState/shouldNotBuildKillingPits.cpp
Original file line number Diff line number Diff line change
@@ -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;
}

}
}
42 changes: 42 additions & 0 deletions src/OpenSHC/AI/AICState/unitIDIsRangedOrArmored.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#include "OpenSHC/AI/AICState.func.hpp"
#include "OpenSHC/Game/Skirmish/SkirmishDefinedData.hpp"



#include "OpenSHC/Globals/DAT_UnitsState.hpp"
#include "OpenSHC/Globals/DAT_SkirmishDefinedData.hpp"

namespace OpenSHC {
namespace AI {

using OpenSHC::Game::Skirmish::SkirmishDefinedData;


/*
WARNING: Enum "MappersEnum": Some values do not have unique names
*/

/*
decompilerscript: committed: 2025-01-30 21:57:43.216000
*/


// FUNCTION: STRONGHOLDCRUSADER 0x004CC8D0
undefined4 AICState::unitIDIsRangedOrArmored(int unitID)

{
SkirmishDefinedData *pSVar1;

pSVar1 = DAT_SkirmishDefinedData::ptr;
do {
if (pSVar1->RangedAndArmoredUnits[0] == (int)(short)DAT_UnitsState::instance.units[unitID].unitType) {
return(undefined4)( 1);
}
pSVar1 = (SkirmishDefinedData *)(pSVar1->RangedAndArmoredUnits + 1);
} while ((int)pSVar1 < 0xb3eb50);
return(undefined4)( 0);
}


}
}
Loading