diff options
| author | Léo Lam <leo@leolam.fr> | 2026-10-16 00:18:41 +0100 |
|---|---|---|
| committer | Léo Lam <leo@leolam.fr> | 2026-10-16 00:18:41 +0100 |
| commit | ef164cc8aac3a4d1729d3cbf722dec9b30a0c147 (patch) | |
| tree | b47660a2a6fddfa1932cd81f5ffd7673a00cce74 /src/KingSystem/Physics/physDefines.cpp | |
| parent | 7286390beae272d1f8201e45ecf725d75241a84d (diff) | |
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)
Diffstat (limited to 'src/KingSystem/Physics/physDefines.cpp')
| -rw-r--r-- | src/KingSystem/Physics/physDefines.cpp | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/KingSystem/Physics/physDefines.cpp b/src/KingSystem/Physics/physDefines.cpp index 079b5c72..06938e95 100644 --- a/src/KingSystem/Physics/physDefines.cpp +++ b/src/KingSystem/Physics/physDefines.cpp @@ -84,23 +84,4 @@ WallCode wallCodeFromText(const sead::SafeString& text) { return 0; } -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<MotionType>(type); - ++type; - } - return MotionType::Unknown; -} - } // namespace ksys::phys |
