mirror of
https://github.com/open-goal/jak-project.git
synced 2025-02-21 06:33:30 +00:00
[extractor] create debug_out (#2159)
Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
This commit is contained in:
parent
2645fed47a
commit
fff3a2d872
1
.gitignore
vendored
1
.gitignore
vendored
@ -38,6 +38,7 @@ search-results.json
|
||||
|
||||
# graphics debug
|
||||
debug_out/
|
||||
glb_out/
|
||||
gfx_dumps/
|
||||
screenshots/
|
||||
|
||||
|
@ -260,9 +260,10 @@ void extract_collide_frags(const level_tools::DrawableTreeCollideFragment* tree,
|
||||
|
||||
if (dump_level) {
|
||||
auto debug_out = debug_dump_to_obj(all_frags);
|
||||
file_util::write_text_file(
|
||||
file_util::get_file_path({"debug_out", fmt::format("collide-{}.obj", debug_name)}),
|
||||
debug_out);
|
||||
auto file_path =
|
||||
file_util::get_file_path({"debug_out", fmt::format("collide-{}.obj", debug_name)});
|
||||
file_util::create_dir_if_needed_for_file(file_path);
|
||||
file_util::write_text_file(file_path, debug_out);
|
||||
}
|
||||
|
||||
for (auto& item : all_frags) {
|
||||
|
@ -249,8 +249,9 @@ void extract_common(const ObjectFileDB& db,
|
||||
compressed.data(), compressed.size());
|
||||
|
||||
if (dump_levels) {
|
||||
save_level_foreground_as_gltf(tfrag_level,
|
||||
file_util::get_jak_project_dir() / "debug_out" / "common.glb");
|
||||
auto file_path = file_util::get_jak_project_dir() / "glb_out" / "common.glb";
|
||||
file_util::create_dir_if_needed_for_file(file_path);
|
||||
save_level_foreground_as_gltf(tfrag_level, file_path);
|
||||
}
|
||||
}
|
||||
|
||||
@ -286,12 +287,14 @@ void extract_from_level(const ObjectFileDB& db,
|
||||
compressed.data(), compressed.size());
|
||||
|
||||
if (dump_level) {
|
||||
save_level_background_as_gltf(level_data,
|
||||
file_util::get_jak_project_dir() / "debug_out" /
|
||||
fmt::format("{}_background.glb", level_data.level_name));
|
||||
save_level_foreground_as_gltf(level_data,
|
||||
file_util::get_jak_project_dir() / "debug_out" /
|
||||
fmt::format("{}_foreground.glb", level_data.level_name));
|
||||
auto back_file_path = file_util::get_jak_project_dir() / "glb_out" /
|
||||
fmt::format("{}_background.glb", level_data.level_name);
|
||||
file_util::create_dir_if_needed_for_file(back_file_path);
|
||||
save_level_background_as_gltf(level_data, back_file_path);
|
||||
auto fore_file_path = file_util::get_jak_project_dir() / "glb_out" /
|
||||
fmt::format("{}_foreground.glb", level_data.level_name);
|
||||
file_util::create_dir_if_needed_for_file(fore_file_path);
|
||||
save_level_foreground_as_gltf(level_data, fore_file_path);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -912,10 +912,10 @@ ConvertedMercEffect convert_merc_effect(const MercEffect& input_effect,
|
||||
}
|
||||
|
||||
if (dump) {
|
||||
file_util::write_text_file(
|
||||
file_util::get_file_path(
|
||||
{"debug_out/merc", fmt::format("{}_{}.ply", debug_name, effect_idx)}),
|
||||
debug_dump_to_ply(result.draws, result.vertices));
|
||||
auto file_path = file_util::get_file_path(
|
||||
{"debug_out/merc", fmt::format("{}_{}.ply", debug_name, effect_idx)});
|
||||
file_util::create_dir_if_needed_for_file(file_path);
|
||||
file_util::write_text_file(file_path, debug_dump_to_ply(result.draws, result.vertices));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -2121,9 +2121,10 @@ void emulate_tfrags(int geom,
|
||||
|
||||
if (dump_level) {
|
||||
auto debug_out = debug_dump_to_obj(all_draws);
|
||||
file_util::write_text_file(
|
||||
file_util::get_file_path({"debug_out", fmt::format("tfrag-{}.obj", debug_name)}),
|
||||
debug_out);
|
||||
auto file_path =
|
||||
file_util::get_file_path({"debug_out", fmt::format("tfrag-{}.obj", debug_name)});
|
||||
file_util::create_dir_if_needed_for_file(file_path);
|
||||
file_util::write_text_file(file_path, debug_out);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,10 +119,6 @@ int main(int argc, char** argv) {
|
||||
strs.push_back(in_folder / str_name);
|
||||
}
|
||||
|
||||
if (config.rip_levels) {
|
||||
file_util::create_dir_if_needed(file_util::get_jak_project_dir() / "debug_out");
|
||||
}
|
||||
|
||||
lg::info("[Mem] After config read: {} MB", get_peak_rss() / (1024 * 1024));
|
||||
|
||||
// build file database
|
||||
|
Loading…
x
Reference in New Issue
Block a user