mirror of
https://github.com/open-goal/jak-project
synced 2026-05-23 06:54:31 -04:00
5c9d891d54
### 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](https://github.com/open-goal/jak-project/blob/0fa93ce7b83d1621f3fd040625bfa865eadaeef0/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" />