mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-11 08:27:43 +00:00
CModelBoo: Remove usages of const_cast
Many functions are modifying internals of CBooModel and const-casting is performed in order to work around functions being const when they really shouldn't be. This amends the function signatures in order to allow these functions to exist without const_cast, making code much nicer to read.
This commit is contained in:
@@ -73,8 +73,8 @@ void CMorphBallShadow::RenderIdBuffer(const zeus::CAABox& aabb, const CStateMana
|
||||
|
||||
CModelFlags flags(0, 0, 3, zeus::CColor{1.f, 1.f, 1.f, alphaVal / 255.f});
|
||||
flags.m_extendedShader = EExtendedShader::SolidColor; // Do solid color draw
|
||||
const CBooModel& model = *modelData->PickStaticModel(CModelData::EWhichModel::Normal);
|
||||
const_cast<CBooModel&>(model).VerifyCurrentShader(flags.x1_matSetIdx);
|
||||
CBooModel& model = *modelData->PickStaticModel(CModelData::EWhichModel::Normal);
|
||||
model.VerifyCurrentShader(flags.x1_matSetIdx);
|
||||
model.DrawNormal(flags, nullptr, nullptr);
|
||||
alphaVal += 4;
|
||||
}
|
||||
@@ -128,8 +128,8 @@ void CMorphBallShadow::Render(const CStateManager& mgr, float alpha) {
|
||||
CGraphics::SetModelMatrix(modelXf);
|
||||
|
||||
flags.x4_color.r() = alphaVal / 255.f;
|
||||
const CBooModel& model = *modelData->PickStaticModel(CModelData::EWhichModel::Normal);
|
||||
const_cast<CBooModel&>(model).VerifyCurrentShader(flags.x1_matSetIdx);
|
||||
CBooModel& model = *modelData->PickStaticModel(CModelData::EWhichModel::Normal);
|
||||
model.VerifyCurrentShader(flags.x1_matSetIdx);
|
||||
model.DrawNormal(flags, nullptr, nullptr);
|
||||
alphaVal += 4;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user