From 23bae06742739bd980059f440c5f7c24d56a116a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 12 Apr 2020 11:18:55 -0400 Subject: [PATCH] CNewIntroBoss: Make use of std::array where applicable Same behavior but without implicit array to pointer decay. --- Runtime/MP1/World/CNewIntroBoss.cpp | 41 ++++++++++++++++------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/Runtime/MP1/World/CNewIntroBoss.cpp b/Runtime/MP1/World/CNewIntroBoss.cpp index 7678f004c..d875b6801 100644 --- a/Runtime/MP1/World/CNewIntroBoss.cpp +++ b/Runtime/MP1/World/CNewIntroBoss.cpp @@ -1,5 +1,7 @@ #include "Runtime/MP1/World/CNewIntroBoss.hpp" +#include + #include "Runtime/CStateManager.hpp" #include "Runtime/Character/CCharLayoutInfo.hpp" #include "Runtime/Collision/CCollisionActor.hpp" @@ -13,6 +15,27 @@ namespace urde::MP1 { +constexpr std::array skSphereJoints{{ + {"Head_1", 1.5f}, + {"Tail_1", 1.5f}, +}}; + +constexpr std::array skOBBJoints{{ + {"Pelvis", "Spine_3", {4.f, 1.f, 4.f}}, + {"Spine_3", "Tail_1", {2.f, 1.f, 2.f}}, + {"Tail_1", "Tail_2", {1.f, 1.f, 1.f}}, + {"Tail_2", "Tail_3", {1.f, 1.f, 1.f}}, + {"Tail_3", "Tail_4", {1.f, 1.f, 1.f}}, + {"R_shoulder_front", "R_elbow_front", {.5f, .5f, .5f}}, + {"R_elbow_front", "R_wrist_front", {.5f, .5f, .5f}}, + {"L_shoulder_front", "L_elbow_front", {.5f, .5f, .5f}}, + {"L_elbow_front", "L_wrist_front", {.5f, .5f, .5f}}, + {"R_shoulder_back", "R_elbow_back", {.5f, .5f, .5f}}, + {"R_elbow_back", "R_wrist_back", {.5f, .5f, .5f}}, + {"L_shoulder_back", "L_elbow_back", {.5f, .5f, .5f}}, + {"L_elbow_back", "L_wrist_back", {.5f, .5f, .5f}}, +}}; + CNewIntroBoss::CNewIntroBoss(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo, const CActorParameters& actParms, float minTurnAngle, CAssetId projectile, const CDamageInfo& dInfo, @@ -35,24 +58,6 @@ CNewIntroBoss::CNewIntroBoss(TUniqueId uid, std::string_view name, const CEntity void CNewIntroBoss::Accept(IVisitor& visitor) { visitor.Visit(this); } -static const SSphereJointInfo skSphereJoints[] = {{"Head_1", 1.5f}, {"Tail_1", 1.5f}}; - -static const SOBBJointInfo skOBBJoints[] = { - {"Pelvis", "Spine_3", {4.f, 1.f, 4.f}}, - {"Spine_3", "Tail_1", {2.f, 1.f, 2.f}}, - {"Tail_1", "Tail_2", {1.f, 1.f, 1.f}}, - {"Tail_2", "Tail_3", {1.f, 1.f, 1.f}}, - {"Tail_3", "Tail_4", {1.f, 1.f, 1.f}}, - {"R_shoulder_front", "R_elbow_front", {.5f, .5f, .5f}}, - {"R_elbow_front", "R_wrist_front", {.5f, .5f, .5f}}, - {"L_shoulder_front", "L_elbow_front", {.5f, .5f, .5f}}, - {"L_elbow_front", "L_wrist_front", {.5f, .5f, .5f}}, - {"R_shoulder_back", "R_elbow_back", {.5f, .5f, .5f}}, - {"R_elbow_back", "R_wrist_back", {.5f, .5f, .5f}}, - {"L_shoulder_back", "L_elbow_back", {.5f, .5f, .5f}}, - {"L_elbow_back", "L_wrist_back", {.5f, .5f, .5f}}, -}; - void CNewIntroBoss::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) { if (msg == EScriptObjectMessage::Registered) { RemoveMaterial(EMaterialTypes::Solid, mgr);