mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 07:07:42 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user