d/jak2: finish cty-guard-turret-button | race-h | height-map-h and a lot of rigid-body (#1957)

Also cleaned up `data_decompiler.cpp` to make it a lot less verbose to
add a special case for an array field.
This commit is contained in:
Tyler Wilding
2022-10-11 23:20:36 -04:00
committed by GitHub
parent f7e1e73809
commit e3473c1902
197 changed files with 24065 additions and 614 deletions
+18
View File
@@ -118,4 +118,22 @@ std::vector<std::string> decompile_bitfield_enum_from_int(const TypeSpec& type,
std::string decompile_int_enum_from_int(const TypeSpec& type, const TypeSystem& ts, u64 value);
goos::Object bitfield_defs_print(const TypeSpec& type,
const std::vector<BitFieldConstantDef>& defs);
struct ArrayFieldDecompMeta {
enum class Kind { REF_TO_INLINE_ARR, REF_TO_INTEGER_ARR };
TypeSpec element_type;
int bytes_per_element; // aka stride
Kind kind;
ArrayFieldDecompMeta(TypeSpec _element_type,
int _bytes_per_element,
Kind _kind = Kind::REF_TO_INLINE_ARR)
: element_type(_element_type), bytes_per_element(_bytes_per_element), kind(_kind){};
};
extern const std::unordered_map<
GameVersion,
std::unordered_map<std::string, std::unordered_map<std::string, ArrayFieldDecompMeta>>>
array_field_decomp_special_cases;
} // namespace decompiler