diff --git a/Runtime/Particle/CElementGen.cpp b/Runtime/Particle/CElementGen.cpp index fe3edaed1..c4157d81a 100644 --- a/Runtime/Particle/CElementGen.cpp +++ b/Runtime/Particle/CElementGen.cpp @@ -600,8 +600,52 @@ void CElementGen::UpdatePSTranslationAndOrientation() sspo->GetValue(x50_curFrame, x294_SEPO); } +CElementGen* CElementGen::ConstructChildParticleSystem(const TToken& desc) +{ + +} + void CElementGen::UpdateChildParticleSystems(double dt) { + CGlobalRandom gr(x230_randState); + SChildGeneratorDesc& icts = x1c_genDesc.GetObj()->x8c_ICTS; + if (icts.m_found && x64 != x50_curFrame && x244_CSSD == x50_curFrame) + { + int ncsyVal = 1; + CIntElement* ncsy = x1c_genDesc.GetObj()->x9c_NCSY.get(); + if (ncsy) + ncsy->GetValue(x50_curFrame, ncsyVal); + + CGenDescription* ictsDesc = icts.m_gen.GetObj(); + if (!(x226 && ictsDesc->x45_31_OPTS)) + { + x234_children.reserve(ncsyVal + x234_children.size()); + for (int i=0 ; ixb8_IITS; + if (iits.m_found && x64 != x50_curFrame && x50_curFrame < x214_PSLT && + x68_particleEmission == 1 && x50_curFrame >= x258_SISY && + ((x50_curFrame - x258_SISY) % x25c_PISY) == 0) + { + CGenDescription* iitsDesc = iits.m_gen.GetObj(); + if (!(x226 && iitsDesc->x45_31_OPTS)) + { + CElementGen* chGen = ConstructChildParticleSystem(iits.m_gen); + x234_children.emplace_back(chGen); + } + } + + CSpawnSystemKeyframeData* kssm = x1c_genDesc.GetObj()->xd0_KSSM.get(); + if (kssm && x64 != x50_curFrame && x50_curFrame < x214_PSLT) + { + } + } void CElementGen::UpdateLightParameters() diff --git a/Runtime/Particle/CElementGen.hpp b/Runtime/Particle/CElementGen.hpp index 31edf480c..6d9fdcc03 100644 --- a/Runtime/Particle/CElementGen.hpp +++ b/Runtime/Particle/CElementGen.hpp @@ -184,6 +184,7 @@ public: void CreateNewParticles(int); void UpdatePSTranslationAndOrientation(); void UpdateChildParticleSystems(double); + CElementGen* ConstructChildParticleSystem(const TToken&); void UpdateLightParameters(); void BuildParticleSystemBounds(); diff --git a/Runtime/Particle/CSpawnSystemKeyframeData.cpp b/Runtime/Particle/CSpawnSystemKeyframeData.cpp index e69de29bb..c0f03d10a 100644 --- a/Runtime/Particle/CSpawnSystemKeyframeData.cpp +++ b/Runtime/Particle/CSpawnSystemKeyframeData.cpp @@ -0,0 +1,50 @@ +#include "CSpawnSystemKeyframeData.hpp" +#include "CSimplePool.hpp" + +namespace Retro +{ + +CSpawnSystemKeyframeData::CSpawnSystemKeyframeData(CInputStream& in) +{ + x0 = in.readUint32Big(); + x4 = in.readUint32Big(); + x8 = in.readUint32Big(); + xc = in.readUint32Big(); + + u32 count = in.readUint32Big(); + x10_spawns.reserve(count); + for (u32 i=0 ; i()); + std::vector& v2 = x10_spawns.back().second; + u32 v2c = in.readUint32Big(); + v2.reserve(v2c); + for (u32 j=0 ; jGetObj({FOURCC('PART'), x0_id})); + x10_token.Lock(); + x18_found = true; +} + +} diff --git a/Runtime/Particle/CSpawnSystemKeyframeData.hpp b/Runtime/Particle/CSpawnSystemKeyframeData.hpp index 7251a8fde..1b5d1e606 100644 --- a/Runtime/Particle/CSpawnSystemKeyframeData.hpp +++ b/Runtime/Particle/CSpawnSystemKeyframeData.hpp @@ -2,13 +2,35 @@ #define __RETRO_CSPAWNSYSTEMKEYFRAMEDATA_HPP__ #include "IOStreams.hpp" +#include "CToken.hpp" namespace Retro { class CSimplePool; +class CGenDescription; class CSpawnSystemKeyframeData { +public: + class CSpawnSystemKeyframeInfo + { + friend class CSpawnSystemKeyframeData; + u32 x0_id; + u32 x4; + u32 x8; + u32 xc; + TToken x10_token; + bool x18_found = false; + void LoadToken(CSimplePool* pool); + public: + CSpawnSystemKeyframeInfo(CInputStream& in); + }; +private: + u32 x0; + u32 x4; + u32 x8; + u32 xc; + std::vector>> x10_spawns; public: CSpawnSystemKeyframeData(CInputStream& in); void LoadAllSpawnedSystemTokens(CSimplePool* pool);