mirror of
https://github.com/open-goal/jak-project
synced 2026-07-10 07:07:04 -04:00
decompiler: better automatic detection of art groups and joint-node-index macro detection (#3061)
This commit is contained in:
+20
-8
@@ -205,19 +205,31 @@ int main(int argc, char** argv) {
|
||||
|
||||
if (config.process_art_groups) {
|
||||
db.extract_art_info();
|
||||
// dumb art info to json if requested
|
||||
// dump art info to json if requested
|
||||
if (config.dump_art_group_info) {
|
||||
auto file_name = out_folder / "dump" / "art-group-info.min.json";
|
||||
nlohmann::json json = db.dts.art_group_info;
|
||||
file_util::create_dir_if_needed_for_file(file_name);
|
||||
file_util::write_text_file(file_name, json.dump(-1));
|
||||
lg::info("[DUMP] Dumped art group info to {}", file_name.string());
|
||||
auto ag_file_name = out_folder / "dump" / "art-group-info.min.json";
|
||||
nlohmann::json ag_json = db.dts.art_group_info;
|
||||
file_util::create_dir_if_needed_for_file(ag_file_name);
|
||||
file_util::write_text_file(ag_file_name, ag_json.dump(-1));
|
||||
lg::info("[DUMP] Dumped art group info to {}", ag_file_name.string());
|
||||
}
|
||||
} else if (!config.art_group_info_dump.empty()) {
|
||||
if (config.dump_joint_geo_info) {
|
||||
auto jg_file_name = out_folder / "dump" / "joint-node-info.min.json";
|
||||
nlohmann::json jg_json = db.dts.jg_info;
|
||||
file_util::create_dir_if_needed_for_file(jg_file_name);
|
||||
file_util::write_text_file(jg_file_name, jg_json.dump(-1));
|
||||
lg::info("[DUMP] Dumped joint node info to {}", jg_file_name.string());
|
||||
}
|
||||
} else if (!config.art_group_info_dump.empty() || !config.jg_info_dump.empty()) {
|
||||
// process art groups (used in decompilation)
|
||||
// - if the config has a path to the art info dump, just use that
|
||||
// - otherwise (or if we want to dump it fresh) extract it
|
||||
db.dts.art_group_info = config.art_group_info_dump;
|
||||
if (!config.art_group_info_dump.empty()) {
|
||||
db.dts.art_group_info = config.art_group_info_dump;
|
||||
}
|
||||
if (!config.jg_info_dump.empty()) {
|
||||
db.dts.jg_info = config.jg_info_dump;
|
||||
}
|
||||
} else {
|
||||
lg::error("`process_art_groups` was false and no art-group-info dump was provided!");
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user