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

CActor: Make AddToRenderer() non-const

This member function alters instance state in a few implementations, so
it shouldn't be made const.

The state manager parameter also shouldn't be const. Retrieved data
from the post constructed instance is further modified in some
implementations. This removes the constness on this parameter in order
to fix more const_cast usages in a follow-up change.
This commit is contained in:
Lioncash
2020-04-05 07:54:02 -04:00
parent 19cfb92d5d
commit cabbfcc320
79 changed files with 168 additions and 131 deletions

View File

@@ -143,21 +143,28 @@ CScriptDebris::CScriptDebris(TUniqueId uid, std::string_view name, const CEntity
void CScriptDebris::Accept(IVisitor& visitor) { visitor.Visit(this); }
void CScriptDebris::AddToRenderer(const zeus::CFrustum& frustum, const CStateManager& mgr) const {
if (x2d4_particleGens[0])
if (x270_curTime < x274_duration || x281_26_deferDeleteTillParticle1Done)
void CScriptDebris::AddToRenderer(const zeus::CFrustum& frustum, CStateManager& mgr) {
if (x2d4_particleGens[0]) {
if (x270_curTime < x274_duration || x281_26_deferDeleteTillParticle1Done) {
g_Renderer->AddParticleGen(*x2d4_particleGens[0]);
}
}
if (x2d4_particleGens[1])
if (x270_curTime < x274_duration || x281_28_deferDeleteTillParticle2Done)
if (x2d4_particleGens[1]) {
if (x270_curTime < x274_duration || x281_28_deferDeleteTillParticle2Done) {
g_Renderer->AddParticleGen(*x2d4_particleGens[1]);
}
}
if (x281_29_particle3Active)
if (x281_29_particle3Active) {
g_Renderer->AddParticleGen(*x2d4_particleGens[2]);
}
if (x64_modelData && !x64_modelData->IsNull())
if (x270_curTime < x274_duration)
if (x64_modelData && !x64_modelData->IsNull()) {
if (x270_curTime < x274_duration) {
CActor::AddToRenderer(frustum, mgr);
}
}
}
static zeus::CVector3f debris_cone(CStateManager& mgr, float coneAng, float minMag, float maxMag) {