Skip to content

Commit 34a1edb

Browse files
committed
Add cPlanetRecord::FillPlanetDataForTechLevel() and cCivData::AddCityData().
1 parent b33d3e2 commit 34a1edb

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,11 @@ namespace Simulator
797797
{
798798
DefineAddress(Create, SelectAddress(0xBA5920, 0xBA6300));
799799
DefineAddress(GetPerihelion, SelectAddress(0xC70190, 0xC70FC0));
800+
DefineAddress(FillPlanetDataForTechLevel, SelectAddress(0xB96820, 0xB97090));
801+
}
802+
803+
namespace Addresses(cCivData) {
804+
DefineAddress(AddCityData, SelectAddress(0xFF35E0, 0xFF2B20));
800805
}
801806

802807
namespace Addresses(cSpaceGfx)

Spore ModAPI/SourceCode/Simulator/Planets.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,10 @@ namespace Simulator
5757
Args(cPlanetRecord* pRecord, MoonPerihelionType moonType), Args(pRecord, moonType));
5858

5959
auto_METHOD(cPlanet, uint32_t, GetRingEffect, Args(bool isFromPlanet), Args(isFromPlanet));
60+
61+
auto_STATIC_METHOD_VOID(cPlanetRecord, FillPlanetDataForTechLevel,
62+
Args(cPlanetRecord* planetRecord, TechLevel techLevel), Args(planetRecord, techLevel));
63+
64+
auto_METHOD_VOID(cCivData, AddCityData, Args(cCityData* cityData), Args(cityData));
6065
}
6166
#endif

Spore ModAPI/Spore/Simulator/cPlanetRecord.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,15 @@ namespace Simulator
109109
/* 24h */ int mNumBuildings;
110110
/* 28h */ eastl::vector<cVehicleData*> mVehicles;
111111
/* 3Ch */ eastl::vector<cCityData*> mCities;
112+
113+
/// Adds the given city data to this civilization data, and recalculates the number of turrets and buildings.
114+
/// @param cityData
115+
void AddCityData(cCityData* cityData);
112116
};
113117
ASSERT_SIZE(cCivData, 0x50);
118+
namespace Addresses(cCivData) {
119+
DeclareAddress(AddCityData); // 0xFF35E0 0xFF2B20
120+
}
114121

115122
struct cTribeData
116123
{
@@ -185,6 +192,13 @@ namespace Simulator
185192

186193
static void Create(PlanetID planetId, cPlanetRecordPtr& dst);
187194

195+
/// Generates the civilization/tribe data, including cities, for a planet record.
196+
/// The number and type of cities will depend on whether it is Empire or Civilization level.
197+
/// For Empire level, the owner star of the planet must belong to an empire.
198+
/// @param planetRecord
199+
/// @param techLevel
200+
static void FillPlanetDataForTechLevel(cPlanetRecord* planetRecord, TechLevel techLevel);
201+
188202
public:
189203
/* 18h */ eastl::string16 mName;
190204
/// The type of the planet, which determines whether it is a gas giant, asteroid belt, or regular rocky planet.
@@ -237,6 +251,7 @@ namespace Simulator
237251
{
238252
DeclareAddress(Create); // 0xBA5920, 0xBA6300
239253
DeclareAddress(GetPerihelion); // 0xC70190 0xC70FC0
254+
DeclareAddress(FillPlanetDataForTechLevel); // 0xB96820 0xB97090
240255
}
241256

242257
inline ResourceKey cPlanetRecord::GenerateTerrainKey()

0 commit comments

Comments
 (0)