Skip to content

Commit

Permalink
3rdParty: update Spore-ModAPI to v2.5.297
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosalie241 committed Jan 1, 2024
1 parent 7dae66d commit 2a1713e
Show file tree
Hide file tree
Showing 20 changed files with 496 additions and 75 deletions.
2 changes: 1 addition & 1 deletion 3rdParty/BuildSporeModAPI.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set SPOREMODAPI_CUR_DIR=%~dp0

msbuild "%SPOREMODAPI_CUR_DIR%\Spore-ModAPI\Spore ModAPI" ^
/p:Configuration="Release DLL" ^
/p:SDK_BUILD_VER=294 ^
/p:SDK_BUILD_VER=297 ^
/p:EXECUTABLE_TYPE=10 ^
/p:Platform=Win32 ^
/m
4 changes: 2 additions & 2 deletions 3rdParty/Spore-ModAPI/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[subrepo]
remote = [email protected]:emd4600/Spore-ModAPI.git
branch = master
commit = 654b0318bd1ecf65cd71fb025752ba5b6524defb
parent = 527f3970042d5ad2ace018e9580a08038444aa48
commit = 32de907e29bd127807d1d8fdc03ea39f17ff6592
parent = 7dae66d1806a285eb6edf83b668265c7884386fe
method = merge
cmdver = 0.4.6
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@
#include <Spore\Simulator\cSimulatorUniverse.h>
#include <Spore\Simulator\Serialization.h>
#include <Spore\Simulator\SpaceConstants.h>
#include <Spore\Simulator\cArtilleryProjectile.h>
#include <Spore\Simulator\cCulturalProjectile.h>
#include <Spore\Simulator\cFlakProjectile.h>
#include <Spore\Simulator\cResourceProjectile.h>
#include <Spore\Simulator\cSpaceDefenseMissile.h>
#include <Spore\Simulator\SubSystem\cRelationshipManager.h>
#include <Spore\Simulator\SubSystem\GameBehaviorManager.h>
#include <Spore\Simulator\SubSystem\GameInputManager.h>
Expand Down Expand Up @@ -120,6 +125,8 @@ namespace Addresses(Simulator)
DefineAddress(GetPlanetTemperatureType, SelectAddress(0xFC26B0, 0xFC1F90));
DefineAddress(IsBinaryStar, SelectAddress(0xC8A770, 0xC8B5E0));
DefineAddress(IsNotStarOrBinaryStar, SelectAddress(0xC8A840, 0xC8B6B0));

DefineAddress(LaunchDefaultToolProjectile, SelectAddress(0x1054F40, 0x1054390));

#ifndef SDK_TO_GHIDRA
DefineAddress(LightingWorld_ptr, SelectAddress(0x1682CD4, 0x167EA54));
Expand Down Expand Up @@ -974,6 +981,27 @@ namespace Simulator
DefineAddress(SetObject, SelectAddress(0xAF9890, 0xAF9FB0));
DefineAddress(RemoveObject, SelectAddress(0xAF9900, 0xAFA020));
}

namespace Addresses(cArtilleryProjectile)
{
DefineAddress(LaunchProjectile, SelectAddress(0xCB68C0, 0xCB71C0));
}
namespace Addresses(cCulturalProjectile)
{
DefineAddress(LaunchProjectile, SelectAddress(0xCBD0A0, 0xCBDB90));
}
namespace Addresses(cFlakProjectile)
{
DefineAddress(LaunchProjectile, SelectAddress(0xCB7400, 0xCB7CF0));
}
namespace Addresses(cResourceProjectile)
{
DefineAddress(LaunchProjectile, SelectAddress(0xCBDCD0, 0xCBE7C0));
}
namespace Addresses(cSpaceDefenseMissile)
{
DefineAddress(LaunchProjectile, SelectAddress(0xCB7FD0, 0xCB88B0));
}
}

#ifdef SDK_TO_GHIDRA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
#include <Spore\Simulator\cBadgeManager.h>
#include <Spore\Simulator\cObjectPool.h>
#include <Spore\Simulator\cSimulatorUniverse.h>
#include <Spore\Simulator\cDefaultToolProjectile.h>
#include <Spore\Simulator\cArtilleryProjectile.h>
#include <Spore\Simulator\cCulturalProjectile.h>
#include <Spore\Simulator\cFlakProjectile.h>
#include <Spore\Simulator\cResourceProjectile.h>
#include <Spore\Simulator\cSpaceDefenseMissile.h>

namespace Simulator
{
Expand Down Expand Up @@ -64,5 +70,40 @@ namespace Simulator
{
return *(cSimulatorUniverse**)GetAddress(cSimulatorUniverse, _ptr);
}


//// cDefaultToolProjectile ////

auto_STATIC_METHOD_VOID(Simulator, LaunchDefaultToolProjectile,
Args(cSpaceToolData* tool, cDefaultToolProjectile* projectile, const Math::Vector3& origin, const Math::Vector3& target),
Args(tool, projectile, origin, target));


//// cArtilleryProjectile ////

auto_METHOD_VOID(cArtilleryProjectile, LaunchProjectile, Args(const Math::Vector3& target), Args(target));


//// cCulturalProjectile ////

auto_METHOD_VOID(cCulturalProjectile, LaunchProjectile,
Args(cGameData* owner, cVehicle* vehicle, cSpaceToolData* tool, cCombatant* target, const Math::Vector3& unk0, float unk1, bool unk2, bool spin),
Args(owner, vehicle, tool, target, unk0, unk1, unk2, spin));


//// cFlakProjectile ////

auto_METHOD_VOID(cFlakProjectile, LaunchProjectile, Args(const Math::Vector3& target, float arg), Args(target, arg));


//// cResourceProjectile ////

auto_METHOD_VOID(cResourceProjectile, LaunchProjectile,
Args(cCivilization* civilization, cCommodityNode* commodityNode, const Math::Vector3& arg0, float speed, bool arg1),
Args(civilization, commodityNode, arg0, speed, arg1));

//// cSpaceDefenseMissile ////

auto_METHOD_VOID(cSpaceDefenseMissile, LaunchProjectile, Args(const Math::Vector3& target, cCombatant* arg), Args(target, arg));
}
#endif
11 changes: 9 additions & 2 deletions 3rdParty/Spore-ModAPI/Spore ModAPI/Spore ModAPI.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@
<ClInclude Include="Spore\Resource\RecordInfo.h" />
<ClInclude Include="Spore\Simulator\cAbilityUIMap.h" />
<ClInclude Include="Spore\Simulator\cAnimalCargoInfo.h" />
<ClInclude Include="Spore\Simulator\cArtilleryProjectile.h" />
<ClInclude Include="Spore\Simulator\cBaseDisplayStrategy.h" />
<ClInclude Include="Spore\Simulator\AI\cBehaviorTreeData.h" />
<ClInclude Include="Spore\Simulator\cBuildingEntertainment.h" />
Expand All @@ -405,7 +406,10 @@
<ClInclude Include="Spore\Simulator\cCreatureCitizen.h" />
<ClInclude Include="Spore\Simulator\cCreatureDisplayStrategy.h" />
<ClInclude Include="Spore\Simulator\cCreatureGameData.h" />
<ClInclude Include="Spore\Simulator\cCulturalProjectile.h" />
<ClInclude Include="Spore\Simulator\cCulturalTarget.h" />
<ClInclude Include="Spore\Simulator\cDeepSpaceProjectile.h" />
<ClInclude Include="Spore\Simulator\cDefaultToolProjectile.h" />
<ClInclude Include="Spore\Simulator\cEgg.h" />
<ClInclude Include="Spore\Simulator\cEllipticalOrbit.h" />
<ClInclude Include="Spore\Simulator\Cell\cCellGame.h" />
Expand All @@ -416,10 +420,12 @@
<ClInclude Include="Spore\Simulator\Cell\cCellSerialiazibleData.h" />
<ClInclude Include="Spore\Simulator\Cell\CellAnimations.h" />
<ClInclude Include="Spore\Simulator\Cell\CellFunctions.h" />
<ClInclude Include="Spore\Simulator\cFlakProjectile.h" />
<ClInclude Include="Spore\Simulator\cGamePlant.h" />
<ClInclude Include="Spore\Simulator\cGameplayMarker.h" />
<ClInclude Include="Spore\Simulator\cHerd.h" />
<ClInclude Include="Spore\Simulator\cHitSphere.h" />
<ClInclude Include="Spore\Simulator\cICBM.h" />
<ClInclude Include="Spore\Simulator\cInterCityRoad.h" />
<ClInclude Include="Spore\Simulator\cMission.h" />
<ClInclude Include="Spore\Simulator\cNest.h" />
Expand All @@ -436,7 +442,9 @@
<ClInclude Include="Spore\Simulator\cSimPlanetHighLOD.h" />
<ClInclude Include="Spore\Simulator\cSimulatorUniverse.h" />
<ClInclude Include="Spore\Simulator\cSolarHitSphere.h" />
<ClInclude Include="Spore\Simulator\cSpaceDefenseMissile.h" />
<ClInclude Include="Spore\Simulator\cSpaceNames.h" />
<ClInclude Include="Spore\Simulator\cSpear.h" />
<ClInclude Include="Spore\Simulator\cTimeOfDay.h" />
<ClInclude Include="Spore\Simulator\cTotemPole.h" />
<ClInclude Include="Spore\Simulator\cTribe.h" />
Expand All @@ -450,7 +458,7 @@
<ClInclude Include="Spore\Simulator\cBadgeManager.h" />
<ClInclude Include="Spore\Simulator\cMissionManager.h" />
<ClInclude Include="Spore\Simulator\IGameDataView.h" />
<ClInclude Include="Spore\Simulator\IProjectile.h" />
<ClInclude Include="Spore\Simulator\cProjectile.h" />
<ClInclude Include="Spore\Simulator\SimulatorEnums.h" />
<ClInclude Include="Spore\Simulator\SpaceConstants.h" />
<ClInclude Include="Spore\Simulator\SubSystem\AnimalSpeciesManager.h" />
Expand Down Expand Up @@ -595,7 +603,6 @@
<ClInclude Include="Spore\Simulator\cPlaceColonyToolStrategy.h" />
<ClInclude Include="Spore\Simulator\cPlaceObjectToolStrategy.h" />
<ClInclude Include="Spore\Simulator\cPlanetRecord.h" />
<ClInclude Include="Spore\Simulator\cProjectile.h" />
<ClInclude Include="Spore\Simulator\cRallyCallToolStrategy.h" />
<ClInclude Include="Spore\Simulator\cRepairAOEToolStrategy.h" />
<ClInclude Include="Spore\Simulator\cRepairToolStrategy.h" />
Expand Down
29 changes: 25 additions & 4 deletions 3rdParty/Spore-ModAPI/Spore ModAPI/Spore ModAPI.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -1146,9 +1146,6 @@
<ClInclude Include="Spore\Simulator\cDefaultBeamProjectile.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Spore\Simulator\cProjectile.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Spore\Simulator\cSimulatorSpaceGame.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand Down Expand Up @@ -1818,7 +1815,7 @@
<ClInclude Include="Spore\Simulator\cResourceProjectile.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Spore\Simulator\IProjectile.h">
<ClInclude Include="Spore\Simulator\cProjectile.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Spore\Simulator\cCombatSimulator.h">
Expand Down Expand Up @@ -2139,6 +2136,30 @@
<ClInclude Include="Spore\Simulator\cTurret.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Spore\Simulator\cDefaultToolProjectile.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Spore\Simulator\cDeepSpaceProjectile.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Spore\Simulator\cSpaceDefenseMissile.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Spore\Simulator\cArtilleryProjectile.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Spore\Simulator\cSpear.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Spore\Simulator\cFlakProjectile.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Spore\Simulator\cCulturalProjectile.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Spore\Simulator\cICBM.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="SourceCode\Allocator.cpp">
Expand Down
9 changes: 9 additions & 0 deletions 3rdParty/Spore-ModAPI/Spore ModAPI/Spore/Simulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@
#include <Spore\Simulator\cSolarSystem.h>
#include <Spore\Simulator\cScenarioEditHistory.h>
#include <Spore\Simulator\SpaceConstants.h>
#include <Spore\Simulator\cDefaultToolProjectile.h>
#include <Spore\Simulator\cDeepSpaceProjectile.h>
#include <Spore\Simulator\cSpaceDefenseMissile.h>
#include <Spore\Simulator\cArtilleryProjectile.h>
#include <Spore\Simulator\cFlakProjectile.h>
#include <Spore\Simulator\cCulturalProjectile.h>
#include <Spore\Simulator\cICBM.h>
#include <Spore\Simulator\cDefaultAoEArea.h>
#include <Spore\Simulator\cSpear.h>
#include <Spore\App\ScenarioMode.h>

#include <Spore\Simulator\SimulatorMessages.h>
Expand Down
34 changes: 0 additions & 34 deletions 3rdParty/Spore-ModAPI/Spore ModAPI/Spore/Simulator/IProjectile.h

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#pragma once

#include <Spore\Simulator\cGameData.h>
#include <Spore\Simulator\cLocomotiveObject.h>
#include <Spore\Simulator\cProjectile.h>
#include <Spore\Simulator\cCombatant.h>
#include <Spore\Simulator\cSpaceToolData.h>

#define cArtilleryProjectilePtr eastl::intrusive_ptr<Simulator::cArtilleryProjectile>

namespace Simulator
{
class cArtilleryProjectile
/* 00h */ : public cGameData
/* 34h */ , public cLocomotiveObject
/* 504h */ , public cProjectile
{
public:
static const uint32_t TYPE = 0x1428A48;
static const uint32_t NOUN_ID = 0x18C9380;

using Object::AddRef;
using Object::Release;
using Object::Cast;

/// Creates a `cBallisticLocomotion` locomotion strategy to start launching this projectile.
/// @param target
void LaunchProjectile(const Math::Vector3& target);

public:
/* 518h */ Math::Vector3 mLastPosition;
/* 524h */ cCombatantPtr mpOwner;
/* 528h */ int mMinDamage;
/* 52Ch */ int mMaxDamage;
/* 530h */ int mDamageType;
/* 534h */ cSpaceToolDataPtr mTool;
};
ASSERT_SIZE(cArtilleryProjectile, 0x538);

namespace Addresses(cArtilleryProjectile)
{
DeclareAddress(LaunchProjectile); // 0xCB68C0 0xCB71C0
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <Spore\Simulator\cGonzagoSimulator.h>
#include <Spore\Simulator\cGameData.h>
#include <Spore\Simulator\IProjectile.h>
#include <Spore\Simulator\cProjectile.h>
#include <Spore\App\IMessageListener.h>

namespace Simulator
Expand All @@ -19,10 +19,10 @@ namespace Simulator
using Object::Cast;

public:
/* 14h */ eastl::vector<IProjectilePtr> mProjectiles;
/* 28h */ eastl::vector<IProjectilePtr> field_28;
/* 14h */ eastl::vector<cProjectilePtr> mProjectiles;
/* 28h */ eastl::vector<cProjectilePtr> field_28;
/* 3Ch */ bool mIsUpdatingProjectiles;
/// If true, it collects all IProjectile instances and adds listener for SimulatorMessages::kMsgGameNounStatusChanged
/// If true, it collects all cProjectile instances and adds listener for SimulatorMessages::kMsgGameNounStatusChanged
/* 3Dh */ bool field_3D;
};
ASSERT_SIZE(cCombatSimulator, 0x40);
Expand Down
Loading

0 comments on commit 2a1713e

Please sign in to comment.