2016-04-13 06:07:23 +00:00
|
|
|
#ifndef __URDE_CPARTICLEDATAFACTORY_HPP__
|
|
|
|
#define __URDE_CPARTICLEDATAFACTORY_HPP__
|
2016-02-05 01:27:03 +00:00
|
|
|
|
|
|
|
#include "RetroTypes.hpp"
|
2016-03-31 00:38:03 +00:00
|
|
|
#include "CFactoryMgr.hpp"
|
2016-02-05 01:27:03 +00:00
|
|
|
#include "IObj.hpp"
|
|
|
|
#include "CToken.hpp"
|
|
|
|
#include "IOStreams.hpp"
|
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
namespace urde
|
2016-02-05 01:27:03 +00:00
|
|
|
{
|
|
|
|
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-15 02:31:46 +00:00
|
|
|
TLockedToken<CModel> m_token;
|
2016-02-06 00:34:40 +00:00
|
|
|
bool m_found = false;
|
2016-02-15 02:31:46 +00:00
|
|
|
CModel* m_model = nullptr;
|
2016-02-17 03:42:27 +00:00
|
|
|
SParticleModel() = default;
|
|
|
|
SParticleModel(CToken&& tok, bool found)
|
|
|
|
: m_token(std::move(tok)), m_found(found) {}
|
2017-01-22 17:36:25 +00:00
|
|
|
operator bool() const { return m_found; }
|
2016-02-05 01:27:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct SChildGeneratorDesc
|
|
|
|
{
|
2016-02-15 02:31:46 +00:00
|
|
|
TLockedToken<CGenDescription> m_token;
|
2016-02-06 00:34:40 +00:00
|
|
|
bool m_found = false;
|
2016-02-15 02:31:46 +00:00
|
|
|
CGenDescription* m_gen = nullptr;
|
2016-02-17 03:42:27 +00:00
|
|
|
SChildGeneratorDesc() = default;
|
|
|
|
SChildGeneratorDesc(CToken&& tok, bool found)
|
|
|
|
: m_token(std::move(tok)), m_found(found) {}
|
2017-01-22 17:36:25 +00:00
|
|
|
operator bool() const { return m_found; }
|
2016-02-05 01:27:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct SSwooshGeneratorDesc
|
|
|
|
{
|
2016-02-15 02:31:46 +00:00
|
|
|
TLockedToken<CSwooshDescription> m_token;
|
2016-02-06 00:34:40 +00:00
|
|
|
bool m_found = false;
|
2016-02-15 02:31:46 +00:00
|
|
|
CSwooshDescription* m_swoosh = nullptr;
|
2016-02-17 03:42:27 +00:00
|
|
|
SSwooshGeneratorDesc() = default;
|
|
|
|
SSwooshGeneratorDesc(CToken&& tok, bool found)
|
|
|
|
: m_token(std::move(tok)), m_found(found) {}
|
2017-01-22 17:36:25 +00:00
|
|
|
operator bool() const { return m_found; }
|
2016-02-05 01:27:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct SElectricGeneratorDesc
|
|
|
|
{
|
2016-02-15 02:31:46 +00:00
|
|
|
TLockedToken<CElectricDescription> m_token;
|
2016-02-06 00:34:40 +00:00
|
|
|
bool m_found = false;
|
2016-02-15 02:31:46 +00:00
|
|
|
CElectricDescription* m_electric = nullptr;
|
2016-02-17 03:42:27 +00:00
|
|
|
SElectricGeneratorDesc() = default;
|
|
|
|
SElectricGeneratorDesc(CToken&& tok, bool found)
|
|
|
|
: m_token(std::move(tok)), m_found(found) {}
|
2017-01-22 17:36:25 +00:00
|
|
|
operator bool() const { return m_found; }
|
2016-02-05 01:27:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CParticleDataFactory
|
|
|
|
{
|
2016-02-10 22:54:47 +00:00
|
|
|
friend class CDecalDataFactory;
|
2016-02-16 07:01:55 +00:00
|
|
|
friend class CCollisionResponseData;
|
2016-02-10 22:54:47 +00:00
|
|
|
friend class CParticleElectricDataFactory;
|
|
|
|
friend class CParticleSwooshDataFactory;
|
2016-02-13 19:05:59 +00:00
|
|
|
friend class CProjectileWeaponDataFactory;
|
2016-02-10 22:54:47 +00:00
|
|
|
|
2016-02-05 01:27:03 +00:00
|
|
|
static SParticleModel GetModel(CInputStream& in, CSimplePool* resPool);
|
2017-08-13 05:26:14 +00:00
|
|
|
static SChildGeneratorDesc GetChildGeneratorDesc(CAssetId res, CSimplePool* resPool, const std::vector<CAssetId>& tracker);
|
|
|
|
static SChildGeneratorDesc GetChildGeneratorDesc(CInputStream& in, CSimplePool* resPool, const std::vector<CAssetId>& tracker);
|
2016-02-05 01:27:03 +00:00
|
|
|
static SSwooshGeneratorDesc GetSwooshGeneratorDesc(CInputStream& in, CSimplePool* resPool);
|
|
|
|
static SElectricGeneratorDesc GetElectricGeneratorDesc(CInputStream& in, CSimplePool* resPool);
|
2018-05-20 06:14:57 +00:00
|
|
|
static std::unique_ptr<CUVElement> GetTextureElement(CInputStream& in, CSimplePool* resPool);
|
|
|
|
static std::unique_ptr<CColorElement> GetColorElement(CInputStream& in);
|
|
|
|
static std::unique_ptr<CModVectorElement> GetModVectorElement(CInputStream& in);
|
|
|
|
static std::unique_ptr<CEmitterElement> GetEmitterElement(CInputStream& in);
|
|
|
|
static std::unique_ptr<CVectorElement> GetVectorElement(CInputStream& in);
|
|
|
|
static std::unique_ptr<CRealElement> GetRealElement(CInputStream& in);
|
|
|
|
static std::unique_ptr<CIntElement> GetIntElement(CInputStream& in);
|
2016-02-05 01:27:03 +00:00
|
|
|
|
|
|
|
static float GetReal(CInputStream& in);
|
2017-08-13 05:26:14 +00:00
|
|
|
static s32 GetInt(CInputStream& in);
|
2016-02-05 01:27:03 +00:00
|
|
|
static bool GetBool(CInputStream& in);
|
|
|
|
static FourCC GetClassID(CInputStream& in);
|
2017-08-13 05:26:14 +00:00
|
|
|
static CGenDescription* CreateGeneratorDescription(CInputStream& in, std::vector<CAssetId>& tracker,
|
|
|
|
CAssetId resId, CSimplePool* resPool);
|
2016-02-05 01:27:03 +00:00
|
|
|
static bool CreateGPSM(CGenDescription* fillDesc, CInputStream& in,
|
2017-08-13 05:26:14 +00:00
|
|
|
std::vector<CAssetId>& tracker, CSimplePool* resPool);
|
2016-02-05 01:27:03 +00:00
|
|
|
static void LoadGPSMTokens(CGenDescription* desc);
|
2016-02-15 02:31:46 +00:00
|
|
|
public:
|
|
|
|
static CGenDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool);
|
2016-02-05 01:27:03 +00:00
|
|
|
};
|
|
|
|
|
2016-09-02 19:32:57 +00:00
|
|
|
CFactoryFnReturn FParticleFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,
|
|
|
|
CObjectReference* selfRef);
|
2016-02-05 01:27:03 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-04-13 06:07:23 +00:00
|
|
|
#endif // __URDE_CPARTICLEDATAFACTORY_HPP__
|