Skip to content

Commit bfc59b5

Browse files
committed
Fix bug in IWindow::GetFillColor and GetShadeColor.
Add cPlanetRecord::GetCitizenSpeciesKey()
1 parent 2e3e0d3 commit bfc59b5

File tree

6 files changed

+17
-9
lines changed

6 files changed

+17
-9
lines changed

Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,7 @@ namespace Simulator
842842
DefineAddress(GetTerrainScriptSource, SelectAddress(0xB8D690, 0xB8DEB0));
843843
DefineAddress(HasControlledCity, SelectAddress(0xC6F4B0, 0xC702F0));
844844
DefineAddress(GetTypeIconKey, SelectAddress(0xE2EBE0, 0xE2EB70));
845+
DefineAddress(GetCitizenSpeciesKey, SelectAddress(0xB8D9C0, 0xB8E1E0));
845846
}
846847

847848
namespace Addresses(cCivData) {

Spore ModAPI/SourceCode/Simulator/Planets.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ namespace Simulator
8080
return key;
8181
}
8282

83-
ResourceKey cPlanetRecord::GetTerrainScriptSource() const {
83+
ResourceKey cPlanetRecord::GetTerrainScriptSource() {
8484
ResourceKey key;
8585
STATIC_CALL(GetAddress(cPlanetRecord, GetTerrainScriptSource), void, Args(ResourceKey&), Args(key));
8686
return key;
@@ -90,6 +90,8 @@ namespace Simulator
9090
Args(cPlanetRecord* planetRecord, cEmpire* empire, bool requireMoreThanOneTurret),
9191
Args(planetRecord, empire, requireMoreThanOneTurret));
9292

93-
auto_METHOD_(cPlanetRecord, const ResourceKey&, GetTypeIconKey);
93+
auto_STATIC_METHOD(cPlanetRecord, const ResourceKey&, GetTypeIconKey, Args(cPlanetRecord* record), Args(record));
94+
95+
auto_METHOD_(cPlanetRecord, const ResourceKey&, GetCitizenSpeciesKey);
9496
}
9597
#endif

Spore ModAPI/SourceCode/UTFWin/Window.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ namespace UTFWin
128128
auto_METHOD_VIRTUAL_const_(Window, IWindow, uint32_t, GetCursorID);
129129
auto_METHOD_VIRTUAL_const_(Window, IWindow, WindowFlags, GetFlags);
130130
auto_METHOD_VIRTUAL_const_(Window, IWindow, int, GetState);
131-
auto_METHOD_VIRTUAL_const_(Window, IWindow, Math::Color, GetShadeColor);
131+
auto_METHOD_VIRTUAL_const_(Window, IWindow, int, GetShadeColor);
132132
auto_METHOD_VIRTUAL_const_(Window, IWindow, const Math::Rectangle&, GetArea);
133133
auto_METHOD_VIRTUAL_const_(Window, IWindow, const Math::Rectangle&, GetRealArea);
134134
auto_METHOD_VIRTUAL_const_(Window, IWindow, const char16_t*, GetCaption);
@@ -157,7 +157,7 @@ namespace UTFWin
157157
auto_METHOD_VIRTUAL_(Window, IWindow, int, InvalidateTransform);
158158
auto_METHOD_VIRTUAL_(Window, IWindow, int, func39);
159159
auto_METHOD_VIRTUAL_(Window, IWindow, int, func40);
160-
auto_METHOD_VIRTUAL_const_(Window, IWindow, Color, GetFillColor);
160+
auto_METHOD_VIRTUAL_const_(Window, IWindow, int, GetFillColor);
161161
auto_METHOD_VIRTUAL_const_(Window, IWindow, IDrawable*, GetDrawable);
162162
auto_METHOD_VIRTUAL_VOID(Window, IWindow, SetFillColor, Args(Color color), Args(color));
163163
auto_METHOD_VIRTUAL_VOID(Window, IWindow, SetDrawable, Args(IDrawable* drawable), Args(drawable));

Spore ModAPI/Spore/Simulator/cPlanetRecord.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,13 @@ namespace Simulator
190190

191191
ResourceKey GetTerrainScriptSource();
192192

193+
/// Return the key of the sentient species that inhabits this planet.
194+
/// Only for tribe or greater tech level.
195+
const ResourceKey& GetCitizenSpeciesKey();
196+
193197
/// Returns the key to the icon that is displayed in planet tooltip.
194198
/// This depends on tech level, and whether it has an adventure.
195-
const ResourceKey& GetTypeIconKey();
199+
static const ResourceKey& GetTypeIconKey(cPlanetRecord* record);
196200

197201
/// Generates a `.prop` file ResourceKey that is currently unused in game packages, so that
198202
/// the planet terrain can be saved there.
@@ -311,6 +315,7 @@ namespace Simulator
311315
DeclareAddress(GetTerrainScriptSource); // 0xB8D690 0xB8DEB0
312316
DeclareAddress(HasControlledCity); // 0xC6F4B0 0xC702F0
313317
DeclareAddress(GetTypeIconKey); // 0xE2EBE0 0xE2EB70
318+
DeclareAddress(GetCitizenSpeciesKey); // 0xB8D9C0 0xB8E1E0
314319
}
315320

316321
inline ResourceKey cPlanetRecord::GenerateTerrainKey()

Spore ModAPI/Spore/UTFWin/IWindow.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ namespace UTFWin
140140
/// Returns the color modulation value. This color acts as a tint: after the window is painted, it gets multiplied by this color.
141141
/// @returns The integer color representation of the value of the 'shadeColor' property.
142142
///
143-
/* 30h */ virtual Math::Color GetShadeColor() const = 0;
143+
/* 30h */ virtual int GetShadeColor() const = 0;
144144

145145
///
146146
/// Gets the rectangular extent of this window, relative to the window's parent. Note this is the 'area' property,
@@ -305,7 +305,7 @@ namespace UTFWin
305305
/// the area will be filled with the fill color and then the fill drawable will be drawn on top of it.
306306
/// @returns The integer color representation of the value of the 'fillColor' property.
307307
///
308-
/* A4h */ virtual Math::Color GetFillColor() const = 0;
308+
/* A4h */ virtual int GetFillColor() const = 0;
309309

310310
///
311311
/// Returns the fill drawable of this window. When rendering the window,

Spore ModAPI/Spore/UTFWin/Window.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ namespace UTFWin
6565
virtual uint32_t GetCursorID() const override;
6666
virtual WindowFlags GetFlags() const override;
6767
virtual int GetState() const override;
68-
virtual Math::Color GetShadeColor() const override;
68+
virtual int GetShadeColor() const override;
6969
virtual const Math::Rectangle& GetArea() const override;
7070
virtual const Math::Rectangle& GetRealArea() const override;
7171
virtual const char16_t* GetCaption() const override;
@@ -94,7 +94,7 @@ namespace UTFWin
9494
virtual int InvalidateTransform() override;
9595
virtual int func39() override;
9696
virtual int func40() override;
97-
virtual Color GetFillColor() const override;
97+
virtual int GetFillColor() const override;
9898
virtual IDrawable* GetDrawable() const override;
9999
virtual void SetFillColor(Color color) override;
100100
virtual void SetDrawable(IDrawable* drawable) override;

0 commit comments

Comments
 (0)