CElementGen: Make GetSystemCount() a const member function

This doesn't modify internal member state, so this can be made a const
member function.
This commit is contained in:
Lioncash 2020-03-09 13:03:40 -04:00
parent a8486cf479
commit af2a82b5a7
2 changed files with 7 additions and 6 deletions

View File

@ -786,16 +786,17 @@ void CElementGen::BuildParticleSystemBounds() {
x2f0_systemBounds.accumulateBounds(aabb);
}
u32 CElementGen::GetSystemCount() {
u32 CElementGen::GetSystemCount() const {
u32 ret = 0;
for (const std::unique_ptr<CParticleGen>& child : x290_activePartChildren) {
if (child->Get4CharId() == FOURCC('PART'))
ret += static_cast<CElementGen&>(*child).GetSystemCount();
else
if (child->Get4CharId() == FOURCC('PART')) {
ret += static_cast<const CElementGen&>(*child).GetSystemCount();
} else {
ret += 1;
}
}
return (ret + (x25c_activeParticleCount != 0));
return ret + (x25c_activeParticleCount != 0);
}
void CElementGen::Render(const CActorLights* actorLights) {

View File

@ -180,7 +180,7 @@ public:
void UpdateLightParameters();
void BuildParticleSystemBounds();
u32 GetEmitterTime() const { return x74_curFrame; }
u32 GetSystemCount();
u32 GetSystemCount() const;
u32 GetCumulativeParticleCount() const { return x260_cumulativeParticles; }
u32 GetParticleCountAllInternal() const;
u32 GetParticleCountAll() const { return x264_recursiveParticleCount; }