From 519a07b7e7919936f901c639831b11b7af385d89 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Wed, 20 Apr 2016 09:23:00 -1000 Subject: [PATCH] Needless copy construction avoidance --- Runtime/CStateManager.cpp | 2 +- Runtime/World/ScriptLoader.cpp | 4 ++-- Runtime/World/ScriptObjectSupport.hpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp index dd767f657..635bf32b5 100644 --- a/Runtime/CStateManager.cpp +++ b/Runtime/CStateManager.cpp @@ -38,7 +38,7 @@ CStateManager::CStateManager(const std::weak_ptr&, { x904_loaderFuncs[int(EScriptObjectType::Actor)] = ScriptLoader::LoadActor; x904_loaderFuncs[int(EScriptObjectType::Waypoint)] = ScriptLoader::LoadWaypoint; - x904_loaderFuncs[int(EScriptObjectType::DoorArea)] = ScriptLoader::LoadDoor; + x904_loaderFuncs[int(EScriptObjectType::Door)] = ScriptLoader::LoadDoor; x904_loaderFuncs[int(EScriptObjectType::Trigger)] = ScriptLoader::LoadTrigger; x904_loaderFuncs[int(EScriptObjectType::Timer)] = ScriptLoader::LoadTimer; x904_loaderFuncs[int(EScriptObjectType::Counter)] = ScriptLoader::LoadCounter; diff --git a/Runtime/World/ScriptLoader.cpp b/Runtime/World/ScriptLoader.cpp index 032f0d2fa..e543eafeb 100644 --- a/Runtime/World/ScriptLoader.cpp +++ b/Runtime/World/ScriptLoader.cpp @@ -96,7 +96,7 @@ static zeus::CAABox GetCollisionBox(CStateManager& stateMgr, TAreaId id, const zeus::CVector3f& extent, const zeus::CVector3f& offset) { zeus::CAABox box(-extent * 0.5f + offset, extent * 0.5f + offset); - zeus::CTransform rot = stateMgr.GetWorld()->GetGameAreas()[id]->GetTransform().getRotation(); + const zeus::CTransform& rot = stateMgr.GetWorld()->GetGameAreas()[id]->GetTransform().getRotation(); return box.getTransformedAABox(rot); } @@ -455,7 +455,7 @@ CEntity* ScriptLoader::LoadTrigger(CStateManager& mgr, CInputStream& in, zeus::CAABox box(-extent * 0.5f, extent * 0.5f); - zeus::CTransform areaXf = mgr.GetWorld()->GetGameAreas()[info.GetAreaId()]->GetTransform(); + const zeus::CTransform& areaXf = mgr.GetWorld()->GetGameAreas()[info.GetAreaId()]->GetTransform(); zeus::CVector3f orientedForce = areaXf.m_basis * forceVec; return new CScriptTrigger(mgr.AllocateUniqueId(), *name, info, position, box, dInfo, diff --git a/Runtime/World/ScriptObjectSupport.hpp b/Runtime/World/ScriptObjectSupport.hpp index 8c47a2534..40b4f8731 100644 --- a/Runtime/World/ScriptObjectSupport.hpp +++ b/Runtime/World/ScriptObjectSupport.hpp @@ -8,7 +8,7 @@ enum class EScriptObjectType { Actor = 0x00, Waypoint = 0x02, - DoorArea = 0x03, + Door = 0x03, Trigger = 0x04, Timer = 0x05, Counter = 0x06,