mirror of https://github.com/AxioDL/metaforce.git
GetSystemCount
This commit is contained in:
parent
10296ef68f
commit
66339e3bfa
|
@ -6,7 +6,10 @@
|
||||||
namespace Retro
|
namespace Retro
|
||||||
{
|
{
|
||||||
|
|
||||||
const char* DecodeARAMFile(const char* name);
|
static const char* DecodeARAMFile(const char* name)
|
||||||
|
{
|
||||||
|
return (strncmp(name, "aram:", 5) == 0 ? name + 5 : name);
|
||||||
|
}
|
||||||
|
|
||||||
enum class ESeekOrigin
|
enum class ESeekOrigin
|
||||||
{
|
{
|
||||||
|
@ -44,7 +47,6 @@ public:
|
||||||
static void ARAMARAMXferCallback(u32) {}
|
static void ARAMARAMXferCallback(u32) {}
|
||||||
static void DVDARAMXferCallback(s32, DVDFileInfo*) {}
|
static void DVDARAMXferCallback(s32, DVDFileInfo*) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __RETRO_CDVDFILE_HPP__
|
#endif // __RETRO_CDVDFILE_HPP__
|
||||||
|
|
|
@ -369,10 +369,10 @@ void CElementGen::UpdateExistingParticles()
|
||||||
if (x224_30_VMD1)
|
if (x224_30_VMD1)
|
||||||
{
|
{
|
||||||
Zeus::CVector3f xfVel = x1a8 * particle.x1c_vel;
|
Zeus::CVector3f xfVel = x1a8 * particle.x1c_vel;
|
||||||
Zeus::CVector3f xfPos = x1a8 * (particle.x4_pos - x7c);
|
Zeus::CVector3f xfPos = x1a8 * (particle.x4_pos - x7c_translation);
|
||||||
err = vel1->GetValue(particleFrame, xfVel, xfPos);
|
err = vel1->GetValue(particleFrame, xfVel, xfPos);
|
||||||
particle.x1c_vel = x178 * xfVel;
|
particle.x1c_vel = x178_orientation * xfVel;
|
||||||
particle.x4_pos = x178 * xfPos + x7c;
|
particle.x4_pos = x178_orientation * xfPos + x7c_translation;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -386,10 +386,10 @@ void CElementGen::UpdateExistingParticles()
|
||||||
if (x224_31_VMD2)
|
if (x224_31_VMD2)
|
||||||
{
|
{
|
||||||
Zeus::CVector3f xfVel = x1a8 * particle.x1c_vel;
|
Zeus::CVector3f xfVel = x1a8 * particle.x1c_vel;
|
||||||
Zeus::CVector3f xfPos = x1a8 * (particle.x4_pos - x7c);
|
Zeus::CVector3f xfPos = x1a8 * (particle.x4_pos - x7c_translation);
|
||||||
err |= vel2->GetValue(particleFrame, xfVel, xfPos);
|
err |= vel2->GetValue(particleFrame, xfVel, xfPos);
|
||||||
particle.x1c_vel = x178 * xfVel;
|
particle.x1c_vel = x178_orientation * xfVel;
|
||||||
particle.x4_pos = x178 * xfPos + x7c;
|
particle.x4_pos = x178_orientation * xfPos + x7c_translation;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -403,10 +403,10 @@ void CElementGen::UpdateExistingParticles()
|
||||||
if (x225_24_VMD3)
|
if (x225_24_VMD3)
|
||||||
{
|
{
|
||||||
Zeus::CVector3f xfVel = x1a8 * particle.x1c_vel;
|
Zeus::CVector3f xfVel = x1a8 * particle.x1c_vel;
|
||||||
Zeus::CVector3f xfPos = x1a8 * (particle.x4_pos - x7c);
|
Zeus::CVector3f xfPos = x1a8 * (particle.x4_pos - x7c_translation);
|
||||||
err |= vel3->GetValue(particleFrame, xfVel, xfPos);
|
err |= vel3->GetValue(particleFrame, xfVel, xfPos);
|
||||||
particle.x1c_vel = x178 * xfVel;
|
particle.x1c_vel = x178_orientation * xfVel;
|
||||||
particle.x4_pos = x178 * xfPos + x7c;
|
particle.x4_pos = x178_orientation * xfPos + x7c_translation;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -420,10 +420,10 @@ void CElementGen::UpdateExistingParticles()
|
||||||
if (x225_25_VMD4)
|
if (x225_25_VMD4)
|
||||||
{
|
{
|
||||||
Zeus::CVector3f xfVel = x1a8 * particle.x1c_vel;
|
Zeus::CVector3f xfVel = x1a8 * particle.x1c_vel;
|
||||||
Zeus::CVector3f xfPos = x1a8 * (particle.x4_pos - x7c);
|
Zeus::CVector3f xfPos = x1a8 * (particle.x4_pos - x7c_translation);
|
||||||
err |= vel4->GetValue(particleFrame, xfVel, xfPos);
|
err |= vel4->GetValue(particleFrame, xfVel, xfPos);
|
||||||
particle.x1c_vel = x178 * xfVel;
|
particle.x1c_vel = x178_orientation * xfVel;
|
||||||
particle.x4_pos = x178 * xfPos + x7c;
|
particle.x4_pos = x178_orientation * xfPos + x7c_translation;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -483,7 +483,7 @@ void CElementGen::CreateNewParticles(int count)
|
||||||
x2c_particleLists.push_back(staticIdx);
|
x2c_particleLists.push_back(staticIdx);
|
||||||
++x208_activeParticleCount;
|
++x208_activeParticleCount;
|
||||||
if (x28_orientType == EModelOrientationType::One)
|
if (x28_orientType == EModelOrientationType::One)
|
||||||
x3c_parentMatrices[x2c_particleLists.size()-1] = x178.buildMatrix3f();
|
x3c_parentMatrices[x2c_particleLists.size()-1] = x178_orientation.buildMatrix3f();
|
||||||
|
|
||||||
CElementGen::CParticle& particle = g_StaticParticleList[staticIdx];
|
CElementGen::CParticle& particle = g_StaticParticleList[staticIdx];
|
||||||
particle.x28_startFrame = x50_curFrame;
|
particle.x28_startFrame = x50_curFrame;
|
||||||
|
@ -504,14 +504,14 @@ void CElementGen::CreateNewParticles(int count)
|
||||||
if (emtr)
|
if (emtr)
|
||||||
{
|
{
|
||||||
emtr->GetValue(x210_curEmitterFrame, particle.x4_pos, particle.x1c_vel);
|
emtr->GetValue(x210_curEmitterFrame, particle.x4_pos, particle.x1c_vel);
|
||||||
Zeus::CVector3f compXf1 = (xdc * x148) * x7c;
|
Zeus::CVector3f compXf1 = (xdc * x148) * x7c_translation;
|
||||||
Zeus::CVector3f compXf2 = x178 * particle.x4_pos;
|
Zeus::CVector3f compXf2 = x178_orientation * particle.x4_pos;
|
||||||
particle.x4_pos = compXf1 + compXf2 + x94_POFS;
|
particle.x4_pos = compXf1 + compXf2 + x94_POFS;
|
||||||
particle.x1c_vel = x178 * particle.x1c_vel;
|
particle.x1c_vel = x178_orientation * particle.x1c_vel;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Zeus::CVector3f compXf1 = (xdc * x148) * x7c;
|
Zeus::CVector3f compXf1 = (xdc * x148) * x7c_translation;
|
||||||
particle.x4_pos = compXf1 + x94_POFS;
|
particle.x4_pos = compXf1 + x94_POFS;
|
||||||
particle.x1c_vel.zeroOut();
|
particle.x1c_vel.zeroOut();
|
||||||
}
|
}
|
||||||
|
@ -561,26 +561,26 @@ void CElementGen::UpdatePSTranslationAndOrientation()
|
||||||
CModVectorElement* psvm = x1c_genDesc.GetObj()->x4_PSVM.get();
|
CModVectorElement* psvm = x1c_genDesc.GetObj()->x4_PSVM.get();
|
||||||
if (psvm)
|
if (psvm)
|
||||||
{
|
{
|
||||||
Zeus::CVector3f vel = x7c;
|
Zeus::CVector3f vel = x7c_translation;
|
||||||
psvm->GetValue(x50_curFrame, x218_PSIV, vel);
|
psvm->GetValue(x50_curFrame, x218_PSIV, vel);
|
||||||
if (vel != x7c)
|
if (vel != x7c_translation)
|
||||||
{
|
{
|
||||||
x224_24 = true;
|
x224_24 = true;
|
||||||
x7c = vel;
|
x7c_translation = vel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Zeus::CVector3f v = x178 * x218_PSIV;
|
Zeus::CVector3f v = x178_orientation * x218_PSIV;
|
||||||
if (v != Zeus::CVector3f::skZero)
|
if (v != Zeus::CVector3f::skZero)
|
||||||
x224_24 = true;
|
x224_24 = true;
|
||||||
x7c += v;
|
x7c_translation += v;
|
||||||
|
|
||||||
CVectorElement* psov = x1c_genDesc.GetObj()->x8_PSOV.get();
|
CVectorElement* psov = x1c_genDesc.GetObj()->x8_PSOV.get();
|
||||||
if (psov)
|
if (psov)
|
||||||
{
|
{
|
||||||
Zeus::CVector3f angles;
|
Zeus::CVector3f angles;
|
||||||
psov->GetValue(x50_curFrame, angles);
|
psov->GetValue(x50_curFrame, angles);
|
||||||
Zeus::CTransform xf(x178);
|
Zeus::CTransform xf(x178_orientation);
|
||||||
xf.rotateLocalX(angles[0] * M_PI / 180.f);
|
xf.rotateLocalX(angles[0] * M_PI / 180.f);
|
||||||
xf.rotateLocalY(angles[1] * M_PI / 180.f);
|
xf.rotateLocalY(angles[1] * M_PI / 180.f);
|
||||||
xf.rotateLocalZ(angles[2] * M_PI / 180.f);
|
xf.rotateLocalZ(angles[2] * M_PI / 180.f);
|
||||||
|
@ -612,6 +612,35 @@ void CElementGen::BuildParticleSystemBounds()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u32 CElementGen::GetSystemCount()
|
||||||
|
{
|
||||||
|
u32 ret = 0;
|
||||||
|
for (const CElementGen& child : x234_children)
|
||||||
|
ret += child.GetSystemCount();
|
||||||
|
|
||||||
|
for (const CElementGen& child : x248_children)
|
||||||
|
ret += child.GetSystemCount();
|
||||||
|
|
||||||
|
return (ret + (x208_activeParticleCount != 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 CElementGen::GetParticleCountAll()
|
||||||
|
{
|
||||||
|
return x20c;
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 CElementGen::GetParticleCountAllInternal()
|
||||||
|
{
|
||||||
|
u32 ret = x208_activeParticleCount;
|
||||||
|
for (const CElementGen& child : x234_children)
|
||||||
|
ret += child.GetParticleCountAll();
|
||||||
|
|
||||||
|
for (const CElementGen& child : x248_children)
|
||||||
|
ret += child.GetParticleCountAll();
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
void CElementGen::Render()
|
void CElementGen::Render()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -650,10 +679,12 @@ void CElementGen::SetModulationColor(const Zeus::CColor&)
|
||||||
|
|
||||||
const Zeus::CTransform& CElementGen::GetOrientation() const
|
const Zeus::CTransform& CElementGen::GetOrientation() const
|
||||||
{
|
{
|
||||||
|
return x178_orientation;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Zeus::CVector3f& CElementGen::GetTranslation() const
|
const Zeus::CVector3f& CElementGen::GetTranslation() const
|
||||||
{
|
{
|
||||||
|
return x7c_translation;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Zeus::CVector3f& CElementGen::GetGlobalScale() const
|
const Zeus::CVector3f& CElementGen::GetGlobalScale() const
|
||||||
|
|
|
@ -73,7 +73,7 @@ private:
|
||||||
int x70_MAXP = 0;
|
int x70_MAXP = 0;
|
||||||
u16 x74 = 99;
|
u16 x74 = 99;
|
||||||
float x78_generatorRate = 1.f;
|
float x78_generatorRate = 1.f;
|
||||||
Zeus::CVector3f x7c;
|
Zeus::CVector3f x7c_translation;
|
||||||
Zeus::CVector3f x88_globalTranslation;
|
Zeus::CVector3f x88_globalTranslation;
|
||||||
Zeus::CVector3f x94_POFS;
|
Zeus::CVector3f x94_POFS;
|
||||||
float xa0 = 1.f;
|
float xa0 = 1.f;
|
||||||
|
@ -86,7 +86,7 @@ private:
|
||||||
float x114 = 1.f;
|
float x114 = 1.f;
|
||||||
Zeus::CTransform x118 = Zeus::CTransform::Identity();
|
Zeus::CTransform x118 = Zeus::CTransform::Identity();
|
||||||
Zeus::CTransform x148 = Zeus::CTransform::Identity();
|
Zeus::CTransform x148 = Zeus::CTransform::Identity();
|
||||||
Zeus::CTransform x178 = Zeus::CTransform::Identity();
|
Zeus::CTransform x178_orientation = Zeus::CTransform::Identity();
|
||||||
Zeus::CTransform x1a8 = Zeus::CTransform::Identity();
|
Zeus::CTransform x1a8 = Zeus::CTransform::Identity();
|
||||||
Zeus::CTransform x1d8_globalOrientation = Zeus::CTransform::Identity();
|
Zeus::CTransform x1d8_globalOrientation = Zeus::CTransform::Identity();
|
||||||
u32 x208_activeParticleCount = 0;
|
u32 x208_activeParticleCount = 0;
|
||||||
|
@ -186,6 +186,9 @@ public:
|
||||||
void UpdateChildParticleSystems(double);
|
void UpdateChildParticleSystems(double);
|
||||||
void UpdateLightParameters();
|
void UpdateLightParameters();
|
||||||
void BuildParticleSystemBounds();
|
void BuildParticleSystemBounds();
|
||||||
|
u32 GetSystemCount();
|
||||||
|
u32 GetParticleCountAll();
|
||||||
|
u32 GetParticleCountAllInternal();
|
||||||
|
|
||||||
virtual void Update(double);
|
virtual void Update(double);
|
||||||
bool InternalUpdate(double);
|
bool InternalUpdate(double);
|
||||||
|
|
Loading…
Reference in New Issue