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

Add proper CRandom16 vars to factories

This commit is contained in:
2016-02-15 00:23:50 -08:00
parent 0260ebcd64
commit 1c5a86dcbf
6 changed files with 21 additions and 5 deletions

View File

@@ -31,11 +31,12 @@ CElectricDescription* CParticleElectricDataFactory::CreateElectricDescription(CI
bool CParticleElectricDataFactory::CreateELSM(CElectricDescription *desc, CInputStream &in, CSimplePool *resPool)
{
CRandom16 rand;
CRandom16 rand{99};
CGlobalRandom gr{rand};
FourCC clsId = CPF::GetClassID(in);
while (clsId != SBIG('_END'))
{
CGlobalRandom gr(rand);
switch(clsId)
{
case SBIG('LIFE'):
@@ -118,6 +119,16 @@ bool CParticleElectricDataFactory::CreateELSM(CElectricDescription *desc, CInput
return true;
}
void CParticleElectricDataFactory::LoadELSMTokens(CElectricDescription* desc)
{
if (desc->x40_SSWH.m_found)
desc->x40_SSWH.m_swoosh = desc->x40_SSWH.m_token.GetObj();
if (desc->x50_GPSM.m_found)
desc->x50_GPSM.m_gen = desc->x50_GPSM.m_token.GetObj();
if (desc->x60_EPSM.m_found)
desc->x60_EPSM.m_gen = desc->x60_EPSM.m_token.GetObj();
}
std::unique_ptr<pshag::IObj> FParticleElecrticFactory(const pshag::SObjectTag &tag, pshag::CInputStream &in, const pshag::CVParamTransfer &vparms)
{
CSimplePool* sp = static_cast<CSimplePool*>(static_cast<TObjOwnerParam<IObjectStore*>*>(vparms.GetObj())->GetParam());