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

CModel: Mark CModelFlag instances as constexpr where applicable

Allows more runtime initializes to potentially be elided.
This commit is contained in:
Lioncash
2020-04-11 16:53:59 -04:00
parent 7055b6983f
commit 75c07677ed
11 changed files with 20 additions and 20 deletions

View File

@@ -1062,7 +1062,7 @@ void CWallCrawlerSwarm::RenderBoid(const CBoid* boid, u32& drawMask, bool therma
model.GetModelInst()->SetAmbientColor(boid->x40_ambientLighting);
CGraphics::SetModelMatrix(boid->GetTransform());
if (boid->x48_timeToDie > 0.f && !thermalHot) {
const CModelFlags useFlags(0, 0, 3, zeus::skWhite);
constexpr CModelFlags useFlags(0, 0, 3, zeus::skWhite);
mData.GetAnimationData()->Render(model, useFlags, std::nullopt, nullptr);
if (auto iceModel = mData.GetAnimationData()->GetIceModel()) {
if (!iceModel->GetModelInst()->TryLockTextures()) {
@@ -1075,7 +1075,7 @@ void CWallCrawlerSwarm::RenderBoid(const CBoid* boid, u32& drawMask, bool therma
mData.GetAnimationData()->Render(*iceModel, iceFlags, std::nullopt, nullptr);
}
} else if (thermalHot) {
const CModelFlags thermFlags(5, 0, 3, zeus::skWhite);
constexpr CModelFlags thermFlags(5, 0, 3, zeus::skWhite);
mData.RenderThermal(zeus::skWhite, zeus::CColor(0.f, 0.25f), thermFlags);
} else {
mData.GetAnimationData()->Render(model, flags, std::nullopt, nullptr);