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); }