From 2b226fedea4708fff54e297e0410d30c6d02a8dd Mon Sep 17 00:00:00 2001 From: water111 <48171810+water111@users.noreply.github.com> Date: Sat, 4 Jan 2025 12:24:57 -0500 Subject: [PATCH] [jak3] Update texture remap table (#3821) Fix for https://github.com/open-goal/jak-project/issues/3820 Jak 2 and 3 use this annoying trick where they store multiple images in the same texture by just changing the CLUT. This breaks some PC code because those two textures will have the same TBP address. so there's a table of remaps to fix this, generated by the decompiler. Unfortunately, I generated that table before the decompiler loaded the .STR file with these textures, so it was missing the remaps. This is automatically generated in the texture folder when you run the decompiler - I just copied it to the C++ file. ![image](https://github.com/user-attachments/assets/d3ca98d9-5d02-4055-bcb0-7e027a0a49b9) ![image](https://github.com/user-attachments/assets/9514bcbc-0523-466e-83cc-dd9cca7632ec) Co-authored-by: water111 --- game/graphics/jak3_texture_remap.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/game/graphics/jak3_texture_remap.cpp b/game/graphics/jak3_texture_remap.cpp index 61e9cc032f..0912cc7e5e 100644 --- a/game/graphics/jak3_texture_remap.cpp +++ b/game/graphics/jak3_texture_remap.cpp @@ -33,6 +33,18 @@ const std::unordered_map>> data = { {17, 3}, {4, 1}}}, {13, {{21, 1}, {23, 2}, {24, 3}, {46, 1}, {47, 2}, {39, 1}, {40, 2}}}, + {17, + {{56, 1}, + {42, 1}, + {44, 2}, + {46, 3}, + {51, 2}, + {52, 3}, + {48, 1}, + {49, 2}, + {40, 1}, + {53, 2}, + {59, 3}}}, {125, {{17, 1}, {18, 2}, {19, 3}, {23, 1}}}, {127, {{36, 1}, @@ -2032,9 +2044,9 @@ const std::unordered_map>> data = { {98, 1}, {99, 2}, {101, 3}, {94, 1}, {96, 2}}}, {3416, {{44, 1}, {46, 2}, {48, 1}, {28, 1}}}, {3417, {{3, 1}, {4, 2}, {5, 3}, {6, 4}}}, -}; }; +} int lookup_jak3_texture_dest_offset(int tpage, int texture_idx) { auto it = data.find(tpage);