Skip to content

Commit

Permalink
Allow replacing mip levels of a texture even without a ini file. Prob…
Browse files Browse the repository at this point in the history
…ably niche.
  • Loading branch information
hrydgard committed Dec 29, 2023
1 parent ba6749d commit 3ffcf26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion GPU/Common/ReplacedTexture.cpp
Expand Up @@ -223,7 +223,7 @@ void ReplacedTexture::Prepare(VFSBackend *vfs) {
VFSFileReference *fileRef = vfs_->GetFile(desc_.filenames[i].c_str());
if (!fileRef) {
if (i == 0) {
WARN_LOG(G3D, "Texture replacement file '%s' not found", desc_.filenames[i].c_str());
INFO_LOG(G3D, "Texture replacement file '%s' not found", desc_.filenames[i].c_str());
// No file at all. Mark as NOT_FOUND.
SetState(ReplacementState::NOT_FOUND);
return;
Expand Down
7 changes: 6 additions & 1 deletion GPU/Common/TextureReplacer.cpp
Expand Up @@ -593,7 +593,12 @@ ReplacedTexture *TextureReplacer::FindReplacement(u64 cachekey, u32 hash, int w,
}
desc.logId = desc.filenames[0];
desc.hashfiles = desc.filenames[0]; // The generated filename of the top level is used as the key in the data cache.
hashfiles = desc.filenames[0];
hashfiles.clear();
hashfiles.reserve(desc.filenames[0].size() * (desc.filenames.size() + 1));
for (int level = 0; level < desc.filenames.size(); level++) {
hashfiles += desc.filenames[level];
hashfiles.push_back('|');
}
} else {
desc.logId = hashfiles;
SplitString(hashfiles, '|', desc.filenames);
Expand Down

0 comments on commit 3ffcf26

Please sign in to comment.