[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.


![image](https://github.com/open-goal/jak-project/assets/48171810/39f075b5-7cc5-4168-872a-33026342afab)
This commit is contained in:
water111
2023-07-23 12:35:59 -04:00
committed by GitHub
parent 673d2a13ae
commit 50230e05fa
12 changed files with 109 additions and 11 deletions
+22 -1
View File
@@ -196,7 +196,7 @@ std::string StrFileReader::get_full_name(const std::string& short_name) const {
bool done_first = false;
// this string is part of the file info struct and the stuff after it is the file name.
const auto& file_info_string = get_file_info_string();
const auto& file_info_string = get_art_group_file_info_string();
// it should occur in each chunk.
int chunk_id = 0;
@@ -241,4 +241,25 @@ std::string StrFileReader::get_full_name(const std::string& short_name) const {
return result;
}
std::string StrFileReader::get_texture_name() const {
ASSERT(m_chunks.size() == 1);
const auto& chunk = m_chunks[0];
auto find_string = get_texture_page_file_info_string();
int offset;
if (find_string_in_data(chunk.data(), int(chunk.size()), find_string, &offset)) {
offset += find_string.length();
} else {
ASSERT_MSG(false, fmt::format("did not find string '{}'", find_string));
}
for (int i = 0; i < 128; i++) {
if (chunk[offset + i] == '.') {
std::string result;
result.assign((const char*)&chunk[offset], i);
return result;
}
}
ASSERT_NOT_REACHED();
}
} // namespace decompiler