3030#include < Spore\Audio\AudioSystem.h>
3131#include < Spore\Simulator\cObjectPool.h>
3232#include < Spore\Simulator\Cell\cCellResource.h>
33+ #include < Spore\Simulator\Cell\cCellObjectData.h>
3334
3435#define CellGFX (*Simulator::Cell::cCellGFX::Get ())
3536
@@ -84,10 +85,81 @@ namespace Simulator
8485 // / @param dst
8586 static void CreateEffect (Swarm::IEffectsWorld* effectsWorld, uint32_t instanceID, uint32_t groupID, IVisualEffectPtr& dst);
8687
88+ static Swarm::IVisualEffect* InstanceEffectOnCell (cCellObjectData* cell, uint32_t effectID);
89+
8790 // / Loads and places all the effects from the cCellGlobalsResource::effectMapEntry effect map.
8891 static void LoadEffectMap ();
8992
93+ // / Returns the bounding box for the currently visible background.
94+ static Math::BoundingBox& GetVisibleBackgroundBBox ();
95+ #ifdef SDK_TO_GHIDRA
96+ Math::BoundingBox sVisibleBackgroundBBox ;
97+ #endif
98+
99+ // / Returns the frustum cull for the currently visible main cell level.
100+ static Graphics::cFrustumCull& GetFrustumCull ();
101+ #ifdef SDK_TO_GHIDRA
102+ Math::BoundingBox sFrustumCull ;
103+ #endif
104+
90105 public:
106+ struct EffectInstance
107+ {
108+ /* 00h */ Transform localTransform;
109+ /* 38h */ Transform cellTransform;
110+ /* 74h */ IVisualEffectPtr effect;
111+ };
112+ ASSERT_SIZE (EffectInstance, 0x74 );
113+
114+ // / The graphical representation of a cell object: its model, animated creature, etc.
115+ struct CellGFXObjectData
116+ : public cObjectPoolClass
117+ {
118+ /* 04h */ int field_04;
119+ /* 08h */ int field_08;
120+ // / Index to the cell object in cCellGame::mCells that this object represents
121+ /* 0Ch */ cObjectPoolIndex mCellIndex ;
122+ /* 10h */ int field_10;
123+ /* 14h */ cCellDataReference<cCellStructureResource>* mpStructure;
124+ /* 18h */ int field_18;
125+ /* 1Ch */ int field_1C;
126+ /* 20h */ int field_20;
127+ /* 24h */ Anim::AnimatedCreature* mpAnimatedCreature;
128+ /* 28h */ ModelPtr mpModel;
129+ // Either Swarm::IVisualEffect*, Graphics::Model*, Anim::AnimatedCreature*
130+ /* 2Ch */ void * mStructureGFXs [10 ]; // TODO how many?
131+ /* 54h */ int mNumStructureGFX ;
132+ /* 58h */ float field_58;
133+ /* 5Ch */ bool field_5C;
134+ /* 60h */ ObjectPtr field_60;
135+ /* 64h */ int field_64;
136+ /* 68h */ int field_68;
137+ /* 6Ch */ int field_6C;
138+ /* 70h */ int field_70;
139+ /* 74h */ int field_74;
140+ /* 78h */ int field_78;
141+ /* 7Ch */ int field_7C;
142+ /* 80h */ int field_80;
143+ /* 84h */ int field_84;
144+ /* 88h */ int field_88;
145+ /* 8Ch */ ObjectPtr field_8C;
146+ /* 90h */ int field_90;
147+ /* 94h */ int field_94;
148+ /* 98h */ ObjectPtr field_98;
149+ /* 9Ch */ ObjectPtr field_9C;
150+ /* A0h */ ObjectPtr field_A0;
151+ /* A4h */ ObjectPtr field_A4;
152+ /* A8h */ ObjectPtr field_A8;
153+ /* ACh */ int field_AC;
154+ /* B0h */ int field_B0;
155+ /* B4h */ int field_B4;
156+ /* B8h */ int field_B8;
157+ /* BCh */ int field_BC;
158+ /* C0h */ int field_C0;
159+ /* C4h */ int field_C4;
160+ };
161+ ASSERT_SIZE (CellGFXObjectData, 0xC8 );
162+
91163 /* 00h */ eastl::vector<ModelPtr> mPreloadedModels ;
92164 /* 14h */ eastl::vector<TexturePtr> mPreloadedTextures ;
93165 /* 28h */ eastl::vector<Anim::AnimatedCreature*> mPreloadedCreatures ;
@@ -103,7 +175,8 @@ namespace Simulator
103175 /* 15Ch */ int field_15C;
104176 /* 160h */ IVisualEffectPtr mpDoFDistortEffect;
105177 /* 164h */ int field_164;
106- /* 168h */ cObjectPool_ field_168;
178+ // / 256 objects of size 0xC8
179+ /* 168h */ cObjectPool<CellGFXObjectData> mCellGFXObjects ;
107180 /* 184h */ eastl::fixed_vector<int , 22528 > field_184;
108181 /* 1619Ch */ int field_1619C; // not initialized
109182 /* 161A0h */ ILightingWorldPtr mpLightingWorld;
@@ -121,10 +194,9 @@ namespace Simulator
121194 /* 161D0h */ IAnimWorldPtr mpAnimWorld;
122195 /* 161D4h */ IEffectsWorldPtr mpForegroundEffectWorld;
123196 /* 161D8h */ int field_161D8;
124- /* 161DCh */ int field_161DC;
125- /* 161E0h */ int field_161E0;
126- /* 161E4h */ int field_161E4;
127- /* 161E8h */ char padding_161E8[0x16208 - 0x161E8 ]; // not initialized
197+ // / Current effects
198+ /* 161DCh */ eastl::vector<EffectInstance> mEffectInstances ;
199+ /* 161F0h */ char padding_161F0[0x16208 - 0x161F0 ]; // not initialized
128200 /* 16208h */ Audio::AudioTrack mCellMotionAudioTrack ; // not initialized
129201 /* 1620Ch */ Audio::AudioTrack mCellgameSeedMusicAudioTrack ; // not initialized
130202 /* 16210h */ Audio::AudioTrack mCellAmbAudioTrack ; // not initialized
@@ -152,6 +224,9 @@ namespace Simulator
152224 DeclareAddress (StartDisplay); // 0xE55780 0xE55120
153225 DeclareAddress (CreateEffect); // 0x628470 0x628480
154226 DeclareAddress (LoadEffectMap); // 0xE63AF0 0xE63560
227+ DeclareAddress (InstanceEffectOnCell); // 0xE66DE0 0xE66840
228+ DeclareAddress (sVisibleBackgroundBBox_ptr ); // 0x16B7F08 0x16B3C88
229+ DeclareAddress (sFrustumCull_ptr ); // 0x16B7F38 0x16B3CB8
155230 }
156231 }
157232}
0 commit comments