From 3bd84d8c4114ab0f785689be9db993f28a5fdfc0 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 18 Jun 2020 06:52:54 -0400 Subject: [PATCH] CScriptTemplate: Convert EAttachType into an enum class Prevents polluting the global namespace. --- src/Core/Resource/Script/CScriptTemplate.h | 7 +++---- src/Core/Scene/CScriptNode.cpp | 6 ++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Core/Resource/Script/CScriptTemplate.h b/src/Core/Resource/Script/CScriptTemplate.h index aac77e8d..7051a323 100644 --- a/src/Core/Resource/Script/CScriptTemplate.h +++ b/src/Core/Resource/Script/CScriptTemplate.h @@ -14,10 +14,9 @@ class CGameTemplate; class CScriptObject; typedef TString TIDString; -enum EAttachType -{ - eAttach, - eFollow +enum class EAttachType { + Attach, + Follow }; struct SAttachment diff --git a/src/Core/Scene/CScriptNode.cpp b/src/Core/Scene/CScriptNode.cpp index 37b3938c..36a8a0e2 100644 --- a/src/Core/Scene/CScriptNode.cpp +++ b/src/Core/Scene/CScriptNode.cpp @@ -739,11 +739,13 @@ CTransform4f CScriptNode::BoneTransform(uint32 BoneID, EAttachType AttachType, b CBone *pBone = pSkel->BoneByID(BoneID); ASSERT(pBone); - if (AttachType == eAttach) Out.Rotate(pBone->Rotation()); + if (AttachType == EAttachType::Attach) + Out.Rotate(pBone->Rotation()); Out.Translate(pBone->Position()); } - if (Absolute) Out = Transform() * Out; + if (Absolute) + Out = Transform() * Out; return Out; }