[jak2] fix atest flag in tfrag (#2381)

Support the weird `tfrag-gs-test` and `texture-page-flag` stuff added in
jak 2. Solves some issues with partially invisible tfrags.
This commit is contained in:
water111
2023-03-21 20:40:29 -04:00
committed by GitHub
parent df646282ab
commit b18198e655
6 changed files with 45 additions and 15 deletions
+7 -1
View File
@@ -178,9 +178,15 @@ std::vector<level_tools::TextureRemap> extract_bsp_from_level(const ObjectFileDB
if (it != hacks.missing_textures_by_level.end()) {
expected_missing_textures = it->second;
}
bool atest_disable_flag = false;
if (db.version() == GameVersion::Jak2) {
if (bsp_header.texture_flags[0] & 1) {
atest_disable_flag = true;
}
}
extract_tfrag(as_tfrag_tree, fmt::format("{}-{}", dgo_name, i++),
bsp_header.texture_remap_table, tex_db, expected_missing_textures, level_data,
false, level_name);
false, level_name, atest_disable_flag);
} else if (draw_tree->my_type() == "drawable-tree-instance-tie") {
auto as_tie_tree = dynamic_cast<level_tools::DrawableTreeInstanceTie*>(draw_tree.get());
ASSERT(as_tie_tree);