From e9024ed406b8fb874f7ae45d4caf111e9787d889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Fri, 24 Dec 2021 23:01:58 +0100 Subject: [PATCH] ksys/phys: Move orGroundHitTypeMask to the correct TU --- data/uking_functions.csv | 4 ++-- src/KingSystem/Physics/RigidBody/physRigidBodyParam.cpp | 7 +------ src/KingSystem/Physics/System/physEntityGroupFilter.cpp | 9 +++++++++ src/KingSystem/Physics/System/physEntityGroupFilter.h | 3 +++ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/data/uking_functions.csv b/data/uking_functions.csv index 5d65ff91..f606e1aa 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -83790,8 +83790,8 @@ Address,Quality,Size,Name 0x0000007100fb5dc8,U,000028, 0x0000007100fb5de4,O,000192,_ZN4ksys4phys17EntityGroupFilter30doInitSystemGroupHandlerLists_EPN4sead4HeapE 0x0000007100fb5ea4,O,000016,_ZN4ksys4phys17EntityGroupFilter16getFreeListIndexEPKNS0_18SystemGroupHandlerE -0x0000007100fb5eb4,U,000036, -0x0000007100fb5ed8,O,000060,_ZN4ksys4physL19orGroundHitTypeMaskEjRKN4sead14SafeStringBaseIcEE +0x0000007100fb5eb4,O,000036,_ZN4ksys4phys19orGroundHitTypeMaskEjNS0_9GroundHitE +0x0000007100fb5ed8,O,000060,_ZN4ksys4phys19orGroundHitTypeMaskEjRKN4sead14SafeStringBaseIcEE 0x0000007100fb5f14,U,000032, 0x0000007100fb5f34,U,000068, 0x0000007100fb5f78,U,000036, diff --git a/src/KingSystem/Physics/RigidBody/physRigidBodyParam.cpp b/src/KingSystem/Physics/RigidBody/physRigidBodyParam.cpp index d506436a..b40c7149 100644 --- a/src/KingSystem/Physics/RigidBody/physRigidBodyParam.cpp +++ b/src/KingSystem/Physics/RigidBody/physRigidBodyParam.cpp @@ -1,4 +1,5 @@ #include "KingSystem/Physics/RigidBody/physRigidBodyParam.h" +#include "KingSystem/Physics/System/physEntityGroupFilter.h" #include "KingSystem/Physics/System/physShapeParam.h" namespace ksys::phys { @@ -77,12 +78,6 @@ MotionType RigidBodyParam::getMotionType() const { return motionTypeFromText(*info.motion_type); } -// TODO: move this to another translation unit (figure out where this belongs) -[[gnu::noinline]] static u32 orGroundHitTypeMask(u32 mask, const sead::SafeString& type) { - mask |= (0x100 << groundHitFromText(type)) & 0xffff00; - return mask; -} - namespace { constexpr const char* navmesh_types[] = { "NOT_USE", diff --git a/src/KingSystem/Physics/System/physEntityGroupFilter.cpp b/src/KingSystem/Physics/System/physEntityGroupFilter.cpp index 52618d7a..3fa7d06b 100644 --- a/src/KingSystem/Physics/System/physEntityGroupFilter.cpp +++ b/src/KingSystem/Physics/System/physEntityGroupFilter.cpp @@ -40,4 +40,13 @@ int EntityGroupFilter::getFreeListIndex(const SystemGroupHandler* handler) { return handler->getIndex() < NumEntityHandlersInList0; } +u32 orGroundHitTypeMask(u32 mask, GroundHit type) { + mask |= (0x100 << type) & 0xffff00; + return mask; +} + +u32 orGroundHitTypeMask(u32 mask, const sead::SafeString& type) { + return orGroundHitTypeMask(mask, groundHitFromText(type)); +} + } // namespace ksys::phys diff --git a/src/KingSystem/Physics/System/physEntityGroupFilter.h b/src/KingSystem/Physics/System/physEntityGroupFilter.h index ca83b49d..f0153429 100644 --- a/src/KingSystem/Physics/System/physEntityGroupFilter.h +++ b/src/KingSystem/Physics/System/physEntityGroupFilter.h @@ -60,4 +60,7 @@ private: sead::SafeArray mMasks; }; +u32 orGroundHitTypeMask(u32 mask, GroundHit type); +u32 orGroundHitTypeMask(u32 mask, const sead::SafeString& type); + } // namespace ksys::phys