ksys/gdt: Fix Manager setter wrappers for string types

This commit is contained in:
Léo Lam 2020-11-09 16:45:29 +01:00
parent 607389e86e
commit aee089b720
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
3 changed files with 26 additions and 39 deletions

View File

@ -52422,7 +52422,7 @@
0x00000071008e44fc,sub_71008E44FC,180,
0x00000071008e45b0,getFlag_100enemy_SwordPower_StartTmp,172,
0x00000071008e4770,getFlag_ActorName_SeakSensor_Slot0,152,
0x00000071008e4808,setFlag_ActorName_SeakSensor_Slot0,212,
0x00000071008e4808,setFlag_ActorName_SeakSensor_Slot0,212,_ZN4ksys3gdt34setFlag_ActorName_SeakSensor_Slot0ERKN4sead14SafeStringBaseIcEEb
0x00000071008e48dc,resetFlagMaybe_ActorName_SeakSensor_Slot0,24,
0x00000071008e48f4,sub_71008E48F4,160,
0x00000071008e4994,setFlag_AlbumPictureActorName,224,

Can't render this file because it is too large.

View File

@ -148,29 +148,16 @@ inline void getVec4f(FlagHandle handle, sead::Vector4f* value, s32 idx, bool deb
mgr->NAME(value, handle, debug, sub_idx); \
}
#define GDT_SET_FLAG_STR_(NAME, T) \
inline void NAME(T value, FlagHandle handle, bool debug = false) { \
auto* mgr = Manager::instance(); \
if (mgr) \
mgr->NAME(value.cstr(), handle, debug); \
} \
inline void NAME(T value, FlagHandle handle, s32 sub_idx, bool debug = false) { \
auto* mgr = Manager::instance(); \
if (mgr) \
mgr->NAME(value.cstr(), handle, debug, sub_idx); \
}
GDT_SET_FLAG_(setBool, bool)
GDT_SET_FLAG_(setS32, s32)
GDT_SET_FLAG_(setF32, f32)
GDT_SET_FLAG_STR_(setStr, const sead::SafeString&)
GDT_SET_FLAG_STR_(setStr64, const sead::SafeString&)
GDT_SET_FLAG_STR_(setStr256, const sead::SafeString&)
GDT_SET_FLAG_(setStr, const sead::SafeString&)
GDT_SET_FLAG_(setStr64, const sead::SafeString&)
GDT_SET_FLAG_(setStr256, const sead::SafeString&)
GDT_SET_FLAG_(setVec2f, const sead::Vector2f&)
GDT_SET_FLAG_(setVec3f, const sead::Vector3f&)
GDT_SET_FLAG_(setVec4f, const sead::Vector4f&)
#undef GDT_SET_FLAG_
#undef GDT_SET_FLAG_STR_
} // namespace ksys::gdt

View File

@ -235,7 +235,7 @@ public:
#undef GDT_GET_
#define GDT_SET_(NAME, T) \
#define GDT_SET_(NAME, T, WRAPPER_T, WRAPPER_VALUE) \
/* Setters (by handle) */ \
KSYS_ALWAYS_INLINE bool NAME(T value, FlagHandle handle, bool debug, bool force) { \
if (mBitFlags.isOn(BitFlag::_40000)) \
@ -302,49 +302,49 @@ public:
return NAME(value, name, true, true, sub_idx); \
} \
\
bool NAME(T value, FlagHandle handle, bool debug) { \
bool NAME(WRAPPER_T value, FlagHandle handle, bool debug) { \
if (debug) { \
setBool(true, "IsChangedByDebug"); \
mBitFlags.set(BitFlag::_800); \
return NAME##NoCheckForce(value, handle); \
return NAME##NoCheckForce(WRAPPER_VALUE, handle); \
} \
return NAME(value, handle); \
return NAME(WRAPPER_VALUE, handle); \
} \
bool NAME(T value, const sead::SafeString& name, bool debug) { \
bool NAME(WRAPPER_T value, const sead::SafeString& name, bool debug) { \
if (debug) { \
setBool(true, "IsChangedByDebug"); \
mBitFlags.set(BitFlag::_800); \
return NAME##NoCheckForce(value, name); \
return NAME##NoCheckForce(WRAPPER_VALUE, name); \
} \
return NAME(value, name); \
return NAME(WRAPPER_VALUE, name); \
} \
\
bool NAME(T value, FlagHandle handle, bool debug, s32 sub_idx) { \
bool NAME(WRAPPER_T value, FlagHandle handle, bool debug, s32 sub_idx) { \
if (debug) { \
setBool(true, "IsChangedByDebug"); \
mBitFlags.set(BitFlag::_800); \
return NAME##NoCheckForce(value, handle, sub_idx); \
return NAME##NoCheckForce(WRAPPER_VALUE, handle, sub_idx); \
} \
return NAME(value, handle, sub_idx); \
return NAME(WRAPPER_VALUE, handle, sub_idx); \
} \
bool NAME(T value, const sead::SafeString& name, bool debug, s32 sub_idx) { \
bool NAME(WRAPPER_T value, const sead::SafeString& name, bool debug, s32 sub_idx) { \
if (debug) { \
setBool(true, "IsChangedByDebug"); \
mBitFlags.set(BitFlag::_800); \
return NAME##NoCheckForce(value, name, sub_idx); \
return NAME##NoCheckForce(WRAPPER_VALUE, name, sub_idx); \
} \
return NAME(value, name, sub_idx); \
return NAME(WRAPPER_VALUE, name, sub_idx); \
}
GDT_SET_(setBool, bool)
GDT_SET_(setS32, s32)
GDT_SET_(setF32, f32)
GDT_SET_(setStr, char const*)
GDT_SET_(setStr64, char const*)
GDT_SET_(setStr256, char const*)
GDT_SET_(setVec2f, const sead::Vector2f&)
GDT_SET_(setVec3f, const sead::Vector3f&)
GDT_SET_(setVec4f, const sead::Vector4f&)
GDT_SET_(setBool, bool, bool, value)
GDT_SET_(setS32, s32, s32, value)
GDT_SET_(setF32, f32, f32, value)
GDT_SET_(setStr, char const*, const sead::SafeString&, value.cstr())
GDT_SET_(setStr64, char const*, const sead::SafeString&, value.cstr())
GDT_SET_(setStr256, char const*, const sead::SafeString&, value.cstr())
GDT_SET_(setVec2f, const sead::Vector2f&, const sead::Vector2f&, value)
GDT_SET_(setVec3f, const sead::Vector3f&, const sead::Vector3f&, value)
GDT_SET_(setVec4f, const sead::Vector4f&, const sead::Vector4f&, value)
#undef GDT_SET_