summaryrefslogtreecommitdiff
path: root/src/KingSystem/Physics/System/physUtil.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2026-10-18 17:55:05 +0100
committerGitHub <noreply@github.com>2026-10-18 17:55:05 +0100
commitd928a299f92ba01255dc68039d484d0b0ac9466e (patch)
treeb47660a2a6fddfa1932cd81f5ffd7673a00cce74 /src/KingSystem/Physics/System/physUtil.cpp
parente78c02499d0f108ae9c00158198289764c5980fe (diff)
parentef164cc8aac3a4d1729d3cbf722dec9b30a0c147 (diff)
Merge pull request #231 from leoetlino/stack/03f-definition-moves
Move functions across and inside TUs to better match link order
Diffstat (limited to 'src/KingSystem/Physics/System/physUtil.cpp')
-rw-r--r--src/KingSystem/Physics/System/physUtil.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/KingSystem/Physics/System/physUtil.cpp b/src/KingSystem/Physics/System/physUtil.cpp
new file mode 100644
index 00000000..d5ed8af5
--- /dev/null
+++ b/src/KingSystem/Physics/System/physUtil.cpp
@@ -0,0 +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<MotionType>(type);
+ ++type;
+ }
+ return MotionType::Unknown;
+}
+
+} // namespace ksys::phys