2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 23:07:42 +00:00

Additional vector elements

This commit is contained in:
Jack Andersen
2016-02-06 21:25:34 -10:00
parent 7ae8d21c55
commit 8dbd2f3819
6 changed files with 107 additions and 46 deletions

View File

@@ -37,25 +37,25 @@ SParticleModel CParticleDataFactory::GetModel(CInputStream& in, CSimplePool* res
FourCC clsId = GetClassID(in);
if (clsId == SBIG('NONE'))
return {};
TResID id = in.readUint32Big();
TResId id = in.readUint32Big();
if (!id)
return {};
return {resPool->GetObj({FOURCC('CMDL'), id}), true};
}
SChildGeneratorDesc CParticleDataFactory::GetChildGeneratorDesc(TResID res, CSimplePool* resPool, const std::vector<TResID>& tracker)
SChildGeneratorDesc CParticleDataFactory::GetChildGeneratorDesc(TResId res, CSimplePool* resPool, const std::vector<TResId>& tracker)
{
if (std::count(tracker.cbegin(), tracker.cend(), res) == 0)
return {resPool->GetObj({FOURCC('PART'), res}), true};
return {};
}
SChildGeneratorDesc CParticleDataFactory::GetChildGeneratorDesc(CInputStream& in, CSimplePool* resPool, const std::vector<TResID>& tracker)
SChildGeneratorDesc CParticleDataFactory::GetChildGeneratorDesc(CInputStream& in, CSimplePool* resPool, const std::vector<TResId>& tracker)
{
FourCC clsId = GetClassID(in);
if (clsId == SBIG('NONE'))
return {};
TResID id = in.readUint32Big();
TResId id = in.readUint32Big();
if (!id)
return {};
return GetChildGeneratorDesc(id, resPool, tracker);
@@ -66,7 +66,7 @@ SSwooshGeneratorDesc CParticleDataFactory::GetSwooshGeneratorDesc(CInputStream&
FourCC clsId = GetClassID(in);
if (clsId == SBIG('NONE'))
return {};
TResID id = in.readUint32Big();
TResId id = in.readUint32Big();
if (!id)
return {};
return {resPool->GetObj({FOURCC('SWHC'), id}), true};
@@ -77,7 +77,7 @@ SElectricGeneratorDesc CParticleDataFactory::GetElectricGeneratorDesc(CInputStre
FourCC clsId = GetClassID(in);
if (clsId == SBIG('NONE'))
return {};
TResID id = in.readUint32Big();
TResId id = in.readUint32Big();
if (!id)
return {};
return {resPool->GetObj({FOURCC('ELSC'), id}), true};
@@ -93,7 +93,7 @@ CUVElement* CParticleDataFactory::GetTextureElement(CInputStream& in, CSimplePoo
FourCC subId = GetClassID(in);
if (subId == SBIG('NONE'))
return nullptr;
TResID id = in.readUint32Big();
TResId id = in.readUint32Big();
TToken<CTexture> txtr = resPool->GetObj({FOURCC('TXTR'), id});
return new CUVEConstant(std::move(txtr));
}
@@ -102,7 +102,7 @@ CUVElement* CParticleDataFactory::GetTextureElement(CInputStream& in, CSimplePoo
FourCC subId = GetClassID(in);
if (subId == SBIG('NONE'))
return nullptr;
TResID id = in.readUint32Big();
TResId id = in.readUint32Big();
CIntElement* a = GetIntElement(in);
CIntElement* b = GetIntElement(in);
CIntElement* c = GetIntElement(in);
@@ -762,13 +762,13 @@ CIntElement* CParticleDataFactory::GetIntElement(CInputStream& in)
CGenDescription* CParticleDataFactory::GetGeneratorDesc(CInputStream& in, CSimplePool* resPool)
{
std::vector<TResID> tracker;
std::vector<TResId> tracker;
tracker.reserve(8);
return CreateGeneratorDescription(in, tracker, 0, resPool);
}
CGenDescription* CParticleDataFactory::CreateGeneratorDescription(CInputStream& in, std::vector<TResID>& tracker,
TResID resId, CSimplePool* resPool)
CGenDescription* CParticleDataFactory::CreateGeneratorDescription(CInputStream& in, std::vector<TResId>& tracker,
TResId resId, CSimplePool* resPool)
{
if (std::count(tracker.cbegin(), tracker.cend(), resId) == 0)
{
@@ -786,7 +786,7 @@ CGenDescription* CParticleDataFactory::CreateGeneratorDescription(CInputStream&
}
bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& in,
std::vector<TResID>& tracker, CSimplePool* resPool)
std::vector<TResId>& tracker, CSimplePool* resPool)
{
FourCC clsId = GetClassID(in);
while (clsId != SBIG('_END'))