mirror of https://github.com/zeldaret/botw.git
ksys/gdt: Do not inline gdtCommonFlagsUtils functions
This commit is contained in:
parent
79ad7f328d
commit
f2927c1de8
|
@ -52414,7 +52414,7 @@
|
||||||
0x00000071008e4074,sub_71008E4074,12,
|
0x00000071008e4074,sub_71008E4074,12,
|
||||||
0x00000071008e4080,getTrackBlockSaveNumberFlag,12,
|
0x00000071008e4080,getTrackBlockSaveNumberFlag,12,
|
||||||
0x00000071008e408c,getTrackBlockSaveNumberFlagHard,12,
|
0x00000071008e408c,getTrackBlockSaveNumberFlagHard,12,
|
||||||
0x00000071008e4098,getFlag_100enemy_Activated,168,
|
0x00000071008e4098,getFlag_100enemy_Activated,168,_ZN4ksys3gdt26getFlag_100enemy_ActivatedEb
|
||||||
0x00000071008e4140,getBoolFlag,168,
|
0x00000071008e4140,getBoolFlag,168,
|
||||||
0x00000071008e41e8,getIntFlag,168,
|
0x00000071008e41e8,getIntFlag,168,
|
||||||
0x00000071008e43a4,getFlag_100enemy_IsPlayNow_ActivatedDemo,172,
|
0x00000071008e43a4,getFlag_100enemy_IsPlayNow_ActivatedDemo,172,
|
||||||
|
|
Can't render this file because it is too large.
|
|
@ -1,6 +1,7 @@
|
||||||
target_sources(uking PRIVATE
|
target_sources(uking PRIVATE
|
||||||
gdtCommonFlags.cpp
|
gdtCommonFlags.cpp
|
||||||
gdtCommonFlags.h
|
gdtCommonFlags.h
|
||||||
|
gdtCommonFlagsUtils.cpp
|
||||||
gdtCommonFlagsUtils.h
|
gdtCommonFlagsUtils.h
|
||||||
gdtFlag.cpp
|
gdtFlag.cpp
|
||||||
gdtFlag.h
|
gdtFlag.h
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -173,42 +173,6 @@ void initCommonFlags();
|
||||||
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
} // namespace ksys::gdt
|
|
||||||
""")
|
|
||||||
|
|
||||||
with (src_gdt / "gdtCommonFlagsUtils.h").open("w") as f:
|
|
||||||
f.write("""\
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
// DO NOT EDIT. This file is automatically generated.
|
|
||||||
|
|
||||||
#include "KingSystem/GameData/gdtCommonFlags.h"
|
|
||||||
#include "KingSystem/GameData/gdtFlagUtils.h"
|
|
||||||
|
|
||||||
namespace ksys::gdt {
|
|
||||||
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
""")
|
|
||||||
for i, name in enumerate(exe_flag_list):
|
|
||||||
info = flag_type_info[flag_types[name]]
|
|
||||||
if info.is_value_inline():
|
|
||||||
f.write(
|
|
||||||
f"inline {info.arg_type} getFlag_{name}(bool debug = false) {{ return {info.get_getter_fn_name()}(flag_{name}(), debug); }}\n")
|
|
||||||
else:
|
|
||||||
f.write(
|
|
||||||
f"inline void getFlag_{name}({info.arg_type}* value, bool debug = false) {{ {info.get_getter_fn_name()}(flag_{name}(), value, debug); }}\n")
|
|
||||||
|
|
||||||
for i, name in enumerate(exe_flag_list):
|
|
||||||
info = flag_type_info[flag_types[name]]
|
|
||||||
f.write(
|
|
||||||
f"inline void setFlag_{name}({info.get_setter_arg_type()} const& value, bool debug = false) {{ "
|
|
||||||
f"{info.get_setter_fn_name()}(value, flag_{name}(), debug); }}\n")
|
|
||||||
|
|
||||||
f.write("""\
|
|
||||||
|
|
||||||
// clang-format on
|
|
||||||
|
|
||||||
} // namespace ksys::gdt
|
} // namespace ksys::gdt
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
@ -252,6 +216,75 @@ void initCommonFlags_() {
|
||||||
// clang-format on
|
// clang-format on
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace ksys::gdt
|
||||||
|
""")
|
||||||
|
|
||||||
|
# Generate gdtCommonFlagsUtils.h
|
||||||
|
with (src_gdt / "gdtCommonFlagsUtils.h").open("w") as f:
|
||||||
|
f.write("""\
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
// DO NOT EDIT. This file is automatically generated.
|
||||||
|
|
||||||
|
#include "KingSystem/GameData/gdtCommonFlags.h"
|
||||||
|
#include "KingSystem/GameData/gdtFlagUtils.h"
|
||||||
|
|
||||||
|
namespace ksys::gdt {
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
|
||||||
|
""")
|
||||||
|
for i, name in enumerate(exe_flag_list):
|
||||||
|
info = flag_type_info[flag_types[name]]
|
||||||
|
# Getter
|
||||||
|
if info.is_value_inline():
|
||||||
|
f.write(
|
||||||
|
f"{info.arg_type} getFlag_{name}(bool debug = false);\n")
|
||||||
|
else:
|
||||||
|
f.write(
|
||||||
|
f"void getFlag_{name}({info.arg_type}* value, bool debug = false);\n")
|
||||||
|
# Setter
|
||||||
|
f.write(f"void setFlag_{name}({info.get_setter_arg_type()} const& value, bool debug = false);\n")
|
||||||
|
# TODO: resetter (see resetFlag_ActorName_SeakSensor_Slot0 for an example)
|
||||||
|
|
||||||
|
f.write("""\
|
||||||
|
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
} // namespace ksys::gdt
|
||||||
|
""")
|
||||||
|
|
||||||
|
# Generate gdtCommonFlagsUtils.cpp
|
||||||
|
with (src_gdt / "gdtCommonFlagsUtils.cpp").open("w") as f:
|
||||||
|
f.write("""\
|
||||||
|
// DO NOT EDIT. This file is automatically generated.
|
||||||
|
|
||||||
|
#include "KingSystem/GameData/gdtCommonFlagsUtils.h"
|
||||||
|
|
||||||
|
namespace ksys::gdt {
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
|
||||||
|
""")
|
||||||
|
for i, name in enumerate(exe_flag_list):
|
||||||
|
info = flag_type_info[flag_types[name]]
|
||||||
|
# Getter
|
||||||
|
if info.is_value_inline():
|
||||||
|
f.write(
|
||||||
|
f"{info.arg_type} getFlag_{name}(bool debug) {{ return {info.get_getter_fn_name()}(flag_{name}(), debug); }}\n")
|
||||||
|
else:
|
||||||
|
f.write(
|
||||||
|
f"void getFlag_{name}({info.arg_type}* value, bool debug) {{ {info.get_getter_fn_name()}(flag_{name}(), value, debug); }}\n")
|
||||||
|
# Setter
|
||||||
|
f.write(
|
||||||
|
f"void setFlag_{name}({info.get_setter_arg_type()} const& value, bool debug) {{ "
|
||||||
|
f"{info.get_setter_fn_name()}(value, flag_{name}(), debug); }}\n")
|
||||||
|
# TODO: resetter (see resetFlag_ActorName_SeakSensor_Slot0 for an example)
|
||||||
|
|
||||||
|
f.write("""\
|
||||||
|
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
} // namespace ksys::gdt
|
} // namespace ksys::gdt
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue