From a0652cea17d85309d60e3a5367711ab9c8b47769 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Wed, 2 Nov 2022 23:54:47 -0700 Subject: [PATCH] Match and link CMetroidModelInstance Former-commit-id: 1f7d9fe70c8001da28d1c97a7bc9a28df53ff00d --- configure.py | 2 +- obj_files.mk | 2 +- src/WorldFormat/CMetroidModelInstance.cpp | 10 ++++------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/configure.py b/configure.py index 47af3ef9..dfa90d51 100755 --- a/configure.py +++ b/configure.py @@ -401,7 +401,7 @@ LIBS = [ "objects": [ "WorldFormat/CAreaOctTree_Tests", ["WorldFormat/CCollisionSurface", True], - ["WorldFormat/CMetroidModelInstance", False], + ["WorldFormat/CMetroidModelInstance", True], "WorldFormat/CAreaBspTree", "WorldFormat/CAreaOctTree", ["WorldFormat/CMetroidAreaCollider", False], diff --git a/obj_files.mk b/obj_files.mk index a91830d1..a2927ebf 100644 --- a/obj_files.mk +++ b/obj_files.mk @@ -360,7 +360,7 @@ METROIDPRIME :=\ WORLDFORMAT :=\ $(BUILD_DIR)/asm/WorldFormat/CAreaOctTree_Tests.o\ $(BUILD_DIR)/src/WorldFormat/CCollisionSurface.o\ - $(BUILD_DIR)/asm/WorldFormat/CMetroidModelInstance.o\ + $(BUILD_DIR)/src/WorldFormat/CMetroidModelInstance.o\ $(BUILD_DIR)/asm/WorldFormat/CAreaBspTree.o\ $(BUILD_DIR)/asm/WorldFormat/CAreaOctTree.o\ $(BUILD_DIR)/asm/WorldFormat/CMetroidAreaCollider.o\ diff --git a/src/WorldFormat/CMetroidModelInstance.cpp b/src/WorldFormat/CMetroidModelInstance.cpp index 3b30d03b..a7d6dc7e 100644 --- a/src/WorldFormat/CMetroidModelInstance.cpp +++ b/src/WorldFormat/CMetroidModelInstance.cpp @@ -9,12 +9,10 @@ static const CTransform4f& TransformFromData(const void* ptr) { static CAABox BoundingBoxFromData(const void* ptr) { float out[6]; const float* tmp = reinterpret_cast< const float* >(ptr); - out[0] = CBasics::SwapBytes(tmp[0]); - out[1] = CBasics::SwapBytes(tmp[1]); - out[2] = CBasics::SwapBytes(tmp[2]); - out[3] = CBasics::SwapBytes(tmp[3]); - out[4] = CBasics::SwapBytes(tmp[4]); - out[5] = CBasics::SwapBytes(tmp[5]); + for (int i = 0; i < 6; ++i) { + out[i] = CBasics::SwapBytes(tmp[i]); + } + return *reinterpret_cast< const CAABox* >(out); }