Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Core/TextureReplacer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ bool TextureReplacer::LoadIni() {
allowVideo_ = false;
ignoreAddress_ = false;
reduceHash_ = false;
// Prevents dumping the mipmaps.
ignoreMipmap_ = false;

if (File::Exists(basePath_ + INI_FILENAME)) {
IniFile ini;
Expand Down Expand Up @@ -128,6 +130,7 @@ bool TextureReplacer::LoadIniValues(IniFile &ini, bool isOverride) {
options->Get("ignoreAddress", &ignoreAddress_, ignoreAddress_);
// Multiplies sizeInRAM/bytesPerLine in XXHASH by 0.5.
options->Get("reduceHash", &reduceHash_, reduceHash_);
options->Get("ignoreMipmap", &ignoreMipmap_, ignoreMipmap_);
if (reduceHash_ && hash_ == ReplacedTextureHash::QUICK) {
reduceHash_ = false;
ERROR_LOG(G3D, "Texture Replacement: reduceHash option requires safer hash, use xxh32 or xxh64 instead.");
Expand Down Expand Up @@ -411,6 +414,9 @@ void TextureReplacer::NotifyTextureDecoded(const ReplacedTextureDecodeInfo &repl
if (ignoreAddress_) {
cachekey = cachekey & 0xFFFFFFFFULL;
}
if (ignoreMipmap_ && level > 0) {
return;
}

std::string hashfile = LookupHashFile(cachekey, replacedInfo.hash, level);
const std::string filename = basePath_ + hashfile;
Expand Down
1 change: 1 addition & 0 deletions Core/TextureReplacer.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ class TextureReplacer {
bool allowVideo_ = false;
bool ignoreAddress_ = false;
bool reduceHash_ = false;
bool ignoreMipmap_ = false;
std::string gameID_;
std::string basePath_;
ReplacedTextureHash hash_ = ReplacedTextureHash::QUICK;
Expand Down