Skip to content

Commit ea28322

Browse files
committed
Add cCollectableItems. Add PaletteIterator. Add cCreatureModeStrategy::ExecuteAction(). Fix ResourceKey when used in hash_maps.
1 parent 7050bf8 commit ea28322

18 files changed

Lines changed: 269 additions & 18 deletions

EASTL-3.02.01/include/EASTL/fixed_hash_map.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ namespace eastl
807807
}
808808

809809

810-
/// Spore equivalent of fixed_list; only reading is supported, adding elements might crash.
810+
/// Spore equivalent of fixed_hash_map; only reading is supported, adding elements might crash.
811811
template <typename Key, typename T, size_t nodeCount, size_t bucketCount = nodeCount + 1,
812812
typename Hash = eastl::hash<Key>, typename Predicate = eastl::equal_to<Key>>
813813
class sp_fixed_hash_map : public hash_map<Key, T, Hash, Predicate>

EASTL-3.02.01/include/EASTL/fixed_hash_set.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,24 @@ namespace eastl
808808
}
809809

810810

811+
812+
/// Spore equivalent of fixed_hash_set; only reading is supported, adding elements might crash.
813+
template <typename Value, size_t nodeCount, size_t bucketCount = nodeCount + 1, bool bEnableOverflow = true,
814+
typename Hash = eastl::hash<Value>, typename Predicate = eastl::equal_to<Value>, bool bCacheHashCode = false, typename OverflowAllocator = EASTLAllocatorType>
815+
class sp_fixed_hash_set : public hash_set<Value, Hash, Predicate>
816+
{
817+
public:
818+
typedef hash_set<Value, Hash, Predicate> base_type;
819+
typedef typename base_type::node_type node_type;
820+
typedef typename base_type::size_type size_type;
821+
822+
public:
823+
/* 20h */ int mPoolAllocator[5]; // actually part of mAllocator
824+
/* 34h */ node_type** mBucketBuffer[bucketCount + 1];
825+
char mPoolBuffer[(nodeCount + 1) * sizeof(node_type) + (bucketCount + 1) * 4];
826+
};
827+
828+
811829
} // namespace eastl
812830

813831
EA_RESTORE_VC_WARNING()

Spore ModAPI/SourceCode/App/App.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ namespace App
3434

3535
auto_STATIC_METHOD_(cIDGenerator, cIDGenerator*, Get);
3636

37-
auto_STATIC_METHOD_(cCreatureModeStrategy, cCreatureModeStrategy*, Get);
38-
3937
auto_STATIC_METHOD_(IAppSystem, IAppSystem*, Get);
4038

4139
auto_STATIC_METHOD(cSporeApp, int, EAMain, Args(CommandLine* commandLine), Args(commandLine));
@@ -90,6 +88,13 @@ namespace App
9088

9189
auto_STATIC_METHOD_(cAppSystem, cAppSystem*, Create);
9290

91+
92+
//// cCreatureModeStrategy ////
93+
94+
auto_STATIC_METHOD_(cCreatureModeStrategy, cCreatureModeStrategy*, Get);
95+
96+
auto_METHOD_VOID(cCreatureModeStrategy, ExecuteAction, Args(uint32_t actionID, void* actionData), Args(actionID, actionData));
97+
9398
#endif
9499

95100

Spore ModAPI/SourceCode/DLL/AddressesApp.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ namespace App
450450
namespace Addresses(cCreatureModeStrategy)
451451
{
452452
DefineAddress(Get, SelectAddress(0xD2D640, 0xD38840));
453+
DefineAddress(ExecuteAction, SelectAddress(0xD38770, 0xD39360));
453454
}
454455

455456
namespace Addresses(cCellModeStrategy)

Spore ModAPI/SourceCode/DLL/AddressesPalettes.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <Spore\Palettes\PalettePage.h>
1212
#include <Spore\Palettes\PalettePageUI.h>
1313
#include <Spore\Palettes\PaletteUI.h>
14+
#include <Spore\Palettes\PaletteIterator.h>
1415
#include <Spore\Palettes\StandardItemUI.h>
1516
#include <Spore\Palettes\SwatchManager.h>
1617

@@ -152,5 +153,13 @@ namespace Palettes
152153

153154
DefineAddress(Initialize, SelectAddress(0x5F4170, 0x5F43A0));
154155
}
156+
157+
namespace Addresses(PaletteIterator)
158+
{
159+
DefineAddress(Init, SelectAddress(0x5C7C80, 0x5C7CB0));
160+
DefineAddress(HasNext, SelectAddress(0x5C7CD0, 0x5C7D00));
161+
DefineAddress(Start, SelectAddress(0x5C7F40, 0x5C7F70));
162+
DefineAddress(Next, SelectAddress(0x5C7EE0, 0x5C7F10));
163+
}
155164
}
156165
#endif

Spore ModAPI/SourceCode/DLL/AddressesSimulator.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@
7878
#include <Spore\Simulator\cCulturalProjectile.h>
7979
#include <Spore\Simulator\cFlakProjectile.h>
8080
#include <Spore\Simulator\cResourceProjectile.h>
81+
#include <Spore\Simulator\cCollectableItems.h>
8182
#include <Spore\Simulator\cSpaceDefenseMissile.h>
83+
#include <Spore\Simulator\cDefaultToolProjectile.h>
8284
#include <Spore\Simulator\SubSystem\cRelationshipManager.h>
8385
#include <Spore\Simulator\SubSystem\GameBehaviorManager.h>
8486
#include <Spore\Simulator\SubSystem\GameInputManager.h>
@@ -1021,6 +1023,13 @@ namespace Simulator
10211023
{
10221024
DefineAddress(LaunchProjectile, SelectAddress(0xCB7FD0, 0xCB88B0));
10231025
}
1026+
1027+
namespace Addresses(cCollectableItems)
1028+
{
1029+
DefineAddress(LoadConfig, SelectAddress(0x599100, 0x599440));
1030+
DefineAddress(AddUnlockableItem, SelectAddress(0x598A70, 0x598DB0));
1031+
DefineAddress(AddUnlockableItemFromProp, SelectAddress(0x598B50, 0x598E90));
1032+
}
10241033
}
10251034

10261035
#ifdef SDK_TO_GHIDRA

Spore ModAPI/SourceCode/Editors/EditorPalettes.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <Spore\Palettes\PaletteUI.h>
2626
#include <Spore\Palettes\PaletteCategoryUI.h>
2727
#include <Spore\Palettes\PalettePageUI.h>
28+
#include <Spore\Palettes\PaletteIterator.h>
2829
#include <Spore\Palettes\ItemViewer.h>
2930
#include <Spore\Palettes\AdvancedItemViewer.h>
3031
#include <Spore\Palettes\SwatchManager.h>
@@ -673,5 +674,18 @@ namespace Palettes
673674
, field_1BC()
674675
{
675676
}
677+
678+
679+
auto_METHOD_VOID(PaletteIterator, Init, Args(PaletteMain* palette), Args(palette));
680+
681+
auto_METHOD_(PaletteIterator, bool, HasNext);
682+
683+
auto_METHOD(PaletteIterator, PaletteItem*, Start,
684+
Args(uint32_t* dstCategoryID, int* dstColumn, int* dstRow, int* dstPageIndex),
685+
Args(dstCategoryID, dstColumn, dstRow, dstPageIndex));
686+
687+
auto_METHOD(PaletteIterator, PaletteItem*, Next,
688+
Args(uint32_t* dstCategoryID, int* dstColumn, int* dstRow, int* dstPageIndex),
689+
Args(dstCategoryID, dstColumn, dstRow, dstPageIndex));
676690
}
677691
#endif

Spore ModAPI/SourceCode/Simulator/SimulatorMisc.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <Spore\Simulator\cFlakProjectile.h>
1414
#include <Spore\Simulator\cResourceProjectile.h>
1515
#include <Spore\Simulator\cSpaceDefenseMissile.h>
16+
#include <Spore\Simulator\cCollectableItems.h>
1617

1718
namespace Simulator
1819
{
@@ -121,5 +122,20 @@ namespace Simulator
121122
//// cSpaceDefenseMissile ////
122123

123124
auto_METHOD_VOID(cSpaceDefenseMissile, LaunchProjectile, Args(const Math::Vector3& target, cCombatant* arg), Args(target, arg));
125+
126+
127+
//// cCollectableItems ////
128+
129+
auto_METHOD_VOID(cCollectableItems, LoadConfig,
130+
Args(uint32_t configGroupID, uint32_t configInstanceID, uint32_t itemsGroupID),
131+
Args(configGroupID, configInstanceID, itemsGroupID));
132+
133+
auto_METHOD_VOID(cCollectableItems, AddUnlockableItem,
134+
Args(uint32_t instanceID, uint32_t groupID, int itemUnlockLevel, uint32_t categoryID, int row, int column, int pageIndex, float itemUnlockFindPercentage, uint32_t itemUnlockEffect),
135+
Args(instanceID, groupID, itemUnlockLevel, categoryID, row, column, pageIndex, itemUnlockFindPercentage, itemUnlockEffect));
136+
137+
auto_METHOD(cCollectableItems, bool, AddUnlockableItemFromProp,
138+
Args(struct ResourceKey key, uint32_t categoryID, int row, int column, int pageIndex),
139+
Args(key, categoryID, row, column, pageIndex));
124140
}
125141
#endif

Spore ModAPI/Spore ModAPI.vcxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@
382382
<ClInclude Include="Spore\Palettes\AdvancedItemViewer.h" />
383383
<ClInclude Include="Spore\Palettes\cSPScenarioBrushItemUI.h" />
384384
<ClInclude Include="Spore\Palettes\PaletteInfo.h" />
385+
<ClInclude Include="Spore\Palettes\PaletteIterator.h" />
385386
<ClInclude Include="Spore\Palettes\PaletteSubcategoriesUI.h" />
386387
<ClInclude Include="Spore\Palettes\SwatchManager.h" />
387388
<ClInclude Include="Spore\Pollinator\AchievementsManager.h" />
@@ -401,6 +402,7 @@
401402
<ClInclude Include="Spore\Simulator\cBuildingCityHall.h" />
402403
<ClInclude Include="Spore\Simulator\cBuildingHouse.h" />
403404
<ClInclude Include="Spore\Simulator\cBuildingIndustry.h" />
405+
<ClInclude Include="Spore\Simulator\cCollectableItems.h" />
404406
<ClInclude Include="Spore\Simulator\cCombatSimulator.h" />
405407
<ClInclude Include="Spore\Simulator\cCommodityNode.h" />
406408
<ClInclude Include="Spore\Simulator\cCommunityLayout.h" />

Spore ModAPI/Spore ModAPI.vcxproj.filters

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2127,7 +2127,7 @@
21272127
<ClInclude Include="Spore\Simulator\SubSystem\SpaceTrading.h">
21282128
<Filter>Header Files</Filter>
21292129
</ClInclude>
2130-
<ClInclude Include="Spore\Simulator\cCommunityLayout.h">
2130+
<ClInclude Include="Spore\Simulator\cCommunityLayout.h">
21312131
<Filter>Header Files</Filter>
21322132
</ClInclude>
21332133
<ClInclude Include="Spore\Simulator\cCulturalTarget.h">
@@ -2161,9 +2161,15 @@
21612161
<Filter>Header Files</Filter>
21622162
</ClInclude>
21632163
<ClInclude Include="Spore\Editors\VerbIconData.h">
2164-
<Filter>Header Files</Filter>
2164+
<Filter>Header Files</Filter>
2165+
</ClInclude>
2166+
<ClInclude Include="Spore\Simulator\SubSystem\GamePersistenceManager.h">
2167+
<Filter>Header Files</Filter>
2168+
</ClInclude>
2169+
<ClInclude Include="Spore\Simulator\cCollectableItems.h">
2170+
<Filter>Header Files</Filter>
21652171
</ClInclude>
2166-
<ClInclude Include="Spore\Simulator\SubSystem\GamePersistenceManager.h">
2172+
<ClInclude Include="Spore\Palettes\PaletteIterator.h">
21672173
<Filter>Header Files</Filter>
21682174
</ClInclude>
21692175
</ItemGroup>

0 commit comments

Comments
 (0)