jak-project/goalc
Grateful Forest 5c9d891d54
jak1: fix jsonc tpages being non-functional (#4074)
### The Problem:
The tpages list at the top of the JSONC, never actually gets used or is
written into memory:
<img width="270" height="195" alt="1"
src="https://github.com/user-attachments/assets/d3983363-23db-496e-bcea-136ab0e04058"
/>
This means that previously, the only way that texture remapping was
working was in very specific circumstances, which is when the autofill
would trigger. The autofill would only trigger under these specific
conditions:
- Both a sky remap and level remap are used
- The sky remap and level remap are the same level
- The tpages list is empty

If you went against any of these three parameters, texture remapping
could not be done.
### The Solution:

I simply reversed the logging line
[here](0fa93ce7b8/goalc/build_level/jak1/build_level.cpp (L240)),
which turns the tpages into numbers in order to print them, and reversed
the shift from << to >> to instead take the numbers and write them into
memory.

```cpp
if (!tpages.empty()) {
  file.texture_ids.resize(tpages.size());
  for (size_t i = 0; i < tpages.size(); ++i) {
    file.texture_ids[i] = tpages[i] << 20;
  }
}
```

Pictured: A sunken level remap (correct generic textures on water) with
a village1 sky (so not depending on the autofill that only runs when the
sky and level are matching):

<img width="1716" height="1012" alt="aaa"
src="https://github.com/user-attachments/assets/1af3eddb-a5fb-4387-b644-bf84ba60ab62"
/>
2025-12-08 17:52:42 -05:00
..
build_actor jak1, jak2, jak3: fix custom model visibility (#4070) 2025-12-08 17:51:33 -05:00
build_level jak1: fix jsonc tpages being non-functional (#4074) 2025-12-08 17:52:42 -05:00
compiler goalc: add `offset-of` (#4081) 2025-11-18 15:30:05 +01:00
data_compiler game: Support korean in Jak 2 and Jak 3 (#3988) 2025-08-16 19:35:47 -04:00
debugger deps: update `fmt` to `11.1.4` (#3880) 2025-04-12 15:59:13 -04:00
emitter game: Support korean in Jak 2 and Jak 3 (#3988) 2025-08-16 19:35:47 -04:00
listener deps: update `fmt` to `11.1.4` (#3880) 2025-04-12 15:59:13 -04:00
make deps: update `fmt` to `11.1.4` (#3880) 2025-04-12 15:59:13 -04:00
regalloc deps: update `fmt` to `11.1.4` (#3880) 2025-04-12 15:59:13 -04:00
CMakeLists.txt custom levels: etie and build actor support for jak2/3 (#3851) 2025-02-01 18:04:26 +01:00
main.cpp game: Support korean in Jak 2 and Jak 3 (#3988) 2025-08-16 19:35:47 -04:00
simple_main.cpp game: Remove temporary CLI arg shim in `gk` (#2532) 2023-04-22 14:13:57 -04:00