From 579ae79291d9b2544fe87e56ca34f9da367a3c29 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 7 May 2020 14:08:29 -0400 Subject: [PATCH] General: Mark CMaterialFilter instances constexpr where applicable Allows omission of runtime overhead. --- Runtime/Character/CActorLights.cpp | 2 +- Runtime/World/CEnvFxManager.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Runtime/Character/CActorLights.cpp b/Runtime/Character/CActorLights.cpp index 7dc154911..70530aebf 100644 --- a/Runtime/Character/CActorLights.cpp +++ b/Runtime/Character/CActorLights.cpp @@ -302,7 +302,7 @@ bool CActorLights::BuildAreaLightList(const CStateManager& mgr, const CGameArea& x0_areaLights.clear(); /* Filter for performing final light visibility test */ - CMaterialFilter filter = CMaterialFilter::MakeIncludeExclude( + constexpr auto filter = CMaterialFilter::MakeIncludeExclude( CMaterialList(EMaterialTypes::Solid), CMaterialList(EMaterialTypes::Projectile, EMaterialTypes::ProjectilePassthrough, EMaterialTypes::SeeThrough)); u32 mostSigLightIdx = 0; diff --git a/Runtime/World/CEnvFxManager.cpp b/Runtime/World/CEnvFxManager.cpp index a9bd5bc62..9e6b9bba1 100644 --- a/Runtime/World/CEnvFxManager.cpp +++ b/Runtime/World/CEnvFxManager.cpp @@ -206,7 +206,7 @@ void CEnvFxManager::UpdateBlockedGrids(CStateManager& mgr, EEnvFxType type, cons if (type == EEnvFxType::UnderwaterFlake) { grid.x14_block = std::make_pair(true, float(-FLT_MAX)); } else { - CMaterialFilter filter = + constexpr auto filter = CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid, EMaterialTypes::Trigger}, {EMaterialTypes::ProjectilePassthrough, EMaterialTypes::SeeThrough}); zeus::CVector3f pos = xf * zeus::CVector3f((grid.x4_position + grid.xc_extent * 0).toVec2f() / 256.f) +