mirror of https://github.com/AxioDL/metaforce.git
General: Pass std::nullopt to CAnimData::Render instead of {}
Prevents some implementations (libstdc++ and libc++) from completely zeroing out the underlying buffer and instead sets a single byte flag. Eliminates unnecessary memsets.
This commit is contained in:
parent
786634e181
commit
f77fb2089b
|
@ -354,7 +354,7 @@ void CModelData::Render(EWhichModel which, const zeus::CTransform& xf, const CAc
|
|||
model.GetModelInst()->ActivateLights(useLights);
|
||||
}
|
||||
|
||||
x10_animData->Render(model, drawFlags, {}, nullptr);
|
||||
x10_animData->Render(model, drawFlags, std::nullopt, nullptr);
|
||||
} else {
|
||||
const auto& model = PickStaticModel(which);
|
||||
if (lights) {
|
||||
|
@ -388,18 +388,18 @@ void CModelData::InvSuitDraw(EWhichModel which, const zeus::CTransform& xf, cons
|
|||
/* Z-prime */
|
||||
flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly;
|
||||
flags.x4_color = zeus::skWhite;
|
||||
x10_animData->Render(model, flags, {}, nullptr);
|
||||
x10_animData->Render(model, flags, std::nullopt, nullptr);
|
||||
|
||||
/* Normal Blended */
|
||||
lights->ActivateLights(*model.GetModelInst());
|
||||
flags.m_extendedShader = EExtendedShader::ForcedAlpha;
|
||||
flags.x4_color = alphaColor;
|
||||
x10_animData->Render(model, flags, {}, nullptr);
|
||||
x10_animData->Render(model, flags, std::nullopt, nullptr);
|
||||
|
||||
/* Selection Additive */
|
||||
flags.m_extendedShader = EExtendedShader::ForcedAdditive;
|
||||
flags.x4_color = additiveColor;
|
||||
x10_animData->Render(model, flags, {}, nullptr);
|
||||
x10_animData->Render(model, flags, std::nullopt, nullptr);
|
||||
} else {
|
||||
CBooModel& model = *PickStaticModel(which);
|
||||
model.DisableAllLights();
|
||||
|
@ -441,7 +441,7 @@ void CModelData::DisintegrateDraw(EWhichModel which, const zeus::CTransform& xf,
|
|||
|
||||
if (x10_animData) {
|
||||
CSkinnedModel& sModel = PickAnimatedModel(which);
|
||||
x10_animData->Render(sModel, flags, {}, nullptr);
|
||||
x10_animData->Render(sModel, flags, std::nullopt, nullptr);
|
||||
} else {
|
||||
CBooModel& model = *PickStaticModel(which);
|
||||
model.Draw(flags, nullptr, nullptr);
|
||||
|
|
|
@ -480,7 +480,7 @@ void CGrappleArm::RenderXRayModel(const CStateManager& mgr, const zeus::CTransfo
|
|||
// g_Renderer->SetAmbientColor(zeus::skWhite);
|
||||
CSkinnedModel& model = const_cast<CSkinnedModel&>(*x50_grappleArmSkeletonModel->GetAnimationData()->GetModelData());
|
||||
model.GetModelInst()->ActivateLights({CLight::BuildLocalAmbient({}, zeus::skWhite)});
|
||||
x0_grappleArmModel->GetAnimationData()->Render(model, flags, {}, nullptr);
|
||||
x0_grappleArmModel->GetAnimationData()->Render(model, flags, std::nullopt, nullptr);
|
||||
// g_Renderer->SetAmbientColor(zeus::skWhite);
|
||||
// CGraphics::DisableAllLights();
|
||||
}
|
||||
|
|
|
@ -512,7 +512,7 @@ void CGunWeapon::DrawHologram(const CStateManager& mgr, const zeus::CTransform&
|
|||
// g_Renderer->SetAmbientColor(zeus::skWhite);
|
||||
CSkinnedModel& model = const_cast<CSkinnedModel&>(*x60_holoModelData->GetAnimationData()->GetModelData());
|
||||
model.GetModelInst()->ActivateLights({CLight::BuildLocalAmbient({}, zeus::skWhite)});
|
||||
const_cast<CGunWeapon*>(this)->x10_solidModelData->GetAnimationData()->Render(model, flags, {}, nullptr);
|
||||
const_cast<CGunWeapon*>(this)->x10_solidModelData->GetAnimationData()->Render(model, flags, std::nullopt, nullptr);
|
||||
// g_Renderer->SetAmbientColor(zeus::skWhite);
|
||||
// CGraphics::DisableAllLights();
|
||||
}
|
||||
|
|
|
@ -518,7 +518,7 @@ void CFishCloud::RenderBoid(int idx, const CBoid& boid, u32& drawMask,
|
|||
CModelFlags thermFlags(0, 0, 3, zeus::skWhite);
|
||||
mData.RenderThermal(zeus::skWhite, zeus::CColor(0.f, 0.25f), thermFlags);
|
||||
} else {
|
||||
mData.GetAnimationData()->Render(model, flags, {}, nullptr);
|
||||
mData.GetAnimationData()->Render(model, flags, std::nullopt, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1063,7 +1063,7 @@ void CWallCrawlerSwarm::RenderBoid(const CBoid* boid, u32& drawMask, bool therma
|
|||
CGraphics::SetModelMatrix(boid->GetTransform());
|
||||
if (boid->x48_timeToDie > 0.f && !thermalHot) {
|
||||
const CModelFlags useFlags(0, 0, 3, zeus::skWhite);
|
||||
mData.GetAnimationData()->Render(model, useFlags, {}, nullptr);
|
||||
mData.GetAnimationData()->Render(model, useFlags, std::nullopt, nullptr);
|
||||
if (auto iceModel = mData.GetAnimationData()->GetIceModel()) {
|
||||
if (!iceModel->GetModelInst()->TryLockTextures()) {
|
||||
return;
|
||||
|
@ -1072,13 +1072,13 @@ void CWallCrawlerSwarm::RenderBoid(const CBoid* boid, u32& drawMask, bool therma
|
|||
const float alpha = 1.f - boid->x48_timeToDie;
|
||||
const zeus::CColor color(1.f, alpha > 0.f ? boid->x48_timeToDie : 1.f);
|
||||
const CModelFlags iceFlags(5, 0, 3, color);
|
||||
mData.GetAnimationData()->Render(*iceModel, iceFlags, {}, nullptr);
|
||||
mData.GetAnimationData()->Render(*iceModel, iceFlags, std::nullopt, nullptr);
|
||||
}
|
||||
} else if (thermalHot) {
|
||||
const CModelFlags thermFlags(5, 0, 3, zeus::skWhite);
|
||||
mData.RenderThermal(zeus::skWhite, zeus::CColor(0.f, 0.25f), thermFlags);
|
||||
} else {
|
||||
mData.GetAnimationData()->Render(model, flags, {}, nullptr);
|
||||
mData.GetAnimationData()->Render(model, flags, std::nullopt, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue