mirror of https://github.com/zeldaret/botw.git
Fix matching issue in ksys::phys::motionTypeFromText
This commit is contained in:
parent
0c3ee0dd84
commit
fc8d4b5c68
|
|
@ -84347,7 +84347,7 @@ Address,Quality,Size,Name
|
|||
0x0000007100fd0690,U,000004,nullsub_4261
|
||||
0x0000007100fd0694,U,000004,j__ZdlPv_1015
|
||||
0x0000007100fd0698,U,000004,j__ZdlPv_1016
|
||||
0x0000007100fd069c,m,000372,_ZN4ksys4phys18motionTypeFromTextERKN4sead14SafeStringBaseIcEE
|
||||
0x0000007100fd069c,O,000372,_ZN4ksys4phys18motionTypeFromTextERKN4sead14SafeStringBaseIcEE
|
||||
0x0000007100fd0810,U,000092,
|
||||
0x0000007100fd086c,U,000356,
|
||||
0x0000007100fd09d0,U,000076,
|
||||
|
|
|
|||
|
Can't render this file because it is too large.
|
|
|
@ -84,17 +84,23 @@ WallCode wallCodeFromText(const sead::SafeString& text) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
// duplicated branches?
|
||||
#ifdef NON_MATCHING
|
||||
MotionType motionTypeFromText(const sead::SafeString& text) {
|
||||
if (text == "Dynamic")
|
||||
return MotionType::Dynamic;
|
||||
if (text == "Fixed")
|
||||
return MotionType::Fixed;
|
||||
if (text == "Keyframed")
|
||||
return MotionType::Keyframed;
|
||||
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;
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace ksys::phys
|
||||
|
|
|
|||
Loading…
Reference in New Issue