diff --git a/Runtime/Particle/CDecalDataFactory.cpp b/Runtime/Particle/CDecalDataFactory.cpp index e69de29bb..06a205fb4 100644 --- a/Runtime/Particle/CDecalDataFactory.cpp +++ b/Runtime/Particle/CDecalDataFactory.cpp @@ -0,0 +1,12 @@ +#include "CDecalDataFactory.hpp" +#include "CDecalDescription.hpp" +#include "CSimplePool.hpp" + +namespace Retro +{ +std::unique_ptr FDealDataFactory(const SObjectTag &tag, CInputStream &in, const CVParamTransfer &vparms) +{ + CSimplePool* sp = static_cast(static_cast*>(vparms.GetObj())->GetParam()); + return TToken::GetIObjObjectFor(std::unique_ptr(CDecalDataFactory::GetGeneratorDesc(in, sp))); +} +} diff --git a/Runtime/Particle/CDecalDataFactory.hpp b/Runtime/Particle/CDecalDataFactory.hpp index 2cf45b71f..b406b5b68 100644 --- a/Runtime/Particle/CDecalDataFactory.hpp +++ b/Runtime/Particle/CDecalDataFactory.hpp @@ -1,4 +1,25 @@ #ifndef __RETRO_CDECALDATAFACTORY_HPP__ #define __RETRO_CDECALDATAFACTORY_HPP__ +#include "RetroTypes.hpp" +#include "IObj.hpp" +#include "CToken.hpp" +#include "IOStreams.hpp" + + +namespace Retro +{ +class CDecalDescription; +class CSimplePool; + +class CDecalDataFactory +{ +public: + static CDecalDescription* GetGeneratorDesc(CInputStream& in,CSimplePool* resPool); + static CDecalDescription* CreateGeneratorDescription(CInputStream& in, CSimplePool* resPool); + static bool CreateDPSM(CDecalDescription* desc,CInputStream& in,CSimplePool* resPool); +}; + +std::unique_ptr FDealDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms); +} #endif // __RETRO_CDECALDATAFACTORY_HPP__ diff --git a/Runtime/Particle/CDecalDescription.hpp b/Runtime/Particle/CDecalDescription.hpp index 1f5e4db83..b862552bc 100644 --- a/Runtime/Particle/CDecalDescription.hpp +++ b/Runtime/Particle/CDecalDescription.hpp @@ -1,4 +1,11 @@ #ifndef __RETRO_CDECALDESCRIPTION_HPP__ #define __RETRO_CDECALDESCRIPTION_HPP__ +namespace Retro +{ +class CDecalDescription +{ +}; + +} #endif // __RETRO_CDECALDESCRIPTION_HPP__ diff --git a/Runtime/Particle/CElectricDescription.hpp b/Runtime/Particle/CElectricDescription.hpp index 114c73392..f2e81bcd0 100644 --- a/Runtime/Particle/CElectricDescription.hpp +++ b/Runtime/Particle/CElectricDescription.hpp @@ -1,4 +1,11 @@ #ifndef __RETRO_CELECTRICDESCRIPTION_HPP__ #define __RETRO_CELECTRICDESCRIPTION_HPP__ +namespace Retro +{ +namespace CElectricDescription +{ +} +} + #endif // __RETRO_CELECTRICDESCRIPTION_HPP__ diff --git a/Runtime/Particle/CMakeLists.txt b/Runtime/Particle/CMakeLists.txt index b1d78387c..1dc435eaa 100644 --- a/Runtime/Particle/CMakeLists.txt +++ b/Runtime/Particle/CMakeLists.txt @@ -15,7 +15,9 @@ add_library(RuntimeCommonParticle CWeaponDescription.hpp CWeaponDescription.cpp CDecalDataFactory.hpp CDecalDataFactory.cpp CElementGen.hpp CElementGen.cpp + CParticleSwooshDataFactory.hpp CParticleSwooshDataFactory.cpp CParticleSwoosh.hpp CParticleSwoosh.cpp + CParticleElectricDataFactory.hpp CParticleElectricDataFactory.cpp CParticleElectric.hpp CParticleElectric.cpp CDecalManager.hpp CDecalManager.cpp CSpawnSystemKeyframeData.hpp CSpawnSystemKeyframeData.cpp diff --git a/Runtime/Particle/CParticleDataFactory.hpp b/Runtime/Particle/CParticleDataFactory.hpp index aad04199d..764fd905b 100644 --- a/Runtime/Particle/CParticleDataFactory.hpp +++ b/Runtime/Particle/CParticleDataFactory.hpp @@ -48,6 +48,10 @@ struct SElectricGeneratorDesc class CParticleDataFactory { + friend class CDecalDataFactory; + friend class CParticleElectricDataFactory; + friend class CParticleSwooshDataFactory; + static SParticleModel GetModel(CInputStream& in, CSimplePool* resPool); static SChildGeneratorDesc GetChildGeneratorDesc(TResId res, CSimplePool* resPool, const std::vector& tracker); static SChildGeneratorDesc GetChildGeneratorDesc(CInputStream& in, CSimplePool* resPool, const std::vector& tracker); @@ -65,7 +69,6 @@ class CParticleDataFactory static int32_t GetInt(CInputStream& in); static bool GetBool(CInputStream& in); static FourCC GetClassID(CInputStream& in); - public: static CGenDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool); static CGenDescription* CreateGeneratorDescription(CInputStream& in, std::vector& tracker, diff --git a/Runtime/Particle/CParticleElectric.hpp b/Runtime/Particle/CParticleElectric.hpp index 6d262b5ba..232a0e2b3 100644 --- a/Runtime/Particle/CParticleElectric.hpp +++ b/Runtime/Particle/CParticleElectric.hpp @@ -1,7 +1,7 @@ #ifndef __RETRO_CPARTICLEELECTRIC_HPP__ #define __RETRO_CPARTICLEELECTRIC_HPP__ -#include "CParticleGen.hpp" +#include "CElementGen.hpp" namespace Retro { diff --git a/Runtime/Particle/CParticleElectricDataFactory.cpp b/Runtime/Particle/CParticleElectricDataFactory.cpp new file mode 100644 index 000000000..c7f0696bb --- /dev/null +++ b/Runtime/Particle/CParticleElectricDataFactory.cpp @@ -0,0 +1,24 @@ +#include "CParticleElectricDataFactory.hpp" +#include "CElectricDescription.hpp" +#include "CSimplePool.hpp" + +namespace Retro +{ + +CElectricDescription* CParticleElectricDataFactory::GetGeneratorDesc(CInputStream &in, CSimplePool *resPool) +{ + return CreateElectricDescription(in, resPool); +} + +CElectricDescription* CParticleElectricDataFactory::CreateElectricDescription(CInputStream &in, CSimplePool *resPool) +{ + return nullptr; +} + +std::unique_ptr FParticleElecrticFactory(const Retro::SObjectTag &tag, Retro::CInputStream &in, const Retro::CVParamTransfer &vparms) +{ + CSimplePool* sp = static_cast(static_cast*>(vparms.GetObj())->GetParam()); + return TToken::GetIObjObjectFor(std::unique_ptr(CParticleElectricDataFactory::GetGeneratorDesc(in, sp))); +} + +} diff --git a/Runtime/Particle/CParticleElectricDataFactory.hpp b/Runtime/Particle/CParticleElectricDataFactory.hpp new file mode 100644 index 000000000..9498a1588 --- /dev/null +++ b/Runtime/Particle/CParticleElectricDataFactory.hpp @@ -0,0 +1,26 @@ +#ifndef __RETRO_CPARTICLEELECTRICDATAFACTORY_HPP__ +#define __RETRO_CPARTICLEELECTRICDATAFACTORY_HPP__ + +#include "RetroTypes.hpp" +#include "IObj.hpp" +#include "CToken.hpp" +#include "IOStreams.hpp" + +namespace Retro +{ +class CElectricDescription; +class CSimplePool; +class CParticleElectricDataFactory +{ +public: + static CElectricDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool); + static CElectricDescription* CreateElectricDescription(CInputStream& in, CSimplePool* resPool); + + static bool CreateELSM(CElectricDescription* desc, CInputStream& in, CSimplePool* resPool) { return false; } + static bool LoadELSMTokens(CElectricDescription* desc); +}; + +std::unique_ptr FParticleElectricDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms); +} + +#endif // __RETRO_CPARTICLEELECTRICDATAFACTORY_HPP__ diff --git a/Runtime/Particle/CParticleSwoosh.hpp b/Runtime/Particle/CParticleSwoosh.hpp index e840ad6b2..b915411a5 100644 --- a/Runtime/Particle/CParticleSwoosh.hpp +++ b/Runtime/Particle/CParticleSwoosh.hpp @@ -1,7 +1,7 @@ #ifndef __RETRO_CPARTICLESWOOSH_HPP__ #define __RETRO_CPARTICLESWOOSH_HPP__ -#include "CParticleGen.hpp" +#include "CElementGen.hpp" namespace Retro { diff --git a/Runtime/Particle/CParticleSwooshDataFactory.cpp b/Runtime/Particle/CParticleSwooshDataFactory.cpp new file mode 100644 index 000000000..25d8484fb --- /dev/null +++ b/Runtime/Particle/CParticleSwooshDataFactory.cpp @@ -0,0 +1,14 @@ +#include "CParticleSwooshDataFactory.hpp" +#include "CSwooshDescription.hpp" + +#include "CSimplePool.hpp" + +namespace Retro +{ + +std::unique_ptr FParticleSwooshDataFactory(const SObjectTag &tag, CInputStream &in, const CVParamTransfer &vparms) +{ + CSimplePool* sp = static_cast(static_cast*>(vparms.GetObj())->GetParam()); + return TToken::GetIObjObjectFor(std::unique_ptr(CParticleSwooshDataFactory::GetGeneratorDesc(in, sp))); +} +} diff --git a/Runtime/Particle/CParticleSwooshDataFactory.hpp b/Runtime/Particle/CParticleSwooshDataFactory.hpp new file mode 100644 index 000000000..e6d11c4ca --- /dev/null +++ b/Runtime/Particle/CParticleSwooshDataFactory.hpp @@ -0,0 +1,24 @@ +#ifndef __RETRO_CPARTICLESWOOSHDATAFACTORY_HPP__ +#define __RETRO_CPARTICLESWOOSHDATAFACTORY_HPP__ + +#include "RetroTypes.hpp" +#include "IObj.hpp" +#include "CToken.hpp" +#include "IOStreams.hpp" + +namespace Retro +{ +class CSwooshDescription; +class CSimplePool; +class CParticleSwooshDataFactory +{ +public: + static CSwooshDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool); + static CSwooshDescription* CreateGeneratorDescription(CInputStream& resPool, CSimplePool* resPool); + static bool CreateWPSM(CSwooshDescription* desc, CInputStream& in, CSimplePool* resPool); +}; + +std::unique_ptr FParticleSwooshDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms); +} + +#endif // __RETRO_CPARTICLESWOOSHDATAFACTORY_HPP__ diff --git a/Runtime/Particle/CSwooshDescription.hpp b/Runtime/Particle/CSwooshDescription.hpp index d1da3ab47..fda0edab4 100644 --- a/Runtime/Particle/CSwooshDescription.hpp +++ b/Runtime/Particle/CSwooshDescription.hpp @@ -1,4 +1,11 @@ #ifndef __RETRO_CSWOOSHDESCRIPTION_HPP__ #define __RETRO_CSWOOSHDESCRIPTION_HPP__ +namespace Retro +{ +namespace CSwooshDescription +{ +} +} + #endif // __RETRO_CSWOOSHDESCRIPTION_HPP__ diff --git a/Runtime/RetroTypes.hpp b/Runtime/RetroTypes.hpp index 8ab0ce6db..e5cc77c55 100644 --- a/Runtime/RetroTypes.hpp +++ b/Runtime/RetroTypes.hpp @@ -67,17 +67,6 @@ using TAreaId = u32; } -template -T GetAverageValue(const T* v, int count) -{ - u32 unk = count * sizeof(T); -} - -template -class TReservedAverage -{ -}; - namespace std { template<>