Skip to content

Commit

Permalink
[jak3] Fix for precd extraction (#3744)
Browse files Browse the repository at this point in the history
It looks like one of the tie models in this level has bad color data in
the lowest LOD. For now, just skip extracting the lowest lod for this
TIE only.

Co-authored-by: water111 <awaterford1111445@gmail.com>
  • Loading branch information
water111 and water111 authored Nov 3, 2024
1 parent cbb8add commit 1e53071
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion decompiler/config/jak3/ntsc_v1/inputs.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
"DGO/PRECA.DGO",
"DGO/PRECB.DGO",
"DGO/PRECC.DGO",
// "DGO/PRECD.DGO",
"DGO/PRECD.DGO",
// title/intro
"DGO/WIN.DGO", // wasintro
"DGO/TITLE.DGO",
Expand Down
3 changes: 2 additions & 1 deletion decompiler/level_extractor/BspHeader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,8 @@ void PrototypeBucketTie::read_from_file(TypedRef ref,
for (int i = 0; i < 4; i++) {
u32 start = index_start[i];
u32 end = start + frag_count[i];
ASSERT(num_color_qwcs <= end);
// precd tie has a bug where geo 3's
// ASSERT(num_color_qwcs <= end);
num_color_qwcs = std::max(end, num_color_qwcs);
}

Expand Down
4 changes: 4 additions & 0 deletions decompiler/level_extractor/extract_tie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2753,6 +2753,10 @@ void extract_tie(const level_tools::DrawableTreeInstanceTie* tree,
bool dump_level,
GameVersion version) {
for (int geo = 0; geo < GEOM_MAX; ++geo) {
// as far as I can tell, this one has bad colors
if (debug_name == "PRECD.DGO-2-tie" && geo == 3) {
continue;
}
tfrag3::TieTree this_tree;

// sanity check the vis tree (not a perfect check, but this is used in game and should be right)
Expand Down
2 changes: 1 addition & 1 deletion goal_src/jak3/game.gp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
(cgo-file "preca.gd" common-dep)
(cgo-file "precb.gd" common-dep)
(cgo-file "precc.gd" common-dep)
; (cgo-file "precd.gd" common-dep)
(cgo-file "precd.gd" common-dep)
; ;; title/intro
(cgo-file "win.gd" common-dep) ;; wasintro
(cgo-file "title.gd" common-dep)
Expand Down

0 comments on commit 1e53071

Please sign in to comment.