2016-02-05 01:27:03 +00:00
|
|
|
#include "CParticleDataFactory.hpp"
|
|
|
|
#include "CToken.hpp"
|
|
|
|
#include "CSimplePool.hpp"
|
|
|
|
#include "CGenDescription.hpp"
|
2016-02-15 08:23:50 +00:00
|
|
|
#include "CRandom16.hpp"
|
2016-03-04 23:04:53 +00:00
|
|
|
#include "Graphics/CModel.hpp"
|
2016-02-17 05:20:34 +00:00
|
|
|
#include "CSwooshDescription.hpp"
|
|
|
|
#include "CElectricDescription.hpp"
|
2016-02-05 01:27:03 +00:00
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
namespace urde
|
2016-02-05 01:27:03 +00:00
|
|
|
{
|
2016-03-04 23:04:53 +00:00
|
|
|
static logvisor::Module Log("urde::CParticleDataFactory");
|
2016-02-05 01:27:03 +00:00
|
|
|
|
|
|
|
float CParticleDataFactory::GetReal(CInputStream& in)
|
|
|
|
{
|
|
|
|
return in.readFloatBig();
|
|
|
|
}
|
|
|
|
|
2017-08-13 05:26:14 +00:00
|
|
|
s32 CParticleDataFactory::GetInt(CInputStream& in)
|
2016-02-05 01:27:03 +00:00
|
|
|
{
|
|
|
|
return in.readInt32Big();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CParticleDataFactory::GetBool(CInputStream& in)
|
|
|
|
{
|
|
|
|
FourCC cid = GetClassID(in);
|
|
|
|
if (cid != FOURCC('CNST'))
|
2016-03-04 23:04:53 +00:00
|
|
|
Log.report(logvisor::Fatal, "bool element does not begin with CNST");
|
2016-02-05 01:27:03 +00:00
|
|
|
return in.readBool();
|
|
|
|
}
|
|
|
|
|
|
|
|
FourCC CParticleDataFactory::GetClassID(CInputStream& in)
|
|
|
|
{
|
|
|
|
uint32_t val;
|
|
|
|
in.readBytesToBuf(&val, 4);
|
|
|
|
return val;
|
|
|
|
}
|
|
|
|
|
2016-02-06 00:34:40 +00:00
|
|
|
SParticleModel CParticleDataFactory::GetModel(CInputStream& in, CSimplePool* resPool)
|
|
|
|
{
|
|
|
|
FourCC clsId = GetClassID(in);
|
|
|
|
if (clsId == SBIG('NONE'))
|
|
|
|
return {};
|
2017-08-13 05:26:14 +00:00
|
|
|
CAssetId id = in.readUint32Big();
|
|
|
|
if (!id.IsValid())
|
2016-02-06 00:34:40 +00:00
|
|
|
return {};
|
2016-10-03 04:39:31 +00:00
|
|
|
return {resPool->GetObj({FOURCC('CMDL'), id}), true};
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
|
2018-05-20 06:14:57 +00:00
|
|
|
SChildGeneratorDesc CParticleDataFactory::GetChildGeneratorDesc(CAssetId res, CSimplePool* resPool,
|
|
|
|
const std::vector<CAssetId>& tracker)
|
2016-02-06 00:34:40 +00:00
|
|
|
{
|
|
|
|
if (std::count(tracker.cbegin(), tracker.cend(), res) == 0)
|
2016-10-03 04:39:31 +00:00
|
|
|
return {resPool->GetObj({FOURCC('PART'), res}), true};
|
2016-02-06 00:34:40 +00:00
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
2018-05-20 06:14:57 +00:00
|
|
|
SChildGeneratorDesc CParticleDataFactory::GetChildGeneratorDesc(CInputStream& in, CSimplePool* resPool,
|
|
|
|
const std::vector<CAssetId>& tracker)
|
2016-02-06 00:34:40 +00:00
|
|
|
{
|
|
|
|
FourCC clsId = GetClassID(in);
|
|
|
|
if (clsId == SBIG('NONE'))
|
|
|
|
return {};
|
2017-08-13 05:26:14 +00:00
|
|
|
CAssetId id = in.readUint32Big();
|
|
|
|
if (!id.IsValid())
|
2016-02-06 00:34:40 +00:00
|
|
|
return {};
|
|
|
|
return GetChildGeneratorDesc(id, resPool, tracker);
|
|
|
|
}
|
|
|
|
|
|
|
|
SSwooshGeneratorDesc CParticleDataFactory::GetSwooshGeneratorDesc(CInputStream& in, CSimplePool* resPool)
|
|
|
|
{
|
|
|
|
FourCC clsId = GetClassID(in);
|
|
|
|
if (clsId == SBIG('NONE'))
|
|
|
|
return {};
|
2017-08-13 05:26:14 +00:00
|
|
|
CAssetId id = in.readUint32Big();
|
|
|
|
if (!id.IsValid())
|
2016-02-06 00:34:40 +00:00
|
|
|
return {};
|
2016-10-03 04:39:31 +00:00
|
|
|
return {resPool->GetObj({FOURCC('SWHC'), id}), true};
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SElectricGeneratorDesc CParticleDataFactory::GetElectricGeneratorDesc(CInputStream& in, CSimplePool* resPool)
|
|
|
|
{
|
|
|
|
FourCC clsId = GetClassID(in);
|
|
|
|
if (clsId == SBIG('NONE'))
|
|
|
|
return {};
|
2017-08-13 05:26:14 +00:00
|
|
|
CAssetId id = in.readUint32Big();
|
|
|
|
if (!id.IsValid())
|
2016-02-06 00:34:40 +00:00
|
|
|
return {};
|
2016-10-03 04:39:31 +00:00
|
|
|
return {resPool->GetObj({FOURCC('ELSC'), id}), true};
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
|
2018-05-20 06:14:57 +00:00
|
|
|
std::unique_ptr<CUVElement> CParticleDataFactory::GetTextureElement(CInputStream& in, CSimplePool* resPool)
|
2016-02-06 00:34:40 +00:00
|
|
|
{
|
|
|
|
FourCC clsId = GetClassID(in);
|
|
|
|
switch (clsId)
|
|
|
|
{
|
|
|
|
case SBIG('CNST'):
|
|
|
|
{
|
|
|
|
FourCC subId = GetClassID(in);
|
|
|
|
if (subId == SBIG('NONE'))
|
|
|
|
return nullptr;
|
2017-08-13 05:26:14 +00:00
|
|
|
CAssetId id = in.readUint32Big();
|
2016-02-06 00:34:40 +00:00
|
|
|
TToken<CTexture> txtr = resPool->GetObj({FOURCC('TXTR'), id});
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CUVEConstant>(std::move(txtr));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('ATEX'):
|
|
|
|
{
|
|
|
|
FourCC subId = GetClassID(in);
|
|
|
|
if (subId == SBIG('NONE'))
|
|
|
|
return nullptr;
|
2017-08-13 05:26:14 +00:00
|
|
|
CAssetId id = in.readUint32Big();
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
auto b = GetIntElement(in);
|
|
|
|
auto c = GetIntElement(in);
|
|
|
|
auto d = GetIntElement(in);
|
|
|
|
auto e = GetIntElement(in);
|
2016-02-06 00:34:40 +00:00
|
|
|
bool f = GetBool(in);
|
|
|
|
TToken<CTexture> txtr = resPool->GetObj({FOURCC('TXTR'), id});
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CUVEAnimTexture>(std::move(txtr), std::move(std::move(a)), std::move(b), std::move(c),
|
|
|
|
std::move(d), std::move(e), std::move(f));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2018-05-20 06:14:57 +00:00
|
|
|
std::unique_ptr<CColorElement> CParticleDataFactory::GetColorElement(CInputStream& in)
|
2016-02-06 00:34:40 +00:00
|
|
|
{
|
|
|
|
FourCC clsId = GetClassID(in);
|
|
|
|
switch (clsId)
|
|
|
|
{
|
|
|
|
case SBIG('KEYE'):
|
|
|
|
case SBIG('KEYP'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CCEKeyframeEmitter>(in);
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('CNST'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
|
|
|
auto d = GetRealElement(in);
|
2016-02-06 00:34:40 +00:00
|
|
|
if (a->IsConstant() && b->IsConstant() && c->IsConstant() && d->IsConstant())
|
|
|
|
{
|
|
|
|
float af, bf, cf, df;
|
|
|
|
a->GetValue(0, af);
|
|
|
|
b->GetValue(0, bf);
|
|
|
|
c->GetValue(0, cf);
|
|
|
|
d->GetValue(0, df);
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CCEFastConstant>(af, bf, cf, df);
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CCEConstant>(std::move(std::move(a)), std::move(b), std::move(c), std::move(d));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
case SBIG('CHAN'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetColorElement(in);
|
|
|
|
auto b = GetColorElement(in);
|
|
|
|
auto c = GetIntElement(in);
|
|
|
|
return std::make_unique<CCETimeChain>(std::move(std::move(a)), std::move(b), std::move(c));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('CFDE'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetColorElement(in);
|
|
|
|
auto b = GetColorElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
|
|
|
auto d = GetRealElement(in);
|
|
|
|
return std::make_unique<CCEFadeEnd>(std::move(std::move(a)), std::move(b), std::move(c), std::move(d));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('FADE'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetColorElement(in);
|
|
|
|
auto b = GetColorElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
|
|
|
return std::make_unique<CCEFade>(std::move(std::move(a)), std::move(b), std::move(c));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('PULS'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
auto b = GetIntElement(in);
|
|
|
|
auto c = GetColorElement(in);
|
|
|
|
auto d = GetColorElement(in);
|
|
|
|
return std::make_unique<CCEPulse>(std::move(std::move(a)), std::move(b), std::move(c), std::move(d));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
2016-02-12 06:06:17 +00:00
|
|
|
case SBIG('PCOL'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CCEParticleColor>();
|
2016-02-12 06:06:17 +00:00
|
|
|
}
|
2016-02-06 00:34:40 +00:00
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2018-05-20 06:14:57 +00:00
|
|
|
std::unique_ptr<CModVectorElement> CParticleDataFactory::GetModVectorElement(CInputStream& in)
|
2016-02-06 00:34:40 +00:00
|
|
|
{
|
|
|
|
FourCC clsId = GetClassID(in);
|
|
|
|
switch (clsId)
|
|
|
|
{
|
|
|
|
case SBIG('IMPL'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
|
|
|
auto d = GetRealElement(in);
|
2016-02-06 00:34:40 +00:00
|
|
|
bool e = GetBool(in);
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CMVEImplosion>(std::move(a), std::move(b), std::move(c), std::move(d), std::move(e));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('EMPL'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
|
|
|
auto d = GetRealElement(in);
|
2016-02-06 00:34:40 +00:00
|
|
|
bool e = GetBool(in);
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CMVEExponentialImplosion>(std::move(a), std::move(b), std::move(c),
|
|
|
|
std::move(d), std::move(e));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('CHAN'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetModVectorElement(in);
|
|
|
|
auto b = GetModVectorElement(in);
|
|
|
|
auto c = GetIntElement(in);
|
|
|
|
return std::make_unique<CMVETimeChain>(std::move(a), std::move(b), std::move(c));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('BNCE'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
auto b = GetVectorElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
|
|
|
auto d = GetRealElement(in);
|
2016-02-06 00:34:40 +00:00
|
|
|
bool e = GetBool(in);
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CMVEBounce>(std::move(a), std::move(b), std::move(c), std::move(d), std::move(e));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('CNST'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
2016-02-06 00:34:40 +00:00
|
|
|
if (a->IsConstant() && b->IsConstant() && c->IsConstant())
|
|
|
|
{
|
|
|
|
float af, bf, cf;
|
|
|
|
a->GetValue(0, af);
|
|
|
|
b->GetValue(0, bf);
|
|
|
|
c->GetValue(0, cf);
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CMVEFastConstant>(af, bf, cf);
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CMVEConstant>(std::move(a), std::move(b), std::move(c));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
case SBIG('GRAV'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
return std::make_unique<CMVEGravity>(std::move(a));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('EXPL'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
return std::make_unique<CMVEExplode>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('SPOS'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
return std::make_unique<CMVESetPosition>(std::move(a));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('LMPL'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
|
|
|
auto d = GetRealElement(in);
|
2016-02-06 00:34:40 +00:00
|
|
|
bool e = GetBool(in);
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CMVELinearImplosion>(std::move(a), std::move(b), std::move(c), std::move(d), std::move(e));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('PULS'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
auto b = GetIntElement(in);
|
|
|
|
auto c = GetModVectorElement(in);
|
|
|
|
auto d = GetModVectorElement(in);
|
|
|
|
return std::make_unique<CMVEPulse>(std::move(a), std::move(b), std::move(c), std::move(d));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('WIND'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
return std::make_unique<CMVEWind>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('SWRL'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
auto b = GetVectorElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
|
|
|
auto d = GetRealElement(in);
|
|
|
|
return std::make_unique<CMVESwirl>(std::move(a), std::move(b), std::move(c), std::move(d));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2018-05-20 06:14:57 +00:00
|
|
|
std::unique_ptr<CEmitterElement> CParticleDataFactory::GetEmitterElement(CInputStream& in)
|
2016-02-06 00:34:40 +00:00
|
|
|
{
|
|
|
|
FourCC clsId = GetClassID(in);
|
|
|
|
switch (clsId)
|
|
|
|
{
|
|
|
|
case SBIG('SETR'):
|
|
|
|
{
|
|
|
|
FourCC prop = GetClassID(in);
|
|
|
|
if (prop == SBIG('ILOC'))
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
2016-02-06 00:34:40 +00:00
|
|
|
prop = GetClassID(in);
|
|
|
|
if (prop == SBIG('IVEC'))
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto b = GetVectorElement(in);
|
|
|
|
return std::make_unique<CEESimpleEmitter>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
case SBIG('SEMR'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
auto b = GetVectorElement(in);
|
|
|
|
return std::make_unique<CEESimpleEmitter>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('SPHE'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
|
|
|
return std::make_unique<CVESphere>(std::move(a), std::move(b), std::move(c));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('ASPH'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
|
|
|
auto d = GetRealElement(in);
|
|
|
|
auto e = GetRealElement(in);
|
|
|
|
auto f = GetRealElement(in);
|
|
|
|
auto g = GetRealElement(in);
|
|
|
|
return std::make_unique<CVEAngleSphere>(std::move(a), std::move(b), std::move(c), std::move(d), std::move(e),
|
|
|
|
std::move(f), std::move(g));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2018-05-20 06:14:57 +00:00
|
|
|
std::unique_ptr<CVectorElement> CParticleDataFactory::GetVectorElement(CInputStream& in)
|
2016-02-06 00:34:40 +00:00
|
|
|
{
|
|
|
|
FourCC clsId = GetClassID(in);
|
|
|
|
switch (clsId)
|
|
|
|
{
|
|
|
|
case SBIG('CONE'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
return std::make_unique<CVECone>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('CHAN'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
auto b = GetVectorElement(in);
|
|
|
|
auto c = GetIntElement(in);
|
|
|
|
return std::make_unique<CVETimeChain>(std::move(a), std::move(b), std::move(c));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('ANGC'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
|
|
|
auto d = GetRealElement(in);
|
|
|
|
auto e = GetRealElement(in);
|
|
|
|
return std::make_unique<CVEAngleCone>(std::move(a), std::move(b), std::move(c), std::move(d), std::move(e));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('ADD_'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
auto b = GetVectorElement(in);
|
|
|
|
return std::make_unique<CVEAdd>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('CCLU'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
auto b = GetVectorElement(in);
|
|
|
|
auto c = GetIntElement(in);
|
|
|
|
auto d = GetRealElement(in);
|
|
|
|
return std::make_unique<CVECircleCluster>(std::move(a), std::move(b), std::move(c), std::move(d));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('CNST'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
2016-02-06 00:34:40 +00:00
|
|
|
if (a->IsConstant() && b->IsConstant() && c->IsConstant())
|
|
|
|
{
|
|
|
|
float af, bf, cf;
|
|
|
|
a->GetValue(0, af);
|
|
|
|
b->GetValue(0, bf);
|
|
|
|
c->GetValue(0, cf);
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CVEFastConstant>(af, bf, cf);
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CVEConstant>(std::move(a), std::move(b), std::move(c));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
case SBIG('CIRC'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
auto b = GetVectorElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
|
|
|
auto d = GetRealElement(in);
|
|
|
|
auto e = GetRealElement(in);
|
|
|
|
return std::make_unique<CVECircle>(std::move(a), std::move(b), std::move(c), std::move(d), std::move(e));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('KEYE'):
|
|
|
|
case SBIG('KEYP'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CVEKeyframeEmitter>(in);
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('MULT'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
auto b = GetVectorElement(in);
|
|
|
|
return std::make_unique<CVEMultiply>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('RTOV'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
return std::make_unique<CVERealToVector>(std::move(a));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('PULS'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
auto b = GetIntElement(in);
|
|
|
|
auto c = GetVectorElement(in);
|
|
|
|
auto d = GetVectorElement(in);
|
|
|
|
return std::make_unique<CVEPulse>(std::move(a), std::move(b), std::move(c), std::move(d));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('PVEL'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CVEParticleVelocity>();
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('PLCO'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CVEParticleColor>();
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('PLOC'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CVEParticleLocation>();
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
2016-02-12 06:06:17 +00:00
|
|
|
case SBIG('PSOF'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CVEParticleSystemOrientationFront>();
|
2016-02-12 06:06:17 +00:00
|
|
|
}
|
|
|
|
case SBIG('PSOU'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CVEParticleSystemOrientationUp>();
|
2016-02-12 06:06:17 +00:00
|
|
|
}
|
2016-02-06 00:34:40 +00:00
|
|
|
case SBIG('PSOR'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CVEParticleSystemOrientationRight>();
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
2016-02-12 06:06:17 +00:00
|
|
|
case SBIG('PSTR'):
|
2016-02-06 00:34:40 +00:00
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CVEParticleSystemTranslation>();
|
2016-02-12 06:06:17 +00:00
|
|
|
}
|
|
|
|
case SBIG('SUB_'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
auto b = GetVectorElement(in);
|
|
|
|
return std::make_unique<CVESubtract>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
2016-02-17 08:07:32 +00:00
|
|
|
case SBIG('CTVC'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetColorElement(in);
|
|
|
|
return std::make_unique<CVEColorToVector>(std::move(a));
|
2016-02-17 08:07:32 +00:00
|
|
|
}
|
2016-02-06 00:34:40 +00:00
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2018-05-20 06:14:57 +00:00
|
|
|
std::unique_ptr<CRealElement> CParticleDataFactory::GetRealElement(CInputStream& in)
|
2016-02-06 00:34:40 +00:00
|
|
|
{
|
|
|
|
FourCC clsId = GetClassID(in);
|
|
|
|
switch (clsId)
|
|
|
|
{
|
|
|
|
case SBIG('LFTW'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
return std::make_unique<CRELifetimeTween>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('CNST'):
|
|
|
|
{
|
|
|
|
float a = GetReal(in);
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CREConstant>(std::move(a));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('CHAN'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
auto c = GetIntElement(in);
|
|
|
|
return std::make_unique<CRETimeChain>(std::move(a), std::move(b), std::move(c));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('ADD_'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
return std::make_unique<CREAdd>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('CLMP'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
|
|
|
return std::make_unique<CREClamp>(std::move(a), std::move(b), std::move(c));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('KEYE'):
|
|
|
|
case SBIG('KEYP'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CREKeyframeEmitter>(in);
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('IRND'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
return std::make_unique<CREInitialRandom>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('RAND'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
return std::make_unique<CRERandom>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
2016-02-12 06:06:17 +00:00
|
|
|
case SBIG('DOTP'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
auto b = GetVectorElement(in);
|
|
|
|
return std::make_unique<CREDotProduct>(std::move(a), std::move(b));
|
2016-02-12 06:06:17 +00:00
|
|
|
}
|
2016-02-06 00:34:40 +00:00
|
|
|
case SBIG('MULT'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
return std::make_unique<CREMultiply>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('PULS'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
auto b = GetIntElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
|
|
|
auto d = GetRealElement(in);
|
|
|
|
return std::make_unique<CREPulse>(std::move(a), std::move(b), std::move(c), std::move(d));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('SCAL'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
return std::make_unique<CRETimeScale>(std::move(a));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('RLPT'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
return std::make_unique<CRELifetimePercent>(std::move(a));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('SINE'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
|
|
|
return std::make_unique<CRESineWave>(std::move(a), std::move(b), std::move(c));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('ISWT'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
return std::make_unique<CREInitialSwitch>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('CLTN'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
|
|
|
auto d = GetRealElement(in);
|
|
|
|
return std::make_unique<CRECompareLessThan>(std::move(a), std::move(b), std::move(c), std::move(d));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('CEQL'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
|
|
|
auto d = GetRealElement(in);
|
|
|
|
return std::make_unique<CRECompareEquals>(std::move(a), std::move(b), std::move(c), std::move(d));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('PAP1'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CREParticleAccessParam1>();
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('PAP2'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CREParticleAccessParam2>();
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('PAP3'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CREParticleAccessParam3>();
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('PAP4'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CREParticleAccessParam4>();
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('PAP5'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CREParticleAccessParam5>();
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('PAP6'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CREParticleAccessParam6>();
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('PAP7'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CREParticleAccessParam7>();
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('PAP8'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CREParticleAccessParam8>();
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('PSLL'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CREParticleSizeOrLineLength>();
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('PRLW'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CREParticleRotationOrLineWidth>();
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('SUB_'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
return std::make_unique<CRESubtract>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('VMAG'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
return std::make_unique<CREVectorMagnitude>(std::move(a));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('VXTR'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
return std::make_unique<CREVectorXToReal>(std::move(a));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('VYTR'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
return std::make_unique<CREVectorYToReal>(std::move(a));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('VZTR'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetVectorElement(in);
|
|
|
|
return std::make_unique<CREVectorZToReal>(std::move(a));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('CEXT'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
return std::make_unique<CRECEXT>(std::move(a));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('ITRL'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
return std::make_unique<CREIntTimesReal>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
2016-02-12 06:06:17 +00:00
|
|
|
case SBIG('CRNG'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
auto b = GetRealElement(in);
|
|
|
|
auto c = GetRealElement(in);
|
|
|
|
auto d = GetRealElement(in);
|
|
|
|
auto e = GetRealElement(in);
|
|
|
|
return std::make_unique<CREConstantRange>(std::move(a), std::move(b), std::move(c), std::move(d), std::move(e));
|
2016-02-12 06:06:17 +00:00
|
|
|
}
|
|
|
|
case SBIG('GTCR'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetColorElement(in);
|
|
|
|
return std::make_unique<CREGetComponentRed>(std::move(a));
|
2016-02-12 06:06:17 +00:00
|
|
|
}
|
|
|
|
case SBIG('GTCG'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetColorElement(in);
|
|
|
|
return std::make_unique<CREGetComponentGreen>(std::move(a));
|
2016-02-12 06:06:17 +00:00
|
|
|
}
|
|
|
|
case SBIG('GTCB'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetColorElement(in);
|
|
|
|
return std::make_unique<CREGetComponentBlue>(std::move(a));
|
2016-02-12 06:06:17 +00:00
|
|
|
}
|
|
|
|
case SBIG('GTCA'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetColorElement(in);
|
|
|
|
return std::make_unique<CREGetComponentAlpha>(std::move(a));
|
2016-02-12 06:06:17 +00:00
|
|
|
}
|
2016-02-06 00:34:40 +00:00
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2018-05-20 06:14:57 +00:00
|
|
|
std::unique_ptr<CIntElement> CParticleDataFactory::GetIntElement(CInputStream& in)
|
2016-02-06 00:34:40 +00:00
|
|
|
{
|
|
|
|
FourCC clsId = GetClassID(in);
|
|
|
|
switch (clsId)
|
|
|
|
{
|
|
|
|
case SBIG('KEYE'):
|
|
|
|
case SBIG('KEYP'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CIEKeyframeEmitter>(in);
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('DETH'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
auto b = GetIntElement(in);
|
|
|
|
return std::make_unique<CIEDeath>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('CLMP'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
auto b = GetIntElement(in);
|
|
|
|
auto c = GetIntElement(in);
|
|
|
|
return std::make_unique<CIEClamp>(std::move(a), std::move(b), std::move(c));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('CHAN'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
auto b = GetIntElement(in);
|
|
|
|
auto c = GetIntElement(in);
|
|
|
|
return std::make_unique<CIETimeChain>(std::move(a), std::move(b), std::move(c));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('ADD_'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
auto b = GetIntElement(in);
|
|
|
|
return std::make_unique<CIEAdd>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('CNST'):
|
|
|
|
{
|
|
|
|
int a = GetInt(in);
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CIEConstant>(std::move(a));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('IMPL'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
return std::make_unique<CIEImpulse>(std::move(a));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('ILPT'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
return std::make_unique<CIELifetimePercent>(std::move(a));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('IRND'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
auto b = GetIntElement(in);
|
|
|
|
return std::make_unique<CIEInitialRandom>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('PULS'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
auto b = GetIntElement(in);
|
|
|
|
auto c = GetIntElement(in);
|
|
|
|
auto d = GetIntElement(in);
|
|
|
|
return std::make_unique<CIEPulse>(std::move(a), std::move(b), std::move(c), std::move(d));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('MULT'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
auto b = GetIntElement(in);
|
|
|
|
return std::make_unique<CIEMultiply>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('SPAH'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
auto b = GetIntElement(in);
|
|
|
|
auto c = GetIntElement(in);
|
|
|
|
return std::make_unique<CIESampleAndHold>(std::move(a), std::move(b), std::move(c));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('RAND'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
auto b = GetIntElement(in);
|
|
|
|
return std::make_unique<CIERandom>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('TSCL'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetRealElement(in);
|
|
|
|
return std::make_unique<CIETimeScale>(std::move(a));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
2016-02-11 20:32:42 +00:00
|
|
|
case SBIG('GAPC'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CIEGetActiveParticleCount>();
|
2016-02-11 20:32:42 +00:00
|
|
|
}
|
2016-02-06 00:34:40 +00:00
|
|
|
case SBIG('GTCP'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CIEGetCumulativeParticleCount>();
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
2016-02-11 20:32:42 +00:00
|
|
|
case SBIG('GEMT'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
return std::make_unique<CIEGetEmitterTime>();
|
2016-02-11 20:32:42 +00:00
|
|
|
}
|
2016-02-06 00:34:40 +00:00
|
|
|
case SBIG('MODU'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
auto b = GetIntElement(in);
|
|
|
|
return std::make_unique<CIEModulo>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
case SBIG('SUB_'):
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
auto a = GetIntElement(in);
|
|
|
|
auto b = GetIntElement(in);
|
|
|
|
return std::make_unique<CIESubtract>(std::move(a), std::move(b));
|
2016-02-06 00:34:40 +00:00
|
|
|
}
|
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2016-02-05 01:27:03 +00:00
|
|
|
CGenDescription* CParticleDataFactory::GetGeneratorDesc(CInputStream& in, CSimplePool* resPool)
|
|
|
|
{
|
2017-08-13 05:26:14 +00:00
|
|
|
std::vector<CAssetId> tracker;
|
2016-02-05 01:27:03 +00:00
|
|
|
tracker.reserve(8);
|
|
|
|
return CreateGeneratorDescription(in, tracker, 0, resPool);
|
|
|
|
}
|
|
|
|
|
2017-08-13 05:26:14 +00:00
|
|
|
CGenDescription* CParticleDataFactory::CreateGeneratorDescription(CInputStream& in, std::vector<CAssetId>& tracker,
|
|
|
|
CAssetId resId, CSimplePool* resPool)
|
2016-02-05 01:27:03 +00:00
|
|
|
{
|
|
|
|
if (std::count(tracker.cbegin(), tracker.cend(), resId) == 0)
|
|
|
|
{
|
|
|
|
tracker.push_back(resId);
|
|
|
|
FourCC cid = GetClassID(in);
|
|
|
|
if (cid == FOURCC('GPSM'))
|
|
|
|
{
|
|
|
|
CGenDescription* ret = new CGenDescription;
|
|
|
|
CreateGPSM(ret, in, tracker, resPool);
|
|
|
|
LoadGPSMTokens(ret);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CParticleDataFactory::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
|
|
|
{
|
2016-02-15 08:23:50 +00:00
|
|
|
CRandom16 rand{99};
|
|
|
|
CGlobalRandom gr(rand);
|
2016-02-05 01:27:03 +00:00
|
|
|
FourCC clsId = GetClassID(in);
|
|
|
|
while (clsId != SBIG('_END'))
|
|
|
|
{
|
|
|
|
switch (clsId)
|
|
|
|
{
|
|
|
|
case SBIG('PMCL'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x78_x64_PMCL = GetColorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('LFOR'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x118_x104_LFOR = GetRealElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('IDTS'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->xa4_x90_IDTS = GetChildGeneratorDesc(in, resPool, tracker);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('EMTR'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x40_x2c_EMTR = GetEmitterElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('COLR'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x30_x24_COLR = GetColorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('CIND'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->x45_30_x32_24_CIND = GetBool(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('AAPH'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->x44_26_x30_26_AAPH = GetBool(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('CSSD'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->xa0_x8c_CSSD = GetIntElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('GRTE'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x2c_x20_GRTE = GetRealElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('FXLL'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->x44_25_x30_25_FXLL = GetBool(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('ICTS'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->x8c_x78_ICTS = GetChildGeneratorDesc(in, resPool, tracker);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('KSSM'):
|
|
|
|
{
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->xd0_xbc_KSSM.reset();
|
2016-02-05 01:27:03 +00:00
|
|
|
FourCC cid = GetClassID(in);
|
|
|
|
if (cid != SBIG('CNST'))
|
|
|
|
break;
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->xd0_xbc_KSSM.reset(new CSpawnSystemKeyframeData(in));
|
|
|
|
fillDesc->xd0_xbc_KSSM->LoadAllSpawnedSystemTokens(resPool);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case SBIG('ILOC'):
|
2018-05-20 06:14:57 +00:00
|
|
|
GetVectorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('IITS'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->xb8_xa4_IITS = GetChildGeneratorDesc(in, resPool, tracker);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('IVEC'):
|
2018-05-20 06:14:57 +00:00
|
|
|
GetVectorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('LDIR'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x110_xfc_LDIR = GetVectorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('LCLR'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x104_xf0_LCLR = GetColorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('LENG'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x20_x14_LENG = GetRealElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('MAXP'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x28_x1c_MAXP = GetIntElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('LOFF'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x10c_xf8_LOFF = GetVectorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('LINT'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x108_xf4_LINT = GetRealElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('LINE'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->x44_24_x30_24_LINE = GetBool(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('LFOT'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x114_x100_LFOT = GetIntElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('LIT_'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->x44_29_x30_29_LIT_ = GetBool(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('LTME'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x34_x28_LTME = GetIntElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('LSLA'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x11c_x108_LSLA = GetRealElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('LTYP'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x100_xec_LTYP = GetIntElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('NDSY'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->xb4_xa0_NDSY = GetIntElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('MBSP'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x48_x34_MBSP = GetIntElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('MBLR'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->x44_30_x31_24_MBLR = GetBool(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('NCSY'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x9c_x88_NCSY = GetIntElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('PISY'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->xc8_xb4_PISY = GetIntElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('OPTS'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->x45_31_x32_25_OPTS = GetBool(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('PMAB'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->x44_31_x31_25_PMAB = GetBool(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('SESD'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->xf8_xe4_SESD = GetIntElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('SEPO'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->xfc_xe8_SEPO = GetVectorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('PSLT'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->xc_x0_PSLT = GetIntElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('PMSC'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x74_x60_PMSC = GetVectorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('PMOP'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x6c_x58_PMOP = GetVectorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('PMDL'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->x5c_x48_PMDL = GetModel(in, resPool);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('PMRT'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x70_x5c_PMRT = GetVectorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('POFS'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x18_xc_POFS = GetVectorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('PMUS'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->x45_24_x31_26_PMUS = GetBool(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('PSIV'):
|
2018-05-20 06:14:57 +00:00
|
|
|
GetVectorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('ROTA'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x50_x3c_ROTA = GetRealElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('PSVM'):
|
2018-05-20 06:14:57 +00:00
|
|
|
GetModVectorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('PSTS'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x14_x8_PSTS = GetRealElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('PSOV'):
|
2018-05-20 06:14:57 +00:00
|
|
|
GetVectorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('PSWT'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x10_x4_PSWT = GetIntElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
2016-02-13 05:16:39 +00:00
|
|
|
case SBIG('SEED'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x1c_x10_SEED = GetIntElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('PMOO'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->x45_25_x31_27_PMOO = GetBool(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('SSSD'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->xe4_xd0_SSSD = GetIntElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('SORT'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->x44_28_x30_28_SORT = GetBool(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('SIZE'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x4c_x38_SIZE = GetRealElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('SISY'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->xcc_xb8_SISY = GetIntElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('SSPO'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->xe8_xd4_SSPO = GetVectorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('TEXR'):
|
2018-05-13 04:09:11 +00:00
|
|
|
{
|
|
|
|
std::unique_ptr<CUVElement> tex(GetTextureElement(in, resPool));
|
|
|
|
if (tex->GetValueTexture(0))
|
|
|
|
fillDesc->x54_x40_TEXR = std::move(tex);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
2018-05-13 04:09:11 +00:00
|
|
|
}
|
2016-02-05 01:27:03 +00:00
|
|
|
case SBIG('SSWH'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->xd4_xc0_SSWH = GetSwooshGeneratorDesc(in, resPool);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('TIND'):
|
2018-05-13 04:09:11 +00:00
|
|
|
{
|
|
|
|
std::unique_ptr<CUVElement> tex(GetTextureElement(in, resPool));
|
|
|
|
if (tex->GetValueTexture(0))
|
|
|
|
fillDesc->x58_x44_TIND = std::move(tex);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
2018-05-13 04:09:11 +00:00
|
|
|
}
|
2016-02-05 01:27:03 +00:00
|
|
|
case SBIG('VMD4'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->x45_29_x31_31_VMD4 = GetBool(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('VMD3'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->x45_28_x31_30_VMD3 = GetBool(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('VMD2'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->x45_27_x31_29_VMD2 = GetBool(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('VMD1'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->x45_26_x31_28_VMD1 = GetBool(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('VEL4'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x88_x74_VEL4 = GetModVectorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('VEL3'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x84_x70_VEL3 = GetModVectorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('VEL2'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x80_x6c_VEL2 = GetModVectorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('VEL1'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x7c_x68_VEL1 = GetModVectorElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('ZBUF'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->x44_27_x30_27_ZBUF = GetBool(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('WIDT'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x24_x18_WIDT = GetRealElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('ORNT'):
|
|
|
|
fillDesc->x30_30_ORNT = GetBool(in);
|
|
|
|
break;
|
|
|
|
case SBIG('RSOP'):
|
|
|
|
fillDesc->x30_31_RSOP = GetBool(in);
|
|
|
|
break;
|
|
|
|
case SBIG('ADV1'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x10c_ADV1 = GetRealElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('ADV2'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x110_ADV2 = GetRealElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('ADV3'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x114_ADV3 = GetRealElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('ADV4'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x118_ADV4 = GetRealElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('ADV5'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x11c_ADV5 = GetRealElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('ADV6'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x120_ADV6 = GetRealElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('ADV7'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x124_ADV7 = GetRealElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('ADV8'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->x128_ADV8 = GetRealElement(in);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
case SBIG('SELC'):
|
2016-03-03 01:06:42 +00:00
|
|
|
fillDesc->xec_xd8_SELC = GetElectricGeneratorDesc(in, resPool);
|
2016-02-05 01:27:03 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
uint32_t clsName = clsId.toUint32();
|
2016-03-04 23:04:53 +00:00
|
|
|
Log.report(logvisor::Fatal, "Unknown GPSM class %.4s @%" PRIi64, &clsName, in.position());
|
2016-02-05 01:27:03 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
clsId = GetClassID(in);
|
|
|
|
}
|
2016-02-15 19:12:55 +00:00
|
|
|
|
|
|
|
/* Now for our custom additions, if available */
|
2016-04-02 08:42:00 +00:00
|
|
|
if (!in.atEnd() && (in.position() + 4) < in.length())
|
2016-02-15 19:12:55 +00:00
|
|
|
{
|
|
|
|
clsId = GetClassID(in);
|
|
|
|
if (clsId == 0xFFFFFFFF)
|
|
|
|
return true;
|
|
|
|
|
|
|
|
while (clsId != SBIG('_END') && !in.atEnd())
|
|
|
|
{
|
2018-05-20 06:14:57 +00:00
|
|
|
switch (clsId)
|
2016-02-15 19:12:55 +00:00
|
|
|
{
|
|
|
|
case SBIG('BGCL'):
|
2018-05-20 06:14:57 +00:00
|
|
|
fillDesc->m_bevelGradient = GetColorElement(in);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2016-02-15 19:12:55 +00:00
|
|
|
}
|
|
|
|
clsId = GetClassID(in);
|
|
|
|
}
|
|
|
|
}
|
2016-02-05 01:27:03 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CParticleDataFactory::LoadGPSMTokens(CGenDescription* desc)
|
|
|
|
{
|
2016-03-03 01:06:42 +00:00
|
|
|
if (desc->x5c_x48_PMDL.m_found)
|
|
|
|
desc->x5c_x48_PMDL.m_model = desc->x5c_x48_PMDL.m_token.GetObj();
|
2016-02-15 02:31:46 +00:00
|
|
|
|
2016-03-03 01:06:42 +00:00
|
|
|
if (desc->x8c_x78_ICTS.m_found)
|
|
|
|
desc->x8c_x78_ICTS.m_gen = desc->x8c_x78_ICTS.m_token.GetObj();
|
2016-02-15 02:31:46 +00:00
|
|
|
|
2016-03-03 01:06:42 +00:00
|
|
|
if (desc->xa4_x90_IDTS.m_found)
|
|
|
|
desc->xa4_x90_IDTS.m_gen = desc->xa4_x90_IDTS.m_token.GetObj();
|
2016-02-15 02:31:46 +00:00
|
|
|
|
2016-03-03 01:06:42 +00:00
|
|
|
if (desc->xb8_xa4_IITS.m_found)
|
|
|
|
desc->xb8_xa4_IITS.m_gen = desc->xb8_xa4_IITS.m_token.GetObj();
|
2016-02-15 02:31:46 +00:00
|
|
|
|
2016-03-03 01:06:42 +00:00
|
|
|
if (desc->xd4_xc0_SSWH.m_found)
|
|
|
|
desc->xd4_xc0_SSWH.m_swoosh = desc->xd4_xc0_SSWH.m_token.GetObj();
|
2016-02-05 01:27:03 +00:00
|
|
|
}
|
|
|
|
|
2016-03-31 00:38:03 +00:00
|
|
|
CFactoryFnReturn FParticleFactory(const SObjectTag& tag, CInputStream& in,
|
2016-09-02 19:32:57 +00:00
|
|
|
const CVParamTransfer& vparms,
|
|
|
|
CObjectReference* selfRef)
|
2016-02-05 01:27:03 +00:00
|
|
|
{
|
2016-12-23 06:41:39 +00:00
|
|
|
CSimplePool* sp = vparms.GetOwnedObj<CSimplePool*>();
|
2018-05-20 06:14:57 +00:00
|
|
|
return TToken<CGenDescription>::GetIObjObjectFor(
|
|
|
|
std::unique_ptr<CGenDescription>(CParticleDataFactory::GetGeneratorDesc(in, sp)));
|
2016-02-05 01:27:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|