From 3be5b38f82aa7d8566888951a9297e100c140533 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Thu, 10 Jun 2021 19:57:05 -0700 Subject: [PATCH] Particle fixes --- .../Graphics/Shaders/CElementGenShaders.cpp | 22 +- Runtime/Particle/CElementGen.cpp | 218 +++++++++--------- Runtime/Particle/CElementGen.hpp | 2 +- Runtime/Particle/CGenDescription.hpp | 145 ++++++------ Runtime/Particle/CParticleDataFactory.cpp | 154 ++++++------- Runtime/Weapon/CNewFlameThrower.cpp | 8 +- 6 files changed, 271 insertions(+), 278 deletions(-) diff --git a/Runtime/Graphics/Shaders/CElementGenShaders.cpp b/Runtime/Graphics/Shaders/CElementGenShaders.cpp index 6d21076a6..7ad7e107a 100644 --- a/Runtime/Graphics/Shaders/CElementGenShaders.cpp +++ b/Runtime/Graphics/Shaders/CElementGenShaders.cpp @@ -119,8 +119,8 @@ void CElementGenShaders::Shutdown() { CElementGenShaders::EShaderClass CElementGenShaders::GetShaderClass(CElementGen& gen) { CGenDescription* desc = gen.x1c_genDesc.GetObj(); - if (desc->x54_x40_TEXR) { - if (desc->x58_x44_TIND) + if (desc->x40_TEXR) { + if (desc->x44_TIND) return EShaderClass::IndTex; else return EShaderClass::Tex; @@ -137,9 +137,9 @@ void CElementGenShaders::BuildShaderDataBinding(boo::IGraphicsDataFactory::Conte std::array, 2>* regPipelinePmus = nullptr; std::array, 2>* redToAlphaPipelinePmus = nullptr; - if (desc->x54_x40_TEXR) { - if (desc->x58_x44_TIND) { - if (desc->x45_30_x32_24_CIND) { + if (desc->x40_TEXR) { + if (desc->x44_TIND) { + if (desc->x32_24_CIND) { if (gen.x26c_26_AAPH) regPipeline = &m_cindTexAdditive; else { @@ -209,23 +209,23 @@ void CElementGenShaders::BuildShaderDataBinding(boo::IGraphicsDataFactory::Conte } } - if (desc->x45_24_x31_26_PMUS) { - if (desc->x54_x40_TEXR) { + if (desc->x31_26_PMUS) { + if (desc->x40_TEXR) { redToAlphaPipelinePmus = &m_texRedToAlphaZTest; - if (desc->x44_31_x31_25_PMAB) + if (desc->x31_25_PMAB) regPipelinePmus = &m_texAdditiveZTest; else regPipelinePmus = &m_texZTestZWrite; } else { - if (desc->x44_31_x31_25_PMAB) + if (desc->x31_25_PMAB) regPipelinePmus = &m_noTexAdditiveZTest; else regPipelinePmus = &m_noTexZTestZWrite; } } - const CUVElement* const texr = desc->x54_x40_TEXR.get(); - const CUVElement* const tind = desc->x58_x44_TIND.get(); + const CUVElement* const texr = desc->x40_TEXR.get(); + const CUVElement* const tind = desc->x44_TIND.get(); int texCount = 0; std::array, 3> textures; diff --git a/Runtime/Particle/CElementGen.cpp b/Runtime/Particle/CElementGen.cpp index 262b16dd3..366bb41b5 100644 --- a/Runtime/Particle/CElementGen.cpp +++ b/Runtime/Particle/CElementGen.cpp @@ -61,95 +61,95 @@ CElementGen::CElementGen(TToken gen, EModelOrientationType orie CGenDescription* desc = x1c_genDesc.GetObj(); x28_loadedGenDesc = desc; - if (desc->x54_x40_TEXR) - desc->x54_x40_TEXR->GetValueTexture(0).GetObj(); - if (desc->x58_x44_TIND) - desc->x58_x44_TIND->GetValueTexture(0).GetObj(); + if (desc->x40_TEXR) + desc->x40_TEXR->GetValueTexture(0).GetObj(); + if (desc->x44_TIND) + desc->x44_TIND->GetValueTexture(0).GetObj(); CGlobalRandom globRnd(x27c_randState); - if (CIntElement* seedElem = desc->x1c_x10_SEED.get()) { + if (CIntElement* seedElem = desc->x10_SEED.get()) { int seedVal; seedElem->GetValue(x74_curFrame, seedVal); x94_randomSeed = seedVal; } x27c_randState.SetSeed(x94_randomSeed); ++g_ParticleSystemAliveCount; - x26c_25_LIT_ = desc->x44_29_x30_29_LIT_; - x26c_26_AAPH = desc->x44_26_x30_26_AAPH; - x26c_27_ZBUF = desc->x44_27_x30_27_ZBUF; + x26c_25_LIT_ = desc->x30_29_LIT_; + x26c_26_AAPH = desc->x30_26_AAPH; + x26c_27_ZBUF = desc->x30_27_ZBUF; x26c_28_zTest = true; x26c_29_ORNT = desc->x30_30_ORNT; - x26c_30_MBLR = x26c_29_ORNT ? false : desc->x44_30_x31_24_MBLR; + x26c_30_MBLR = x26c_29_ORNT ? false : desc->x31_24_MBLR; - if (CIntElement* mbspElem = desc->x48_x34_MBSP.get()) + if (CIntElement* mbspElem = desc->x34_MBSP.get()) mbspElem->GetValue(x74_curFrame, x270_MBSP); - if (CModVectorElement* elem = desc->x7c_x68_VEL1.get()) { + if (CModVectorElement* elem = desc->x68_VEL1.get()) { x280_VELSources[0] = elem; - x278_hasVMD[0] = desc->x45_26_x31_28_VMD1; + x278_hasVMD[0] = desc->x31_28_VMD1; } - if (CModVectorElement* elem = desc->x80_x6c_VEL2.get()) { + if (CModVectorElement* elem = desc->x6c_VEL2.get()) { x280_VELSources[1] = elem; - x278_hasVMD[1] = desc->x45_27_x31_29_VMD2; + x278_hasVMD[1] = desc->x31_29_VMD2; } - if (CModVectorElement* elem = desc->x84_x70_VEL3.get()) { + if (CModVectorElement* elem = desc->x70_VEL3.get()) { x280_VELSources[2] = elem; - x278_hasVMD[2] = desc->x45_28_x31_30_VMD3; + x278_hasVMD[2] = desc->x31_30_VMD3; } - if (CModVectorElement* elem = desc->x88_x74_VEL4.get()) { + if (CModVectorElement* elem = desc->x74_VEL4.get()) { x280_VELSources[3] = elem; - x278_hasVMD[3] = desc->x45_29_x31_31_VMD4; + x278_hasVMD[3] = desc->x31_31_VMD4; } if (desc->x10c_ADV1 || desc->x110_ADV2 || desc->x114_ADV3 || desc->x118_ADV4 || desc->x11c_ADV5 || desc->x120_ADV6 || desc->x124_ADV7 || desc->x128_ADV8) x26d_28_enableADV = true; - if (CIntElement* cssdElem = desc->xa0_x8c_CSSD.get()) + if (CIntElement* cssdElem = desc->x8c_CSSD.get()) cssdElem->GetValue(0, x2a0_CSSD); - if (CIntElement* pisyElem = desc->xc8_xb4_PISY.get()) { + if (CIntElement* pisyElem = desc->xb4_PISY.get()) { pisyElem->GetValue(0, x2a8_PISY); if (x2a8_PISY <= 0) x2a8_PISY = 1; } - if (CIntElement* sisyElem = desc->xcc_xb8_SISY.get()) + if (CIntElement* sisyElem = desc->xb8_SISY.get()) sisyElem->GetValue(0, x2a4_SISY); - if (CIntElement* sssdElem = desc->xe4_xd0_SSSD.get()) + if (CIntElement* sssdElem = desc->xd0_SSSD.get()) sssdElem->GetValue(0, x2ac_SSSD); - if (CVectorElement* sspoElem = desc->xe8_xd4_SSPO.get()) { + if (CVectorElement* sspoElem = desc->xd4_SSPO.get()) { sspoElem->GetValue(0, x2b0_SSPO); if (!sspoElem->IsFastConstant()) x26c_24_translationDirty = true; } - if (CIntElement* sesdElem = desc->xf8_xe4_SESD.get()) + if (CIntElement* sesdElem = desc->xe4_SESD.get()) sesdElem->GetValue(0, x2bc_SESD); - if (CVectorElement* sepoElem = desc->xfc_xe8_SEPO.get()) { + if (CVectorElement* sepoElem = desc->xe8_SEPO.get()) { sepoElem->GetValue(0, x2c0_SEPO); if (!sepoElem->IsFastConstant()) x26c_24_translationDirty = true; } - if (CVectorElement* pofsElem = desc->x18_xc_POFS.get()) { + if (CVectorElement* pofsElem = desc->xc_POFS.get()) { pofsElem->GetValue(x74_curFrame, xf4_POFS); if (!pofsElem->IsFastConstant()) x26c_24_translationDirty = true; } - if (CIntElement* psltElem = desc->xc_x0_PSLT.get()) + if (CIntElement* psltElem = desc->x0_PSLT.get()) psltElem->GetValue(0, x268_PSLT); else x268_PSLT = INT_MAX; - if (CIntElement* maxpElem = desc->x28_x1c_MAXP.get()) { + if (CIntElement* maxpElem = desc->x1c_MAXP.get()) { maxpElem->GetValue(x74_curFrame, x90_MAXP); } @@ -161,10 +161,10 @@ CElementGen::CElementGen(TToken gen, EModelOrientationType orie if (x2c_orientType == EModelOrientationType::One) x50_parentMatrices.resize(x90_MAXP); - x26c_31_LINE = desc->x44_24_x30_24_LINE; - x26d_24_FXLL = desc->x44_25_x30_25_FXLL; + x26c_31_LINE = desc->x30_24_LINE; + x26d_24_FXLL = desc->x30_25_FXLL; - if (CIntElement* ltypElem = desc->x100_xec_LTYP.get()) { + if (CIntElement* ltypElem = desc->xec_LTYP.get()) { int ltyp; ltypElem->GetValue(x74_curFrame, ltyp); switch (LightType(ltyp)) { @@ -184,7 +184,7 @@ CElementGen::CElementGen(TToken gen, EModelOrientationType orie } } - if (CIntElement* lfotElem = desc->x114_x100_LFOT.get()) { + if (CIntElement* lfotElem = desc->x100_LFOT.get()) { int lfot; lfotElem->GetValue(x74_curFrame, lfot); switch (EFalloffType(lfot)) { @@ -202,7 +202,7 @@ CElementGen::CElementGen(TToken gen, EModelOrientationType orie } if (x26c_31_LINE) { - CUVElement* texr = desc->x54_x40_TEXR.get(); + CUVElement* texr = desc->x40_TEXR.get(); boo::ObjToken tex; if (texr) tex = texr->GetValueTexture(0).GetObj()->GetBooTexture(); @@ -232,7 +232,7 @@ bool CElementGen::Update(double t) { CParticleGlobals::SParticleSystem thisSystem{FOURCC('PART'), this}; CParticleGlobals::instance()->m_currentParticleSystem = &thisSystem; CGenDescription* desc = x1c_genDesc.GetObj(); - CIntElement* pswtElem = desc->x10_x4_PSWT.get(); + CIntElement* pswtElem = desc->x4_PSWT.get(); if (pswtElem && !x26d_25_warmedUp) { int pswt = 0; pswtElem->GetValue(x74_curFrame, pswt); @@ -244,13 +244,13 @@ bool CElementGen::Update(double t) { CParticleGlobals::instance()->m_currentParticleSystem = prevSystem; if (oldMax < x90_MAXP || oldMBSP < x270_MBSP) { - //_RecreatePipelines(); + _RecreatePipelines(); } return ret; } void CElementGen::_RecreatePipelines() { - size_t maxInsts = x26c_30_MBLR ? 2560 * 2 : 2560; // x26c_30_MBLR ? (x270_MBSP * x90_MAXP) : x90_MAXP; + size_t maxInsts = x26c_30_MBLR ? (x270_MBSP * x90_MAXP) : x90_MAXP; maxInsts = (maxInsts == 0 ? 256 : maxInsts); CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) { @@ -258,7 +258,7 @@ void CElementGen::_RecreatePipelines() { m_instBuf = ctx.newDynamicBuffer(boo::BufferUse::Vertex, ShadClsSizes[size_t(m_shaderClass)], maxInsts); m_uniformBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(SParticleUniforms), 1); } - if (x28_loadedGenDesc->x45_24_x31_26_PMUS) { + if (x28_loadedGenDesc->x31_26_PMUS) { m_instBufPmus = ctx.newDynamicBuffer(boo::BufferUse::Vertex, ShadClsSizes[size_t(m_shaderClass)], maxInsts); m_uniformBufPmus = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(SParticleUniforms), 1); } @@ -276,7 +276,7 @@ bool CElementGen::InternalUpdate(double dt) { double t = x74_curFrame / 60.0; CParticleGlobals::instance()->SetEmitterTime(x74_curFrame); - if (CRealElement* pstsElem = desc->x14_x8_PSTS.get()) { + if (CRealElement* pstsElem = desc->x8_PSTS.get()) { float psts; pstsElem->GetValue(x74_curFrame, psts); double dt1Scaled = psts * dt1; @@ -286,7 +286,7 @@ bool CElementGen::InternalUpdate(double dt) { x78_curSeconds += dt1; if (x26c_30_MBLR && dt > 0.0) { - if (CIntElement* mbspElem = desc->x48_x34_MBSP.get()) + if (CIntElement* mbspElem = desc->x34_MBSP.get()) mbspElem->GetValue(x74_curFrame, x270_MBSP); } @@ -301,7 +301,7 @@ bool CElementGen::InternalUpdate(double dt) { if (x74_curFrame < x268_PSLT && x88_particleEmission) { float grte = 0.f; - if (CRealElement* grteElem = desc->x2c_x20_GRTE.get()) { + if (CRealElement* grteElem = desc->x20_GRTE.get()) { if (grteElem->GetValue(x74_curFrame, grte)) { x30_particles.clear(); return true; @@ -313,7 +313,7 @@ bool CElementGen::InternalUpdate(double dt) { int genCount = floorf(x8c_generatorRemainder); x8c_generatorRemainder = x8c_generatorRemainder - genCount; - if (CIntElement* maxpElem = desc->x28_x1c_MAXP.get()) + if (CIntElement* maxpElem = desc->x1c_MAXP.get()) maxpElem->GetValue(x74_curFrame, x90_MAXP); CreateNewParticles(genCount); @@ -465,18 +465,18 @@ void CElementGen::UpdateExistingParticles() { } if (x26c_31_LINE) { - if (CRealElement* leng = desc->x20_x14_LENG.get()) + if (CRealElement* leng = desc->x14_LENG.get()) leng->GetValue(particleFrame, particle.x2c_lineLengthOrSize); - if (CRealElement* widt = desc->x24_x18_WIDT.get()) + if (CRealElement* widt = desc->x18_WIDT.get()) widt->GetValue(particleFrame, particle.x30_lineWidthOrRota); } else { - if (CRealElement* rota = desc->x50_x3c_ROTA.get()) + if (CRealElement* rota = desc->x3c_ROTA.get()) rota->GetValue(particleFrame, particle.x30_lineWidthOrRota); - if (CRealElement* size = desc->x4c_x38_SIZE.get()) + if (CRealElement* size = desc->x38_SIZE.get()) size->GetValue(particleFrame, particle.x2c_lineLengthOrSize); } - if (CColorElement* colr = desc->x30_x24_COLR.get()) + if (CColorElement* colr = desc->x24_COLR.get()) colr->GetValue(particleFrame, particle.x34_color); AccumulateBounds(particle.x4_pos, particle.x2c_lineLengthOrSize); @@ -529,7 +529,7 @@ void CElementGen::CreateNewParticles(int count) { } particle.x28_startFrame = x74_curFrame; - if (CIntElement* ltme = desc->x34_x28_LTME.get()) { + if (CIntElement* ltme = desc->x28_LTME.get()) { ltme->GetValue(0, particle.x0_endFrame); } CParticleGlobals::instance()->SetParticleLifetime(particle.x0_endFrame); @@ -540,13 +540,13 @@ void CElementGen::CreateNewParticles(int count) { } particle.x0_endFrame += x74_curFrame; - if (CColorElement* colr = desc->x30_x24_COLR.get()) { + if (CColorElement* colr = desc->x24_COLR.get()) { colr->GetValue(0, particle.x34_color); } else { particle.x34_color = zeus::skWhite; } - if (CEmitterElement* emtr = desc->x40_x2c_EMTR.get()) { + if (CEmitterElement* emtr = desc->x2c_EMTR.get()) { emtr->GetValue(x74_curFrame, particle.x4_pos, particle.x1c_vel); zeus::CVector3f compXf1 = (x13c_globalScaleTransformInverse * x1a8_localScaleTransformInverse) * xdc_translation; zeus::CVector3f compXf2 = x1d8_orientation.rotate(particle.x4_pos); @@ -560,22 +560,22 @@ void CElementGen::CreateNewParticles(int count) { particle.x10_prevPos = particle.x4_pos; if (x26c_31_LINE) { - if (CRealElement* leng = desc->x20_x14_LENG.get()) + if (CRealElement* leng = desc->x14_LENG.get()) leng->GetValue(0, particle.x2c_lineLengthOrSize); else particle.x2c_lineLengthOrSize = 1.f; - if (CRealElement* widt = desc->x24_x18_WIDT.get()) + if (CRealElement* widt = desc->x18_WIDT.get()) widt->GetValue(0, particle.x30_lineWidthOrRota); else particle.x30_lineWidthOrRota = 1.f; } else { - if (CRealElement* rota = desc->x50_x3c_ROTA.get()) + if (CRealElement* rota = desc->x3c_ROTA.get()) rota->GetValue(0, particle.x30_lineWidthOrRota); else particle.x30_lineWidthOrRota = 0.f; - if (CRealElement* size = desc->x4c_x38_SIZE.get()) + if (CRealElement* size = desc->x38_SIZE.get()) size->GetValue(0, particle.x2c_lineLengthOrSize); else particle.x2c_lineLengthOrSize = 0.1f; @@ -592,13 +592,13 @@ void CElementGen::UpdatePSTranslationAndOrientation() { if (x268_PSLT < x74_curFrame) return; - if (CVectorElement* pofs = desc->x18_xc_POFS.get()) + if (CVectorElement* pofs = desc->xc_POFS.get()) pofs->GetValue(x74_curFrame, xf4_POFS); - if (CVectorElement* sspo = desc->xe8_xd4_SSPO.get()) + if (CVectorElement* sspo = desc->xd4_SSPO.get()) sspo->GetValue(x74_curFrame, x2b0_SSPO); - if (CVectorElement* sepo = desc->xfc_xe8_SEPO.get()) + if (CVectorElement* sepo = desc->xe8_SEPO.get()) sepo->GetValue(x74_curFrame, x2c0_SEPO); } @@ -623,14 +623,14 @@ void CElementGen::UpdateChildParticleSystems(double dt) { CGlobalRandom gr(x27c_randState); - SChildGeneratorDesc& icts = desc->x8c_x78_ICTS; + SChildGeneratorDesc& icts = desc->x78_ICTS; if (icts.m_found && x84_prevFrame != x74_curFrame && x2a0_CSSD == x74_curFrame) { int ncsyVal = 1; - if (CIntElement* ncsy = desc->x9c_x88_NCSY.get()) + if (CIntElement* ncsy = desc->x88_NCSY.get()) ncsy->GetValue(x74_curFrame, ncsyVal); CGenDescription* ictsDesc = icts.m_token.GetObj(); - if (!(x26d_27_enableOPTS && ictsDesc->x45_31_x32_25_OPTS)) { + if (!(x26d_27_enableOPTS && ictsDesc->x32_25_OPTS)) { x290_activePartChildren.reserve(ncsyVal + x290_activePartChildren.size()); for (int i = 0; i < ncsyVal; ++i) { std::unique_ptr chGen = ConstructChildParticleSystem(icts.m_token); @@ -639,17 +639,17 @@ void CElementGen::UpdateChildParticleSystems(double dt) { } } - SChildGeneratorDesc& iits = desc->xb8_xa4_IITS; + SChildGeneratorDesc& iits = desc->xa4_IITS; if (iits.m_found && x84_prevFrame != x74_curFrame && x74_curFrame < x268_PSLT && x88_particleEmission == 1 && x74_curFrame >= x2a4_SISY && ((x74_curFrame - x2a4_SISY) % x2a8_PISY) == 0) { CGenDescription* iitsDesc = iits.m_token.GetObj(); - if (!(x26d_27_enableOPTS && iitsDesc->x45_31_x32_25_OPTS)) { + if (!(x26d_27_enableOPTS && iitsDesc->x32_25_OPTS)) { std::unique_ptr chGen = ConstructChildParticleSystem(iits.m_token); x290_activePartChildren.emplace_back(std::move(chGen)); } } - CSpawnSystemKeyframeData* kssm = desc->xd0_xbc_KSSM.get(); + CSpawnSystemKeyframeData* kssm = desc->xbc_KSSM.get(); if (kssm && x84_prevFrame != x74_curFrame && x74_curFrame < x268_PSLT) { u16 backupSeed = g_GlobalSeed; u16 incSeed = backupSeed; @@ -659,7 +659,7 @@ void CElementGen::UpdateChildParticleSystems(double dt) { x290_activePartChildren.reserve(x290_activePartChildren.size() + systems.size()); for (CSpawnSystemKeyframeData::CSpawnSystemKeyframeInfo& system : systems) { TLockedToken& token = system.GetToken(); - if (!(x26d_27_enableOPTS && token.GetObj()->x45_31_x32_25_OPTS)) { + if (!(x26d_27_enableOPTS && token.GetObj()->x32_25_OPTS)) { g_GlobalSeed = incSeed; std::unique_ptr chGen = ConstructChildParticleSystem(token); x290_activePartChildren.emplace_back(std::move(chGen)); @@ -670,14 +670,14 @@ void CElementGen::UpdateChildParticleSystems(double dt) { g_GlobalSeed = backupSeed; } - SChildGeneratorDesc& idts = desc->xa4_x90_IDTS; + SChildGeneratorDesc& idts = desc->x90_IDTS; if (idts.m_found && x74_curFrame == x268_PSLT && x84_prevFrame != x74_curFrame) { int ndsyVal = 1; - if (CIntElement* ndsy = desc->xb4_xa0_NDSY.get()) + if (CIntElement* ndsy = desc->xa0_NDSY.get()) ndsy->GetValue(0, ndsyVal); CGenDescription* idtsDesc = idts.m_token.GetObj(); - if (!(x26d_27_enableOPTS && idtsDesc->x45_31_x32_25_OPTS)) { + if (!(x26d_27_enableOPTS && idtsDesc->x32_25_OPTS)) { x290_activePartChildren.reserve(ndsyVal + x290_activePartChildren.size()); for (int i = 0; i < ndsyVal; ++i) { std::unique_ptr chGen = ConstructChildParticleSystem(idts.m_token); @@ -686,7 +686,7 @@ void CElementGen::UpdateChildParticleSystems(double dt) { } } - SSwooshGeneratorDesc& sswh = desc->xd4_xc0_SSWH; + SSwooshGeneratorDesc& sswh = desc->xc0_SSWH; if (sswh.m_found && x84_prevFrame != x74_curFrame && x74_curFrame == x2ac_SSSD) { std::unique_ptr sswhGen = std::make_unique(sswh.m_token, 0); sswhGen->SetGlobalTranslation(xe8_globalTranslation); @@ -698,7 +698,7 @@ void CElementGen::UpdateChildParticleSystems(double dt) { x290_activePartChildren.emplace_back(std::move(sswhGen)); } - SElectricGeneratorDesc& selc = desc->xec_xd8_SELC; + SElectricGeneratorDesc& selc = desc->xd8_SELC; if (selc.m_found && x84_prevFrame != x74_curFrame && x74_curFrame == x2bc_SESD) { std::unique_ptr selcGen = std::make_unique(selc.m_token); selcGen->SetGlobalTranslation(xe8_globalTranslation); @@ -728,10 +728,10 @@ void CElementGen::UpdateChildParticleSystems(double dt) { void CElementGen::UpdateLightParameters() { CGenDescription* desc = x1c_genDesc.GetObj(); - if (CColorElement* lclr = desc->x104_xf0_LCLR.get()) + if (CColorElement* lclr = desc->xf0_LCLR.get()) lclr->GetValue(x74_curFrame, x30c_LCLR); - if (CRealElement* lint = desc->x108_xf4_LINT.get()) + if (CRealElement* lint = desc->xf4_LINT.get()) lint->GetValue(x74_curFrame, x310_LINT); switch (x308_lightType) { @@ -739,21 +739,21 @@ void CElementGen::UpdateLightParameters() { case LightType::None: case LightType::Custom: case LightType::Spot: { - if (CVectorElement* loff = desc->x10c_xf8_LOFF.get()) + if (CVectorElement* loff = desc->xf8_LOFF.get()) loff->GetValue(x74_curFrame, x314_LOFF); - if (CRealElement* lfor = desc->x118_x104_LFOR.get()) + if (CRealElement* lfor = desc->x104_LFOR.get()) lfor->GetValue(x74_curFrame, x330_LFOR); if (x308_lightType == LightType::Spot) { - if (CRealElement* lsla = desc->x11c_x108_LSLA.get()) + if (CRealElement* lsla = desc->x108_LSLA.get()) lsla->GetValue(x74_curFrame, x334_LSLA); } [[fallthrough]]; } case LightType::Directional: { if (x308_lightType != LightType::Custom) { - if (CVectorElement* ldir = desc->x110_xfc_LDIR.get()) + if (CVectorElement* ldir = desc->xfc_LDIR.get()) ldir->GetValue(x74_curFrame, x320_LDIR); } } @@ -834,7 +834,7 @@ void CElementGen::Render(const CActorLights* actorLights) { if (!x26c_31_LINE && (!m_instBuf || !m_uniformBuf)) { return; } - if (x28_loadedGenDesc->x45_24_x31_26_PMUS && (!m_instBufPmus || !m_uniformBufPmus)) { + if (x28_loadedGenDesc->x31_26_PMUS && (!m_instBufPmus || !m_uniformBufPmus)) { return; } @@ -854,8 +854,8 @@ void CElementGen::Render(const CActorLights* actorLights) { CParticleGlobals::instance()->m_currentParticleSystem = &thisSystem; if (x30_particles.size()) { - SParticleModel& pmdl = desc->x5c_x48_PMDL; - if (pmdl.m_found || desc->x45_24_x31_26_PMUS) + SParticleModel& pmdl = desc->x48_PMDL; + if (pmdl.m_found || desc->x31_26_PMUS) RenderModels(actorLights); if (x26c_31_LINE) @@ -872,7 +872,7 @@ void CElementGen::RenderModels(const CActorLights* actorLights) { if (!x26c_31_LINE && (!m_instBuf || !m_uniformBuf)) { return; } - if (x28_loadedGenDesc->x45_24_x31_26_PMUS && (!m_instBufPmus || !m_uniformBufPmus)) { + if (x28_loadedGenDesc->x31_26_PMUS && (!m_instBufPmus || !m_uniformBufPmus)) { return; } @@ -884,16 +884,16 @@ void CElementGen::RenderModels(const CActorLights* actorLights) { CGenDescription* desc = x1c_genDesc.GetObj(); SUVElementSet uvs = {0.f, 0.f, 1.f, 1.f}; - CUVElement* texr = desc->x54_x40_TEXR.get(); + CUVElement* texr = desc->x40_TEXR.get(); CTexture* cachedTex = nullptr; bool texConst = true; bool moveRedToAlphaBuffer = false; - if (desc->x45_24_x31_26_PMUS) { - if (sMoveRedToAlphaBuffer && desc->x44_31_x31_25_PMAB && desc->x54_x40_TEXR) + if (desc->x31_26_PMUS) { + if (sMoveRedToAlphaBuffer && desc->x31_25_PMAB && desc->x40_TEXR) moveRedToAlphaBuffer = true; - if (desc->x44_31_x31_25_PMAB) { + if (desc->x31_25_PMAB) { CGraphics::SetDepthWriteMode(true, ERglEnum::LEqual, false); if (moveRedToAlphaBuffer) CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::One, ERglBlendFactor::One, ERglLogicOp::Clear); @@ -947,11 +947,11 @@ void CElementGen::RenderModels(const CActorLights* actorLights) { } zeus::CTransform orient = zeus::CTransform(); - if (!desc->x45_25_x31_27_PMOO) + if (!desc->x31_27_PMOO) orient = x1d8_orientation; orient = orient * x22c_globalOrientation; - CVectorElement* pmrt = desc->x70_x5c_PMRT.get(); + CVectorElement* pmrt = desc->x5c_PMRT.get(); bool pmrtConst = false; if (pmrt) pmrtConst = pmrt->IsFastConstant(); @@ -989,7 +989,7 @@ void CElementGen::RenderModels(const CActorLights* actorLights) { CParticleGlobals::instance()->m_particleAccessParameters = &x60_advValues[i]; } - CVectorElement* pmop = desc->x6c_x58_PMOP.get(); + CVectorElement* pmop = desc->x58_PMOP.get(); if (pmop) pmop->GetValue(partFrame, pmopVec); @@ -1018,14 +1018,14 @@ void CElementGen::RenderModels(const CActorLights* actorLights) { } } - CVectorElement* pmsc = desc->x74_x60_PMSC.get(); + CVectorElement* pmsc = desc->x60_PMSC.get(); if (pmsc) { zeus::CVector3f pmscVal; pmsc->GetValue(partFrame, pmscVal); partTrans = partTrans * zeus::CTransform::Scale(pmscVal); } - CColorElement* pmcl = desc->x78_x64_PMCL.get(); + CColorElement* pmcl = desc->x64_PMCL.get(); if (pmcl) { pmcl->GetValue(partFrame, col); col *= x338_moduColor; @@ -1033,7 +1033,7 @@ void CElementGen::RenderModels(const CActorLights* actorLights) { CGraphics::SetModelMatrix((x10c_globalScaleTransform * partTrans) * x178_localScaleTransform); - if (desc->x45_24_x31_26_PMUS) { + if (desc->x31_26_PMUS) { if (!texConst) { CTexture* tex = texr->GetValueTexture(x74_curFrame - particle.x28_startFrame).GetObj(); if (tex != cachedTex) { @@ -1069,12 +1069,12 @@ void CElementGen::RenderModels(const CActorLights* actorLights) { break; } } else { - CModel* model = desc->x5c_x48_PMDL.m_token.GetObj(); + CModel* model = desc->x48_PMDL.m_token.GetObj(); if (actorLights) actorLights->ActivateLights(model->GetInstance()); if (g_subtractBlend) { model->Draw({5, 0, 1, zeus::CColor(1.f, 0.5f)}); - } else if (desc->x44_31_x31_25_PMAB) { + } else if (desc->x31_25_PMAB) { CModelFlags flags{7, 0, 1, col}; flags.m_extendedShader = EExtendedShader::ForcedAdditiveNoZWrite; model->Draw(flags); @@ -1089,7 +1089,7 @@ void CElementGen::RenderModels(const CActorLights* actorLights) { ++matrixIt; } - if (desc->x45_24_x31_26_PMUS) { + if (desc->x31_26_PMUS) { switch (m_shaderClass) { case CElementGenShaders::EShaderClass::Tex: m_instBufPmus->load(g_instTexData.data(), g_instTexData.size() * sizeof(SParticleInstanceTex)); @@ -1136,12 +1136,12 @@ void CElementGen::RenderLines() { ERglLogicOp::Clear); } - CRealElement* widt = desc->x24_x18_WIDT.get(); + CRealElement* widt = desc->x18_WIDT.get(); bool widtConst = false; if (widt) widtConst = widt->IsConstant(); - CUVElement* texr = desc->x54_x40_TEXR.get(); + CUVElement* texr = desc->x40_TEXR.get(); SUVElementSet uvs = {0.f, 0.f, 1.f, 1.f}; bool constTexr = true; bool constUVs = true; @@ -1216,14 +1216,14 @@ void CElementGen::RenderParticles() { CGenDescription* desc = x1c_genDesc.GetObj(); CGlobalRandom gr(x27c_randState); - CUVElement* texr = desc->x54_x40_TEXR.get(); - CUVElement* tind = desc->x58_x44_TIND.get(); + CUVElement* texr = desc->x40_TEXR.get(); + CUVElement* tind = desc->x44_TIND.get(); if (texr && tind) { RenderParticlesIndirectTexture(); return; } - CRealElement* size = desc->x4c_x38_SIZE.get(); + CRealElement* size = desc->x38_SIZE.get(); if (size && size->IsConstant()) { float sizeVal; size->GetValue(0, sizeVal); @@ -1272,7 +1272,7 @@ void CElementGen::RenderParticles() { m_uniformBuf->load(&uniformData, sizeof(SParticleUniforms)); std::vector sortItems; - if (desc->x44_28_x30_28_SORT) { + if (desc->x30_28_SORT) { sortItems.reserve(x30_particles.size()); for (size_t i = 0; i < x30_particles.size(); ++i) { @@ -1294,12 +1294,12 @@ void CElementGen::RenderParticles() { if (g_subtractBlend) { // FIXME should there be NoTex specializations for RedToAlpha? - if (moveRedToAlphaBuffer && desc->x54_x40_TEXR) + if (moveRedToAlphaBuffer && desc->x40_TEXR) CGraphics::SetShaderDataBinding(m_redToAlphaSubDataBind[g_Renderer->IsThermalVisorHotPass()]); else CGraphics::SetShaderDataBinding(m_normalSubDataBind[g_Renderer->IsThermalVisorHotPass()]); } else { - if (moveRedToAlphaBuffer && desc->x54_x40_TEXR) + if (moveRedToAlphaBuffer && desc->x40_TEXR) CGraphics::SetShaderDataBinding(m_redToAlphaDataBind[g_Renderer->IsThermalVisorHotPass()]); else CGraphics::SetShaderDataBinding(m_normalDataBind[g_Renderer->IsThermalVisorHotPass()]); @@ -1353,13 +1353,13 @@ void CElementGen::RenderParticles() { if (!x26c_29_ORNT) { for (size_t i = 0; i < x30_particles.size(); ++i) { - const int partIdx = desc->x44_28_x30_28_SORT ? sortItems[i].x0_partIdx : int(i); + const int partIdx = desc->x30_28_SORT ? sortItems[i].x0_partIdx : int(i); CParticle& particle = x30_particles[partIdx]; g_currentParticle = &particle; const int partFrame = x74_curFrame - particle.x28_startFrame - 1; zeus::CVector3f viewPoint; - if (desc->x44_28_x30_28_SORT) { + if (desc->x30_28_SORT) { viewPoint = sortItems[i].x4_viewPoint; } else { viewPoint = systemCameraMatrix * @@ -1439,14 +1439,14 @@ void CElementGen::RenderParticles() { } } else { for (size_t i = 0; i < x30_particles.size(); ++i) { - const int partIdx = desc->x44_28_x30_28_SORT ? sortItems[i].x0_partIdx : int(i); + const int partIdx = desc->x30_28_SORT ? sortItems[i].x0_partIdx : int(i); CParticle& particle = x30_particles[partIdx]; g_currentParticle = &particle; const int partFrame = x74_curFrame - particle.x28_startFrame - 1; zeus::CVector3f viewPoint = ((particle.x4_pos - particle.x10_prevPos) * x80_timeDeltaScale + particle.x10_prevPos); - const float width = !desc->x50_x3c_ROTA ? 1.f : particle.x30_lineWidthOrRota; + const float width = !desc->x3c_ROTA ? 1.f : particle.x30_lineWidthOrRota; zeus::CVector3f dir; if (particle.x1c_vel.canBeNormalized()) { dir = particle.x1c_vel.normalized(); @@ -1541,7 +1541,7 @@ void CElementGen::RenderParticles() { } const float mbspFac = 1.f / float(mbspVal); for (size_t i = 0; i < x30_particles.size(); ++i) { - const int partIdx = desc->x44_28_x30_28_SORT ? sortItems[i].x0_partIdx : int(i); + const int partIdx = desc->x30_28_SORT ? sortItems[i].x0_partIdx : int(i); CParticle& particle = x30_particles[partIdx]; g_currentParticle = &particle; @@ -1668,7 +1668,7 @@ void CElementGen::RenderParticlesIndirectTexture() { ERglLogicOp::Clear); } - CUVElement* texr = desc->x54_x40_TEXR.get(); + CUVElement* texr = desc->x40_TEXR.get(); CParticle& firstParticle = x30_particles[0]; int partFrame = x74_curFrame - firstParticle.x28_startFrame; CTexture* cachedTex = texr->GetValueTexture(partFrame).GetObj(); @@ -1679,7 +1679,7 @@ void CElementGen::RenderParticlesIndirectTexture() { texr->GetValueUV(partFrame, uvs); bool constUVs = texr->HasConstantUV(); - CUVElement* tind = desc->x58_x44_TIND.get(); + CUVElement* tind = desc->x44_TIND.get(); CTexture* cachedIndTex = tind->GetValueTexture(partFrame).GetObj(); cachedIndTex->Load(2, CTexture::EClampMode::One); @@ -1689,7 +1689,7 @@ void CElementGen::RenderParticlesIndirectTexture() { tind->GetValueUV(partFrame, uvsInd); std::vector sortItems; - if (desc->x44_28_x30_28_SORT) { + if (desc->x30_28_SORT) { sortItems.reserve(x30_particles.size()); for (size_t i = 0; i < x30_particles.size(); ++i) { @@ -1712,13 +1712,13 @@ void CElementGen::RenderParticlesIndirectTexture() { CGraphics::SetShaderDataBinding(m_normalDataBind[g_Renderer->IsThermalVisorHotPass()]); for (size_t i = 0; i < x30_particles.size(); ++i) { - const int partIdx = desc->x44_28_x30_28_SORT ? sortItems[i].x0_partIdx : int(i); + const int partIdx = desc->x30_28_SORT ? sortItems[i].x0_partIdx : int(i); CParticle& particle = x30_particles[partIdx]; g_currentParticle = &particle; const int thisPartFrame = x74_curFrame - particle.x28_startFrame; zeus::CVector3f viewPoint; - if (desc->x44_28_x30_28_SORT) { + if (desc->x30_28_SORT) { viewPoint = sortItems[i].x4_viewPoint; } else { viewPoint = diff --git a/Runtime/Particle/CElementGen.hpp b/Runtime/Particle/CElementGen.hpp index a97ff757d..0194a69ba 100644 --- a/Runtime/Particle/CElementGen.hpp +++ b/Runtime/Particle/CElementGen.hpp @@ -219,7 +219,7 @@ public: FourCC Get4CharId() const override { return FOURCC('PART'); } size_t GetNumActiveChildParticles() const { return x290_activePartChildren.size(); } CParticleGen& GetActiveChildParticle(size_t idx) const { return *x290_activePartChildren[idx]; } - bool IsIndirectTextured() const { return x28_loadedGenDesc->x54_x40_TEXR && x28_loadedGenDesc->x58_x44_TIND; } + bool IsIndirectTextured() const { return x28_loadedGenDesc->x40_TEXR && x28_loadedGenDesc->x44_TIND; } void SetModelsUseLights(bool useLights) { x26d_26_modelsUseLights = useLights; } void SetZTest(bool z) { x26c_28_zTest = z; } static void SetMoveRedToAlphaBuffer(bool move); diff --git a/Runtime/Particle/CGenDescription.hpp b/Runtime/Particle/CGenDescription.hpp index 4687e8455..10d82f99b 100644 --- a/Runtime/Particle/CGenDescription.hpp +++ b/Runtime/Particle/CGenDescription.hpp @@ -18,83 +18,74 @@ namespace metaforce { class CGenDescription { public: - /* Naming convention: __ */ - - /* Removed from demo */ - // std::unique_ptr x0_PSIV; - // std::unique_ptr x4_PSVM; - // std::unique_ptr x8_PSOV; - std::unique_ptr xc_x0_PSLT; - std::unique_ptr x10_x4_PSWT; - std::unique_ptr x14_x8_PSTS; - std::unique_ptr x18_xc_POFS; - std::unique_ptr x1c_x10_SEED; - std::unique_ptr x20_x14_LENG; - std::unique_ptr x24_x18_WIDT; - std::unique_ptr x28_x1c_MAXP; - std::unique_ptr x2c_x20_GRTE; - std::unique_ptr x30_x24_COLR; - std::unique_ptr x34_x28_LTME; - /* Removed from demo (replaced by EMTR) */ - // std::unique_ptr x38_ILOC; - // std::unique_ptr x3c_IVEC; - std::unique_ptr x40_x2c_EMTR; - bool x44_28_x30_28_SORT : 1 = false; - bool x44_30_x31_24_MBLR : 1 = false; - bool x44_24_x30_24_LINE : 1 = false; - bool x44_29_x30_29_LIT_ : 1 = false; - bool x44_26_x30_26_AAPH : 1 = false; - bool x44_27_x30_27_ZBUF : 1 = false; - bool x44_25_x30_25_FXLL : 1 = false; - bool x44_31_x31_25_PMAB : 1 = false; - bool x45_29_x31_31_VMD4 : 1 = false; - bool x45_28_x31_30_VMD3 : 1 = false; - bool x45_27_x31_29_VMD2 : 1 = false; - bool x45_26_x31_28_VMD1 : 1 = false; - bool x45_31_x32_25_OPTS : 1 = false; - bool x45_24_x31_26_PMUS : 1 = false; - bool x45_25_x31_27_PMOO : 1 = true; - bool x45_30_x32_24_CIND : 1 = false; - /* 0-00 additions */ + std::unique_ptr x0_PSLT; + std::unique_ptr x4_PSWT; + std::unique_ptr x8_PSTS; + std::unique_ptr xc_POFS; + std::unique_ptr x10_SEED; + std::unique_ptr x14_LENG; + std::unique_ptr x18_WIDT; + std::unique_ptr x1c_MAXP; + std::unique_ptr x20_GRTE; + std::unique_ptr x24_COLR; + std::unique_ptr x28_LTME; + std::unique_ptr x2c_EMTR; + std::unique_ptr x30_EADY; // Added in MP3 + bool x30_24_LINE : 1 = false; + bool x30_25_FXLL : 1 = false; + bool x30_26_AAPH : 1 = false; + bool x30_27_ZBUF : 1 = false; + bool x30_28_SORT : 1 = false; + bool x30_29_LIT_ : 1 = false; bool x30_30_ORNT : 1 = false; bool x30_31_RSOP : 1 = false; - std::unique_ptr x48_x34_MBSP; - std::unique_ptr x4c_x38_SIZE; - std::unique_ptr x50_x3c_ROTA; - std::unique_ptr x54_x40_TEXR; - std::unique_ptr x58_x44_TIND; - SParticleModel x5c_x48_PMDL; - std::unique_ptr x6c_x58_PMOP; - std::unique_ptr x70_x5c_PMRT; - std::unique_ptr x74_x60_PMSC; - std::unique_ptr x78_x64_PMCL; - std::unique_ptr x7c_x68_VEL1; - std::unique_ptr x80_x6c_VEL2; - std::unique_ptr x84_x70_VEL3; - std::unique_ptr x88_x74_VEL4; - SChildGeneratorDesc x8c_x78_ICTS; - std::unique_ptr x9c_x88_NCSY; - std::unique_ptr xa0_x8c_CSSD; - SChildGeneratorDesc xa4_x90_IDTS; - std::unique_ptr xb4_xa0_NDSY; - SChildGeneratorDesc xb8_xa4_IITS; - std::unique_ptr xc8_xb4_PISY; - std::unique_ptr xcc_xb8_SISY; - std::unique_ptr xd0_xbc_KSSM; - SSwooshGeneratorDesc xd4_xc0_SSWH; - std::unique_ptr xe4_xd0_SSSD; - std::unique_ptr xe8_xd4_SSPO; - SElectricGeneratorDesc xec_xd8_SELC; - std::unique_ptr xf8_xe4_SESD; - std::unique_ptr xfc_xe8_SEPO; - std::unique_ptr x100_xec_LTYP; - std::unique_ptr x104_xf0_LCLR; - std::unique_ptr x108_xf4_LINT; - std::unique_ptr x10c_xf8_LOFF; - std::unique_ptr x110_xfc_LDIR; - std::unique_ptr x114_x100_LFOT; - std::unique_ptr x118_x104_LFOR; - std::unique_ptr x11c_x108_LSLA; + bool x31_24_MBLR : 1 = false; + bool x31_25_PMAB : 1 = false; + bool x31_26_PMUS : 1 = false; + bool x31_27_PMOO : 1 = true; + bool x31_28_VMD1 : 1 = false; + bool x31_29_VMD2 : 1 = false; + bool x31_30_VMD3 : 1 = false; + bool x31_31_VMD4 : 1 = false; + bool x32_24_CIND : 1 = false; + bool x32_25_OPTS : 1 = false; + std::unique_ptr x34_MBSP; + std::unique_ptr x38_SIZE; + std::unique_ptr x3c_ROTA; + std::unique_ptr x40_TEXR; + std::unique_ptr x44_TIND; + SParticleModel x48_PMDL; + std::unique_ptr x58_PMOP; + std::unique_ptr x5c_PMRT; + std::unique_ptr x60_PMSC; + std::unique_ptr x64_PMCL; + std::unique_ptr x68_VEL1; + std::unique_ptr x6c_VEL2; + std::unique_ptr x70_VEL3; + std::unique_ptr x74_VEL4; + SChildGeneratorDesc x78_ICTS; + std::unique_ptr x88_NCSY; + std::unique_ptr x8c_CSSD; + SChildGeneratorDesc x90_IDTS; + std::unique_ptr xa0_NDSY; + SChildGeneratorDesc xa4_IITS; + std::unique_ptr xb4_PISY; + std::unique_ptr xb8_SISY; + std::unique_ptr xbc_KSSM; + SSwooshGeneratorDesc xc0_SSWH; + std::unique_ptr xd0_SSSD; + std::unique_ptr xd4_SSPO; + SElectricGeneratorDesc xd8_SELC; + std::unique_ptr xe4_SESD; + std::unique_ptr xe8_SEPO; + std::unique_ptr xec_LTYP; + std::unique_ptr xf0_LCLR; + std::unique_ptr xf4_LINT; + std::unique_ptr xf8_LOFF; + std::unique_ptr xfc_LDIR; + std::unique_ptr x100_LFOT; + std::unique_ptr x104_LFOR; + std::unique_ptr x108_LSLA; std::unique_ptr x10c_ADV1; std::unique_ptr x110_ADV2; std::unique_ptr x114_ADV3; @@ -103,7 +94,9 @@ public: std::unique_ptr x120_ADV6; std::unique_ptr x124_ADV7; std::unique_ptr x128_ADV8; - + s32 x174_DFLG = 0; // Added in MP2 + s32 x178_ = 0; // In MP3, need to check MP2 + s32 x17c_ = 0; // In MP3, need to check MP2 /* Custom additions */ std::unique_ptr m_bevelGradient; /* FourCC BGCL */ diff --git a/Runtime/Particle/CParticleDataFactory.cpp b/Runtime/Particle/CParticleDataFactory.cpp index f2d5cab20..f16e428b2 100644 --- a/Runtime/Particle/CParticleDataFactory.cpp +++ b/Runtime/Particle/CParticleDataFactory.cpp @@ -739,223 +739,223 @@ bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& i while (clsId != SBIG('_END')) { switch (clsId.toUint32()) { case SBIG('PMCL'): - fillDesc->x78_x64_PMCL = GetColorElement(in); + fillDesc->x64_PMCL = GetColorElement(in); break; case SBIG('LFOR'): - fillDesc->x118_x104_LFOR = GetRealElement(in); + fillDesc->x104_LFOR = GetRealElement(in); break; case SBIG('IDTS'): - fillDesc->xa4_x90_IDTS = GetChildGeneratorDesc(in, resPool, tracker); + fillDesc->x90_IDTS = GetChildGeneratorDesc(in, resPool, tracker); break; case SBIG('EMTR'): - fillDesc->x40_x2c_EMTR = GetEmitterElement(in); + fillDesc->x2c_EMTR = GetEmitterElement(in); break; case SBIG('COLR'): - fillDesc->x30_x24_COLR = GetColorElement(in); + fillDesc->x24_COLR = GetColorElement(in); break; case SBIG('CIND'): - fillDesc->x45_30_x32_24_CIND = GetBool(in); + fillDesc->x32_24_CIND = GetBool(in); break; case SBIG('AAPH'): - fillDesc->x44_26_x30_26_AAPH = GetBool(in); + fillDesc->x30_26_AAPH = GetBool(in); break; case SBIG('CSSD'): - fillDesc->xa0_x8c_CSSD = GetIntElement(in); + fillDesc->x8c_CSSD = GetIntElement(in); break; case SBIG('GRTE'): - fillDesc->x2c_x20_GRTE = GetRealElement(in); + fillDesc->x20_GRTE = GetRealElement(in); break; case SBIG('FXLL'): - fillDesc->x44_25_x30_25_FXLL = GetBool(in); + fillDesc->x30_25_FXLL = GetBool(in); break; case SBIG('ICTS'): - fillDesc->x8c_x78_ICTS = GetChildGeneratorDesc(in, resPool, tracker); + fillDesc->x78_ICTS = GetChildGeneratorDesc(in, resPool, tracker); break; case SBIG('KSSM'): { - fillDesc->xd0_xbc_KSSM.reset(); + fillDesc->xbc_KSSM.reset(); FourCC cid = GetClassID(in); if (cid != SBIG('CNST')) break; - fillDesc->xd0_xbc_KSSM = std::make_unique(in); - fillDesc->xd0_xbc_KSSM->LoadAllSpawnedSystemTokens(resPool); + fillDesc->xbc_KSSM = std::make_unique(in); + fillDesc->xbc_KSSM->LoadAllSpawnedSystemTokens(resPool); break; } case SBIG('ILOC'): GetVectorElement(in); break; case SBIG('IITS'): - fillDesc->xb8_xa4_IITS = GetChildGeneratorDesc(in, resPool, tracker); + fillDesc->xa4_IITS = GetChildGeneratorDesc(in, resPool, tracker); break; case SBIG('IVEC'): GetVectorElement(in); break; case SBIG('LDIR'): - fillDesc->x110_xfc_LDIR = GetVectorElement(in); + fillDesc->xfc_LDIR = GetVectorElement(in); break; case SBIG('LCLR'): - fillDesc->x104_xf0_LCLR = GetColorElement(in); + fillDesc->xf0_LCLR = GetColorElement(in); break; case SBIG('LENG'): - fillDesc->x20_x14_LENG = GetRealElement(in); + fillDesc->x14_LENG = GetRealElement(in); break; case SBIG('MAXP'): - fillDesc->x28_x1c_MAXP = GetIntElement(in); + fillDesc->x1c_MAXP = GetIntElement(in); break; case SBIG('LOFF'): - fillDesc->x10c_xf8_LOFF = GetVectorElement(in); + fillDesc->xf8_LOFF = GetVectorElement(in); break; case SBIG('LINT'): - fillDesc->x108_xf4_LINT = GetRealElement(in); + fillDesc->xf4_LINT = GetRealElement(in); break; case SBIG('LINE'): - fillDesc->x44_24_x30_24_LINE = GetBool(in); + fillDesc->x30_24_LINE = GetBool(in); break; case SBIG('LFOT'): - fillDesc->x114_x100_LFOT = GetIntElement(in); + fillDesc->x100_LFOT = GetIntElement(in); break; case SBIG('LIT_'): - fillDesc->x44_29_x30_29_LIT_ = GetBool(in); + fillDesc->x30_29_LIT_ = GetBool(in); break; case SBIG('LTME'): - fillDesc->x34_x28_LTME = GetIntElement(in); + fillDesc->x28_LTME = GetIntElement(in); break; case SBIG('LSLA'): - fillDesc->x11c_x108_LSLA = GetRealElement(in); + fillDesc->x108_LSLA = GetRealElement(in); break; case SBIG('LTYP'): - fillDesc->x100_xec_LTYP = GetIntElement(in); + fillDesc->xec_LTYP = GetIntElement(in); break; case SBIG('NDSY'): - fillDesc->xb4_xa0_NDSY = GetIntElement(in); + fillDesc->xa0_NDSY = GetIntElement(in); break; case SBIG('MBSP'): - fillDesc->x48_x34_MBSP = GetIntElement(in); + fillDesc->x34_MBSP = GetIntElement(in); break; case SBIG('MBLR'): - fillDesc->x44_30_x31_24_MBLR = GetBool(in); + fillDesc->x31_24_MBLR = GetBool(in); break; case SBIG('NCSY'): - fillDesc->x9c_x88_NCSY = GetIntElement(in); + fillDesc->x88_NCSY = GetIntElement(in); break; case SBIG('PISY'): - fillDesc->xc8_xb4_PISY = GetIntElement(in); + fillDesc->xb4_PISY = GetIntElement(in); break; case SBIG('OPTS'): - fillDesc->x45_31_x32_25_OPTS = GetBool(in); + fillDesc->x32_25_OPTS = GetBool(in); break; case SBIG('PMAB'): - fillDesc->x44_31_x31_25_PMAB = GetBool(in); + fillDesc->x31_25_PMAB = GetBool(in); break; case SBIG('SESD'): - fillDesc->xf8_xe4_SESD = GetIntElement(in); + fillDesc->xe4_SESD = GetIntElement(in); break; case SBIG('SEPO'): - fillDesc->xfc_xe8_SEPO = GetVectorElement(in); + fillDesc->xe8_SEPO = GetVectorElement(in); break; case SBIG('PSLT'): - fillDesc->xc_x0_PSLT = GetIntElement(in); + fillDesc->x0_PSLT = GetIntElement(in); break; case SBIG('PMSC'): - fillDesc->x74_x60_PMSC = GetVectorElement(in); + fillDesc->x60_PMSC = GetVectorElement(in); break; case SBIG('PMOP'): - fillDesc->x6c_x58_PMOP = GetVectorElement(in); + fillDesc->x58_PMOP = GetVectorElement(in); break; case SBIG('PMDL'): - fillDesc->x5c_x48_PMDL = GetModel(in, resPool); + fillDesc->x48_PMDL = GetModel(in, resPool); break; case SBIG('PMRT'): - fillDesc->x70_x5c_PMRT = GetVectorElement(in); + fillDesc->x5c_PMRT = GetVectorElement(in); break; case SBIG('POFS'): - fillDesc->x18_xc_POFS = GetVectorElement(in); + fillDesc->xc_POFS = GetVectorElement(in); break; case SBIG('PMUS'): - fillDesc->x45_24_x31_26_PMUS = GetBool(in); + fillDesc->x31_26_PMUS = GetBool(in); break; case SBIG('PSIV'): GetVectorElement(in); break; case SBIG('ROTA'): - fillDesc->x50_x3c_ROTA = GetRealElement(in); + fillDesc->x3c_ROTA = GetRealElement(in); break; case SBIG('PSVM'): GetModVectorElement(in); break; case SBIG('PSTS'): - fillDesc->x14_x8_PSTS = GetRealElement(in); + fillDesc->x8_PSTS = GetRealElement(in); break; case SBIG('PSOV'): GetVectorElement(in); break; case SBIG('PSWT'): - fillDesc->x10_x4_PSWT = GetIntElement(in); + fillDesc->x4_PSWT = GetIntElement(in); break; case SBIG('SEED'): - fillDesc->x1c_x10_SEED = GetIntElement(in); + fillDesc->x10_SEED = GetIntElement(in); break; case SBIG('PMOO'): - fillDesc->x45_25_x31_27_PMOO = GetBool(in); + fillDesc->x31_27_PMOO = GetBool(in); break; case SBIG('SSSD'): - fillDesc->xe4_xd0_SSSD = GetIntElement(in); + fillDesc->xd0_SSSD = GetIntElement(in); break; case SBIG('SORT'): - fillDesc->x44_28_x30_28_SORT = GetBool(in); + fillDesc->x30_28_SORT = GetBool(in); break; case SBIG('SIZE'): - fillDesc->x4c_x38_SIZE = GetRealElement(in); + fillDesc->x38_SIZE = GetRealElement(in); break; case SBIG('SISY'): - fillDesc->xcc_xb8_SISY = GetIntElement(in); + fillDesc->xb8_SISY = GetIntElement(in); break; case SBIG('SSPO'): - fillDesc->xe8_xd4_SSPO = GetVectorElement(in); + fillDesc->xd4_SSPO = GetVectorElement(in); break; case SBIG('TEXR'): { std::unique_ptr tex(GetTextureElement(in, resPool)); if (tex->GetValueTexture(0)) - fillDesc->x54_x40_TEXR = std::move(tex); + fillDesc->x40_TEXR = std::move(tex); break; } case SBIG('SSWH'): - fillDesc->xd4_xc0_SSWH = GetSwooshGeneratorDesc(in, resPool); + fillDesc->xc0_SSWH = GetSwooshGeneratorDesc(in, resPool); break; case SBIG('TIND'): { std::unique_ptr tex(GetTextureElement(in, resPool)); if (tex->GetValueTexture(0)) - fillDesc->x58_x44_TIND = std::move(tex); + fillDesc->x44_TIND = std::move(tex); break; } case SBIG('VMD4'): - fillDesc->x45_29_x31_31_VMD4 = GetBool(in); + fillDesc->x31_31_VMD4 = GetBool(in); break; case SBIG('VMD3'): - fillDesc->x45_28_x31_30_VMD3 = GetBool(in); + fillDesc->x31_30_VMD3 = GetBool(in); break; case SBIG('VMD2'): - fillDesc->x45_27_x31_29_VMD2 = GetBool(in); + fillDesc->x31_29_VMD2 = GetBool(in); break; case SBIG('VMD1'): - fillDesc->x45_26_x31_28_VMD1 = GetBool(in); + fillDesc->x31_28_VMD1 = GetBool(in); break; case SBIG('VEL4'): - fillDesc->x88_x74_VEL4 = GetModVectorElement(in); + fillDesc->x74_VEL4 = GetModVectorElement(in); break; case SBIG('VEL3'): - fillDesc->x84_x70_VEL3 = GetModVectorElement(in); + fillDesc->x70_VEL3 = GetModVectorElement(in); break; case SBIG('VEL2'): - fillDesc->x80_x6c_VEL2 = GetModVectorElement(in); + fillDesc->x6c_VEL2 = GetModVectorElement(in); break; case SBIG('VEL1'): - fillDesc->x7c_x68_VEL1 = GetModVectorElement(in); + fillDesc->x68_VEL1 = GetModVectorElement(in); break; case SBIG('ZBUF'): - fillDesc->x44_27_x30_27_ZBUF = GetBool(in); + fillDesc->x30_27_ZBUF = GetBool(in); break; case SBIG('WIDT'): - fillDesc->x24_x18_WIDT = GetRealElement(in); + fillDesc->x18_WIDT = GetRealElement(in); break; case SBIG('ORNT'): fillDesc->x30_30_ORNT = GetBool(in); @@ -988,7 +988,7 @@ bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& i fillDesc->x128_ADV8 = GetRealElement(in); break; case SBIG('SELC'): - fillDesc->xec_xd8_SELC = GetElectricGeneratorDesc(in, resPool); + fillDesc->xd8_SELC = GetElectricGeneratorDesc(in, resPool); break; default: { Log.report(logvisor::Fatal, FMT_STRING("Unknown GPSM class {} @{}"), clsId, in.position()); @@ -1019,20 +1019,20 @@ bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& i } void CParticleDataFactory::LoadGPSMTokens(CGenDescription* desc) { - if (desc->x5c_x48_PMDL.m_found) - desc->x5c_x48_PMDL.m_model = desc->x5c_x48_PMDL.m_token.GetObj(); + if (desc->x48_PMDL.m_found) + desc->x48_PMDL.m_model = desc->x48_PMDL.m_token.GetObj(); - if (desc->x8c_x78_ICTS.m_found) - desc->x8c_x78_ICTS.m_gen = desc->x8c_x78_ICTS.m_token.GetObj(); + if (desc->x78_ICTS.m_found) + desc->x78_ICTS.m_gen = desc->x78_ICTS.m_token.GetObj(); - if (desc->xa4_x90_IDTS.m_found) - desc->xa4_x90_IDTS.m_gen = desc->xa4_x90_IDTS.m_token.GetObj(); + if (desc->x90_IDTS.m_found) + desc->x90_IDTS.m_gen = desc->x90_IDTS.m_token.GetObj(); - if (desc->xb8_xa4_IITS.m_found) - desc->xb8_xa4_IITS.m_gen = desc->xb8_xa4_IITS.m_token.GetObj(); + if (desc->xa4_IITS.m_found) + desc->xa4_IITS.m_gen = desc->xa4_IITS.m_token.GetObj(); - if (desc->xd4_xc0_SSWH.m_found) - desc->xd4_xc0_SSWH.m_swoosh = desc->xd4_xc0_SSWH.m_token.GetObj(); + if (desc->xc0_SSWH.m_found) + desc->xc0_SSWH.m_swoosh = desc->xc0_SSWH.m_token.GetObj(); } CFactoryFnReturn FParticleFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms, diff --git a/Runtime/Weapon/CNewFlameThrower.cpp b/Runtime/Weapon/CNewFlameThrower.cpp index 19f85c703..b1075eae9 100644 --- a/Runtime/Weapon/CNewFlameThrower.cpp +++ b/Runtime/Weapon/CNewFlameThrower.cpp @@ -405,18 +405,18 @@ void CNewFlameThrower::UpdateLights(CStateManager& mgr) { continue; } CLight light_data = x358_mainFireGen->GetLight(); - if (x304_mainFire.GetObj()->x104_xf0_LCLR.get()) { + if (x304_mainFire.GetObj()->xf0_LCLR.get()) { s32 rand_int = x2e8_rand.Range(0, 16); CParticleGlobals::instance()->SetEmitterTime(rand_int); zeus::CColor out_color(0xffff00ff); - x304_mainFire.GetObj()->x104_xf0_LCLR->GetValue(rand_int, out_color); + x304_mainFire.GetObj()->xf0_LCLR->GetValue(rand_int, out_color); light_data.SetColor(out_color); } - if (x304_mainFire.GetObj()->x108_xf4_LINT.get()) { + if (x304_mainFire.GetObj()->xf4_LINT.get()) { s32 rand_int = x2e8_rand.Range(0, 16); CParticleGlobals::instance()->SetEmitterTime(rand_int); float out_const_attenuation = 1.f; - x304_mainFire.GetObj()->x108_xf4_LINT->GetValue(rand_int, out_const_attenuation); + x304_mainFire.GetObj()->xf4_LINT->GetValue(rand_int, out_const_attenuation); light_data.SetAngleAttenuation(out_const_attenuation, 0.f, 0.f); } light->SetLight(light_data);