mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 07:07:42 +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:
@@ -1352,12 +1352,14 @@ int CBooRenderer::DrawOverlappingWorldModelIDs(int alphaVal, const std::vector<u
|
||||
return alphaVal;
|
||||
|
||||
flags.x4_color.a() = alphaVal / 255.f;
|
||||
const CBooModel& model = *item.x10_models[wordModel + j];
|
||||
const_cast<CBooModel&>(model).UpdateUniformData(flags, nullptr, nullptr, 3);
|
||||
const_cast<CBooModel&>(model).VerifyCurrentShader(0);
|
||||
for (const CBooSurface* surf = model.x38_firstUnsortedSurface; surf; surf = surf->m_next)
|
||||
if (surf->GetBounds().intersects(aabb))
|
||||
CBooModel& model = *item.x10_models[wordModel + j];
|
||||
model.UpdateUniformData(flags, nullptr, nullptr, 3);
|
||||
model.VerifyCurrentShader(0);
|
||||
for (const CBooSurface* surf = model.x38_firstUnsortedSurface; surf; surf = surf->m_next) {
|
||||
if (surf->GetBounds().intersects(aabb)) {
|
||||
model.DrawSurface(*surf, flags);
|
||||
}
|
||||
}
|
||||
alphaVal += 4;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user