Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/OpenSHC/AI/AICState/yieldCowThrow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace AI {
int const aicIndex = aiType - 1;
if (DAT_GameState::instance.mapAndTime.skirmishNoCowThrowing == 0
&& this->aics[aicIndex].CowThrowInterval != 0
&& DAT_GameState::instance.playerDataArray[playerID].counter > 0) {
&& DAT_GameState::instance.playerDataArray[playerID].availableCows > 0) {
DAT_GameState::instance.playerDataArray[playerID].aiCowThrowCounter++;
if (DAT_GameState::instance.playerDataArray[playerID].aiCowThrowCounter
> this->aics[aicIndex].CowThrowInterval) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "OpenSHC/Map/Navigation/PathFindingState.func.hpp"
#include "OpenSHC/Map/Units/TribesState.func.hpp"
#include "OpenSHC/Random/RNG.func.hpp"
#include "OpenSHC/AI/Tribes/AITribeType.hpp"
#include "OpenSHC/Audio/SFX/SoundEffectID.hpp"
#include "OpenSHC/Map/Units/Behavior/UnitStanceEnum.hpp"
#include "OpenSHC/Map/Units/UnitType.hpp"
Expand Down Expand Up @@ -64,7 +65,7 @@ namespace Game {
int const y = DAT_ViewportRenderState::instance.tileTranslationMatrix_YComponent[tile];
int const x = tile - DAT_ViewportRenderState::instance.translationMatrix[y].addXgetTile;
dword const tribeID = MACRO_CALL_MEMBER(Map::Units::TribesState_Func::spawnUnitsAroundLocation,
DAT_TribesState::ptr)(1, x, y, playerID, unitType, unitCount);
DAT_TribesState::ptr)((AI::Tribes::AITribeType)1, x, y, playerID, unitType, unitCount);
if ((int)tribeID > 0) {
DAT_TribesState::instance.tribes[tribeID].unitStance = Map::Units::Behavior::USE_AGGRESSIVE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ namespace Game {
if (receivedMapVersion < 139) {
for (int playerID = 1; playerID < 9; ++playerID) {
int cowCount = 0;
DAT_GameState::instance.playerDataArray[playerID].counter = 0;
DAT_GameState::instance.playerDataArray[playerID].availableCows = 0;
int siegeEngineCount = 0;
for (int unitID = 1; unitID < 2500; ++unitID) {
if (DAT_UnitsState::instance.units[unitID].logicalState != Map::Units::ULS_INVISIBLE
Expand All @@ -113,9 +113,9 @@ namespace Game {
.buildingEntryInfos[Player::Enums::BEIE_KEEP]
.id
!= 0) {
DAT_GameState::instance.playerDataArray[playerID].counter = cowCount;
DAT_GameState::instance.playerDataArray[playerID].availableCows = cowCount;
} else {
DAT_GameState::instance.playerDataArray[playerID].counter = siegeEngineCount;
DAT_GameState::instance.playerDataArray[playerID].availableCows = siegeEngineCount;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSHC/Map/Buildings/UpdateFireBallistaBuilding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ namespace Map {
.buildingEntryInfos[OpenSHC::Game::Player::Enums::BEIE_KEEP]
.id
== 0) {
DAT_GameState::instance.playerDataArray[owner].counter += 2;
DAT_GameState::instance.playerDataArray[owner].availableCows += 2;
}
}
// AI tribe type 24 and unit logic state 5 have no constants.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ namespace Synchrony {
{
int _gameCommandID
= MACRO_CALL_MEMBER(Synchrony::GameSynchronyState_Func::getCommandIDFromCommandSelectionStuff, this)();
if ((_gameCommandID) && (_gameCommandID = 0, 0 < this->someIndex)) {
if ((_gameCommandID) && (_gameCommandID = 0, 0 < this->selectedCommandsCount)) {
int (*_selected)[2] = this->selectedGameCommands;
while (_gameCommandID < this->someIndex) {
while (_gameCommandID < this->selectedCommandsCount) {
// process all commands that should have been executed by now.
// Measured: indexing selectedGameCommands per iteration instead of walking
// _selected costs the match, so the pointer stays.
Expand All @@ -35,7 +35,7 @@ namespace Synchrony {
this->DAT_CommandActionPlan = Commands::GCS_EXECUTE;
this->DAT_CommandParameterOffset = 0;
DAT_ProtocolDefinedData::instance
.commandFunctions[this->DAT_GameCommandArray[this->DAT_CurrentGameCommandID].commandType]();
.commandFunctions[this->DAT_GameCommandArray[this->DAT_CurrentGameCommandID].commandType]();
++_gameCommandID;
this->DAT_GameCommandArray[this->DAT_CurrentGameCommandID].stateUnk = Commands::GCS_PROCESSED;
++_selected;
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSHC/UI/Helpers/CheckGoldResource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace UI {
using OpenSHC::WindowsHelper::Enums::BOOLEnum;

// FUNCTION: STRONGHOLDCRUSADER 0x004650C0
BOOLEnum Helpers::CheckGoldResource(int unitIndex)
BOOLEnum Helpers::CheckGoldResource(UnitType unitIndex)
{
int requiredGold = 0;
if (unitIndex == 5) {
Expand Down
8 changes: 4 additions & 4 deletions src/OpenSHC/UI/Helpers/UpdateTutorialStepAndProgress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "OpenSHC/Globals/DAT_00df5588.hpp"
#include "OpenSHC/Globals/DAT_00df558c.hpp"
#include "OpenSHC/Globals/DAT_00df5590.hpp"
#include "OpenSHC/Globals/DAT_DisableTutorialRestrictions.hpp"
#include "OpenSHC/Globals/DAT_FileDoesntExist.hpp"
#include "OpenSHC/Globals/DAT_GameCore.hpp"
#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp"
Expand All @@ -38,7 +39,6 @@
#include "OpenSHC/Globals/INT_00df5584.hpp"
#include "OpenSHC/Globals/INT_00df5650.hpp"
#include "OpenSHC/Globals/INT_00df5654.hpp"
#include "OpenSHC/Globals/INT_DisableTutorialRestrictions.hpp"
#include "OpenSHC/Globals/TUT_RotateMapHappened.hpp"

namespace OpenSHC {
Expand All @@ -48,7 +48,7 @@ namespace UI {
void Helpers::UpdateTutorialStepAndProgress()
{
int const wasComplete = DAT_00df5560::instance;
if (INT_DisableTutorialRestrictions::instance
if (DAT_DisableTutorialRestrictions::instance
&& DAT_MenuModalComposition1::instance.activeModalDialogID != UI::Enums::MMT_TUTORIAL_BOX
&& DAT_MenuModalComposition1::instance.activeModalDialogID != UI::Enums::MMT_TUTORIAL_BOX_WITH_LEAVE) {
return;
Expand Down Expand Up @@ -122,7 +122,7 @@ namespace UI {
}
if (fade >= 32) {
++DAT_TutorialCurrentStep::instance;
if (INT_DisableTutorialRestrictions::instance) {
if (DAT_DisableTutorialRestrictions::instance) {
MACRO_CALL_MEMBER(UI::MenuModalComposition_Func::activateModalDialog,
DAT_MenuModalComposition1::ptr)(UI::Enums::MMT_NONE, FALSE);
} else {
Expand All @@ -146,7 +146,7 @@ namespace UI {
if (DAT_00df5560::instance) {
return;
}
if (INT_DisableTutorialRestrictions::instance || DAT_00df5540::instance == 2) {
if (DAT_DisableTutorialRestrictions::instance || DAT_00df5540::instance == 2) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include "OpenSHC/UI/MenuItems/BuildingAndStatusMenu.func.hpp"

#include "OpenSHC/Globals/DAT_00df3350.hpp"
#include "OpenSHC/Globals/INT_00df3350.hpp"

namespace OpenSHC {
namespace UI {
namespace MenuItems {
namespace BuildingAndStatusMenu {

// FUNCTION: STRONGHOLDCRUSADER 0x004649C0
void MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Min1() { DAT_00df3350::instance = 0xffffffff; }
void MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Min1() { INT_00df3350::instance = -1; }

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "OpenSHC/Text/TextAlignment.hpp"
#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp"

#include "OpenSHC/Globals/DAT_00df3350.hpp"
#include "OpenSHC/Globals/DAT_ButtonCurrentlyInteracting.hpp"
#include "OpenSHC/Globals/DAT_ButtonX.hpp"
#include "OpenSHC/Globals/DAT_ButtonY.hpp"
Expand All @@ -20,6 +19,7 @@
#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp"
#include "OpenSHC/Globals/DAT_UIButtonDefinedData.hpp"
#include "OpenSHC/Globals/DAT_UnitPropertiesDefinedData.hpp"
#include "OpenSHC/Globals/INT_00df3350.hpp"

namespace OpenSHC {
namespace UI {
Expand All @@ -40,12 +40,12 @@ namespace UI {
} else {
DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue
= OpenSHC::Rendering::Enums::RT_SCREEN_MENU;
if ((int)DAT_00df3350::instance >= 0) {
if ((int)INT_00df3350::instance >= 0) {
for (int i = 0; i < countof(DAT_UnitPropertiesDefinedData::instance
.EuroUnitResourceCosts[DAT_00df3350::instance]);
.EuroUnitResourceCosts[INT_00df3350::instance]);
++i) {
if (DAT_UnitPropertiesDefinedData::instance
.EuroUnitResourceCosts[DAT_00df3350::instance][i]
.EuroUnitResourceCosts[INT_00df3350::instance][i]
== -1) {
neededByHoveredUnit = TRUE;
}
Expand Down Expand Up @@ -116,10 +116,10 @@ namespace UI {
return;
}
DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU;
if ((int)DAT_00df3350::instance >= 0) {
if ((int)INT_00df3350::instance >= 0) {
// The item part tests only the first three cost slots, as the original does.
for (int i = 0; i < 3; ++i) {
if (DAT_UnitPropertiesDefinedData::instance.EuroUnitResourceCosts[DAT_00df3350::instance][i]
if (DAT_UnitPropertiesDefinedData::instance.EuroUnitResourceCosts[INT_00df3350::instance][i]
== resourceType) {
neededByHoveredUnit = TRUE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp"
#include "OpenSHC/Game/GameMode.hpp"
#include "OpenSHC/IO/Graphics/GmID.hpp"
#include "OpenSHC/Map/Units/UnitType.hpp"
#include "OpenSHC/Rendering/Enums/RenderTarget.hpp"

#include "OpenSHC/Globals/DAT_ButtonCurrentlyInteracting.hpp"
Expand Down Expand Up @@ -39,7 +40,7 @@ namespace UI {
if (DAT_EnoughGoldForRequestedUnit::instance) {
DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue
= OpenSHC::Rendering::Enums::RT_SCREEN_MENU;
if (MACRO_CALL(Helpers_Func::CheckGoldResource)(unitType)) {
if (MACRO_CALL(Helpers_Func::CheckGoldResource)((Map::Units::UnitType)unitType)) {
ButtonGmData* const buttonGmData
= &DAT_UIButtonDefinedData::instance
.ButtonGmDataArray[DAT_CurrentButtonGmDataIndex::instance];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ namespace UI {
!= 0) {
// One resolve call per arm and != tests with the else arm last: the original lays the chain out
// this way.
if (DAT_MenuTextInputState::instance.DAT_ArrayOfMapU3EndInt2[0] != 0) {
if (DAT_MenuTextInputState::instance.DAT_ArrayOfMapU3EndInt2 != 0) {
strcpy(fileName,
MACRO_CALL_MEMBER(
OpenSHC::Text::UserTextHandler_Func::getCurrentText, DAT_UserTextHandlerState::ptr)());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
#include "OpenSHC/string-literals.hpp"

#include "OpenSHC/Globals/DAT_00df5540.hpp"
#include "OpenSHC/Globals/DAT_00df5554.hpp"
#include "OpenSHC/Globals/DAT_00df5558.hpp"
#include "OpenSHC/Globals/DAT_00df555c.hpp"
#include "OpenSHC/Globals/DAT_00df5560.hpp"
#include "OpenSHC/Globals/DAT_00df556c.hpp"
#include "OpenSHC/Globals/DAT_BuildingsState.hpp"
#include "OpenSHC/Globals/DAT_DisableTutorialRestrictions.hpp"
#include "OpenSHC/Globals/DAT_GameCore.hpp"
#include "OpenSHC/Globals/DAT_GameState.hpp"
#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp"
Expand All @@ -32,7 +32,7 @@
#include "OpenSHC/Globals/DAT_SoundSystemState.hpp"
#include "OpenSHC/Globals/DAT_TutorialCurrentStep.hpp"
#include "OpenSHC/Globals/DAT_VideoBikQueue.hpp"
#include "OpenSHC/Globals/INT_DisableTutorialRestrictions.hpp"
#include "OpenSHC/Globals/INT_00df5554.hpp"

namespace OpenSHC {
namespace UI {
Expand Down Expand Up @@ -82,8 +82,8 @@ namespace UI {
MACRO_CALL(OpenSHC::UI::Helpers_Func::InitTutorialStepTransition)(2);
DAT_00df5560::instance = FALSE;
// the original compares the step counters signed
if ((int)DAT_TutorialCurrentStep::instance >= (int)DAT_00df5554::instance - 1) {
INT_DisableTutorialRestrictions::instance = TRUE;
if ((int)DAT_TutorialCurrentStep::instance >= (int)INT_00df5554::instance - 1) {
DAT_DisableTutorialRestrictions::instance = TRUE;
}
if (DAT_MissionAestheticsDefinedData::instance.TutorialStepSpeechTrigger[DAT_TutorialCurrentStep::instance]
== 1) {
Expand Down
4 changes: 2 additions & 2 deletions src/OpenSHC/UI/MenuTextInputState/activateLoadOrSaveMapUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace OpenSHC {
namespace UI {

// FUNCTION: STRONGHOLDCRUSADER 0x00493980
void MenuTextInputState::activateLoadOrSaveMapUI(int loadOrSaveMap)
void MenuTextInputState::activateLoadOrSaveMapUI(MenuModalType loadOrSaveMap)
{
DAT_MouseState::instance.waitCursorToggle = 1;
MACRO_CALL(OpenSHC::UI::Helpers_Func::SetCursorDependingOnProgramState)();
Expand Down Expand Up @@ -46,7 +46,7 @@ namespace UI {
}
this->lastListClickTime = 0;
this->lastClickedListIndex = -1;
this->DAT_ArrayOfMapU3EndInt2[0] = 0;
this->DAT_ArrayOfMapU3EndInt2 = 0;
DAT_MouseState::instance.waitCursorToggle = 0;
this->fileListVisibleRowCount = 16;
if (loadOrSaveMap == OpenSHC::UI::Enums::MMT_LOAD_MAP) {
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSHC/UI/MenuTextInputState/loadOrSaveMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace UI {
DAT_MouseState::instance.waitCursorToggle = 0;
this->lastListClickTime = 0;
this->lastClickedListIndex = -1;
this->DAT_ArrayOfMapU3EndInt2[0] = 1;
this->DAT_ArrayOfMapU3EndInt2 = 1;
this->fileListVisibleRowCount = 16;
if (dialogType == OpenSHC::UI::Enums::MMT_LOAD_MAP) {
MACRO_CALL_MEMBER(OpenSHC::UI::MenuTextInputState_Func::activateModalDialogAndClearText, this)(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "OpenSHC/IO/FileResourceType.hpp"
#include "OpenSHC/string-macros.hpp"

#include "OpenSHC/Globals/DAT_00b95b74.hpp"
#include "OpenSHC/Globals/DAT_00b960f4.hpp"
#include "OpenSHC/Globals/DAT_GameCore.hpp"
#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp"
Expand All @@ -23,6 +22,7 @@
#include "OpenSHC/Globals/FilePackagerObj.hpp"
#include "OpenSHC/Globals/INT_00b95958.hpp"
#include "OpenSHC/Globals/INT_00b95ab8.hpp"
#include "OpenSHC/Globals/INT_00b95b74.hpp"
#include "OpenSHC/Globals/INT_00b960b0.hpp"

namespace OpenSHC {
Expand All @@ -43,14 +43,14 @@ namespace UI {
OpenSHC::IO::FRT_MAPS, mapFileName);
MACRO_CALL_MEMBER(OpenSHC::IO::FilePackager_Func::readMapHeader, FilePackagerObj::ptr)(TRUE);
INT_00b95958::instance = 1;
DAT_00b95b74::instance = 0;
INT_00b95b74::instance = 0;
DAT_00b960f4::instance = -19;
if (DAT_GameCore::instance.mapDescUseStringTable == 0) {
DAT_00b95b74::instance = MACRO_CALL_MEMBER(OpenSHC::Text::FontSizeClass_Func::renderMultilineTextUnk,
INT_00b95b74::instance = MACRO_CALL_MEMBER(OpenSHC::Text::FontSizeClass_Func::renderMultilineTextUnk,
&DAT_TextManagerObject::instance.fontSizeClassArray[19])(
DAT_GameCore::instance.mapDescription, 0, 0, 345, 0, 0, 1);
} else if (DAT_GameCore::instance.mapDescUseStringTableIndex != 0) {
DAT_00b95b74::instance = MACRO_CALL_MEMBER(OpenSHC::Text::FontSizeClass_Func::renderMultilineTextUnk,
INT_00b95b74::instance = MACRO_CALL_MEMBER(OpenSHC::Text::FontSizeClass_Func::renderMultilineTextUnk,
&DAT_TextManagerObject::instance.fontSizeClassArray[19])(
MACRO_CALL_MEMBER(
OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)(
Expand Down
Loading