CScriptPlatform: Make platform material list constexpr

Same behavior, no runtime overhead.
This commit is contained in:
Lioncash 2020-04-12 14:11:02 -04:00
parent 1d112134cf
commit ff847eaf41
1 changed files with 3 additions and 9 deletions

View File

@ -15,14 +15,8 @@
namespace urde { namespace urde {
static CMaterialList MakePlatformMaterialList() { constexpr auto skPlatformMaterialList =
CMaterialList ret; CMaterialList{EMaterialTypes::Solid, EMaterialTypes::Immovable, EMaterialTypes::Platform, EMaterialTypes::Occluder};
ret.Add(EMaterialTypes::Solid);
ret.Add(EMaterialTypes::Immovable);
ret.Add(EMaterialTypes::Platform);
ret.Add(EMaterialTypes::Occluder);
return ret;
}
CScriptPlatform::CScriptPlatform( CScriptPlatform::CScriptPlatform(
TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, CModelData&& mData, TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, CModelData&& mData,
@ -30,7 +24,7 @@ CScriptPlatform::CScriptPlatform(
bool active, const CHealthInfo& hInfo, const CDamageVulnerability& dVuln, bool active, const CHealthInfo& hInfo, const CDamageVulnerability& dVuln,
const std::optional<TLockedToken<CCollidableOBBTreeGroupContainer>>& dcln, bool rainSplashes, const std::optional<TLockedToken<CCollidableOBBTreeGroupContainer>>& dcln, bool rainSplashes,
u32 maxRainSplashes, u32 rainGenRate) u32 maxRainSplashes, u32 rainGenRate)
: CPhysicsActor(uid, active, name, info, xf, std::move(mData), MakePlatformMaterialList(), aabb, SMoverData(15000.f), : CPhysicsActor(uid, active, name, info, xf, std::move(mData), skPlatformMaterialList, aabb, SMoverData(15000.f),
actParms, 0.3f, 0.1f) actParms, 0.3f, 0.1f)
, x25c_currentSpeed(speed) , x25c_currentSpeed(speed)
, x28c_initialHealth(hInfo) , x28c_initialHealth(hInfo)