mirror of
https://github.com/open-goal/jak-project
synced 2026-05-23 06:54:31 -04:00
[jak2] Add static textures for the progress menu (#2838)
The progress menu loads its icon textures from a .STR file that we were previously ignoring. This change: - updates the decompiler so it can process a .STR file containing a texture - adds a feature to force an entire page to always be loaded in the PC renderer by putting all textures in the GAME.FR3 file. - regenerates the texture offset map file for jak 2 with these new textures For now, I've just put the icon textures in GAME.FR3. The downside is that these will always stay on the GPU, using up VRAM even when they aren't needed. But the entire GAME.FR3 file is under 3 MB so I think it's ok. 
This commit is contained in:
@@ -119,6 +119,7 @@ ObjectFileDB::ObjectFileDB(const std::vector<fs::path>& _dgos,
|
||||
const fs::path& obj_file_name_map_file,
|
||||
const std::vector<fs::path>& object_files,
|
||||
const std::vector<fs::path>& str_files,
|
||||
const std::vector<fs::path>& str_tex_files,
|
||||
const Config& config)
|
||||
: dts(config.game_version), m_version(config.game_version) {
|
||||
Timer timer;
|
||||
@@ -223,6 +224,19 @@ ObjectFileDB::ObjectFileDB(const std::vector<fs::path>& _dgos,
|
||||
}
|
||||
}
|
||||
|
||||
if (!str_tex_files.empty()) {
|
||||
lg::info("-Loading {} streaming texture files...", str_tex_files.size());
|
||||
for (auto& obj : str_tex_files) {
|
||||
StrFileReader reader(obj, version());
|
||||
// name from the file name
|
||||
std::string base_name = obj_filename_to_name(obj.string());
|
||||
ASSERT(reader.chunk_count() == 1);
|
||||
auto name = reader.get_texture_name();
|
||||
add_obj_from_dgo(name, name, reader.get_chunk(0).data(), reader.get_chunk(0).size(),
|
||||
"TEXSPOOL", config, name);
|
||||
}
|
||||
}
|
||||
|
||||
lg::info("ObjectFileDB Initialized");
|
||||
if (obj_files_by_name.empty()) {
|
||||
lg::error(
|
||||
|
||||
Reference in New Issue
Block a user