[jak3] Support jaextern.str, stub for blue fog fix (#3455)

This commit is contained in:
water111
2024-04-07 11:09:56 -04:00
committed by GitHub
parent ae0f139667
commit 0124a0b9a1
15 changed files with 78 additions and 15 deletions
+15
View File
@@ -188,6 +188,21 @@ FullName extract_name(const std::string& file_info_name) {
} // namespace
std::string StrFileReader::get_chunk_art_name(int idx) const {
const auto& file_info_string = get_art_group_file_info_string();
const auto& chunk = m_chunks.at(idx);
int offset;
if (find_string_in_data(chunk.data(), int(chunk.size()), file_info_string, &offset)) {
offset += file_info_string.length();
} else {
ASSERT_MSG(false, fmt::format("did not find string '{}'", file_info_string));
}
// extract the name info as a "name" + "chunk id" + "-ag.go" format.
return extract_name(get_string_of_max_length((const char*)(chunk.data() + offset), 128)).name +
"-ag";
}
/*!
* Look inside the chunks to determine the source file name.
* Does a lot of checking, might not work in future versions without some updating.