metaforce/Runtime/Particle/CParticleDataFactory.hpp

87 lines
2.8 KiB
C++
Raw Normal View History

2016-02-13 09:02:47 +00:00
#ifndef __PSHAG_CPARTICLEDATAFACTORY_HPP__
#define __PSHAG_CPARTICLEDATAFACTORY_HPP__
#include "RetroTypes.hpp"
#include "IObj.hpp"
#include "CToken.hpp"
#include "IOStreams.hpp"
2016-02-13 09:02:47 +00:00
namespace pshag
{
class CGenDescription;
class CSwooshDescription;
class CElectricDescription;
class CSimplePool;
class CVParamTransfer;
class CModel;
class CUVElement;
class CColorElement;
class CModVectorElement;
class CEmitterElement;
class CVectorElement;
class CRealElement;
class CIntElement;
struct SParticleModel
{
2016-02-09 22:52:33 +00:00
TLockedToken<CModel> m_model;
bool m_found = false;
};
struct SChildGeneratorDesc
{
2016-02-09 22:52:33 +00:00
TLockedToken<CGenDescription> m_gen;
bool m_found = false;
};
struct SSwooshGeneratorDesc
{
2016-02-09 22:52:33 +00:00
TLockedToken<CSwooshDescription> m_swoosh;
bool m_found = false;
};
struct SElectricGeneratorDesc
{
2016-02-09 22:52:33 +00:00
TLockedToken<CElectricDescription> m_electric;
bool m_found = false;
};
class CParticleDataFactory
{
2016-02-10 22:54:47 +00:00
friend class CDecalDataFactory;
friend class CParticleElectricDataFactory;
friend class CParticleSwooshDataFactory;
friend class CProjectileWeaponDataFactory;
2016-02-10 22:54:47 +00:00
static SParticleModel GetModel(CInputStream& in, CSimplePool* resPool);
2016-02-07 07:25:34 +00:00
static SChildGeneratorDesc GetChildGeneratorDesc(TResId res, CSimplePool* resPool, const std::vector<TResId>& tracker);
static SChildGeneratorDesc GetChildGeneratorDesc(CInputStream& in, CSimplePool* resPool, const std::vector<TResId>& tracker);
static SSwooshGeneratorDesc GetSwooshGeneratorDesc(CInputStream& in, CSimplePool* resPool);
static SElectricGeneratorDesc GetElectricGeneratorDesc(CInputStream& in, CSimplePool* resPool);
static CUVElement* GetTextureElement(CInputStream& in, CSimplePool* resPool);
static CColorElement* GetColorElement(CInputStream& in);
static CModVectorElement* GetModVectorElement(CInputStream& in);
static CEmitterElement* GetEmitterElement(CInputStream& in);
static CVectorElement* GetVectorElement(CInputStream& in);
static CRealElement* GetRealElement(CInputStream& in);
static CIntElement* GetIntElement(CInputStream& in);
static float GetReal(CInputStream& in);
static int32_t GetInt(CInputStream& in);
static bool GetBool(CInputStream& in);
static FourCC GetClassID(CInputStream& in);
public:
static CGenDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool);
2016-02-07 07:25:34 +00:00
static CGenDescription* CreateGeneratorDescription(CInputStream& in, std::vector<TResId>& tracker,
TResId resId, CSimplePool* resPool);
static bool CreateGPSM(CGenDescription* fillDesc, CInputStream& in,
2016-02-07 07:25:34 +00:00
std::vector<TResId>& tracker, CSimplePool* resPool);
static void LoadGPSMTokens(CGenDescription* desc);
};
std::unique_ptr<IObj> FParticleFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms);
}
2016-02-13 09:02:47 +00:00
#endif // __PSHAG_CPARTICLEDATAFACTORY_HPP__