From 7286390beae272d1f8201e45ecf725d75241a84d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Fri, 16 Oct 2026 18:51:17 +0300 Subject: ksys/phys: rename physStaticCompoundUtil to physUtil Most of these helpers have nothing to do with StaticCompound: they look up material masks and collision filter info from shapes and collidables. physUtil also fits the link order, between physUserTag and physWorld, and it's what the function groups already call this block. (AI assisted using Claude Opus 5.5) --- src/KingSystem/Physics/System/physUtil.cpp | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/KingSystem/Physics/System/physUtil.cpp (limited to 'src/KingSystem/Physics/System/physUtil.cpp') diff --git a/src/KingSystem/Physics/System/physUtil.cpp b/src/KingSystem/Physics/System/physUtil.cpp new file mode 100644 index 00000000..95e685be --- /dev/null +++ b/src/KingSystem/Physics/System/physUtil.cpp @@ -0,0 +1 @@ +#include "KingSystem/Physics/System/physUtil.h" -- cgit v1.2.3 From ef164cc8aac3a4d1729d3cbf722dec9b30a0c147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Fri, 16 Oct 2026 00:18:41 +0100 Subject: ksys/phys: move motionTypeFromText to physUtil motionTypeFromText isn't part of physDefines: its "Keyframed" string (only used there) sits between the StaticCompound and PlayReport strings in .rodata, far from physDefines' enum text, and the function is linked right after the contact listener's inline virtuals, so it most likely starts a new TU at 0x7100fd069c. Nothing separates it from getMaterialMaskFromShape and the other helpers in physUtil, so it goes in the same file and its declaration moves to physUtil.h. That part is a guess: neither function has data that would show a boundary. (AI assisted using Claude Opus 5.5) --- src/KingSystem/Physics/System/physUtil.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/KingSystem/Physics/System/physUtil.cpp') diff --git a/src/KingSystem/Physics/System/physUtil.cpp b/src/KingSystem/Physics/System/physUtil.cpp index 95e685be..d5ed8af5 100644 --- a/src/KingSystem/Physics/System/physUtil.cpp +++ b/src/KingSystem/Physics/System/physUtil.cpp @@ -1 +1,25 @@ #include "KingSystem/Physics/System/physUtil.h" +#include "KingSystem/Physics/physDefines.h" + +namespace ksys::phys { + +MotionType motionTypeFromText(const sead::SafeString& text) { + static constexpr const char* texts[] = { + "Dynamic", + "Fixed", + "Keyframed", + }; + static_assert(int(MotionType::Dynamic) == 0); + static_assert(int(MotionType::Fixed) == 1); + static_assert(int(MotionType::Keyframed) == 2); + + int type = 0; + for (const char* type_text : texts) { + if (text == type_text) + return static_cast(type); + ++type; + } + return MotionType::Unknown; +} + +} // namespace ksys::phys -- cgit v1.2.3