Add option to prevent Mipmaps from being dumped

This commit is contained in:
NR74W 2020-04-13 03:32:03 +02:00
parent cc57a6fddd
commit fe5b06cc17
2 changed files with 6 additions and 0 deletions

View file

@ -80,6 +80,7 @@ bool TextureReplacer::LoadIni() {
allowVideo_ = false;
ignoreAddress_ = false;
reduceHash_ = false;
disallowMipmap_ = false;
if (File::Exists(basePath_ + INI_FILENAME)) {
IniFile ini;
@ -128,6 +129,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("disallowMipmap", &disallowMipmap_, disallowMipmap_);
if (reduceHash_ && hash_ == ReplacedTextureHash::QUICK) {
reduceHash_ = false;
ERROR_LOG(G3D, "Texture Replacement: reduceHash option requires safer hash, use xxh32 or xxh64 instead.");
@ -411,6 +413,9 @@ void TextureReplacer::NotifyTextureDecoded(const ReplacedTextureDecodeInfo &repl
if (ignoreAddress_) {
cachekey = cachekey & 0xFFFFFFFFULL;
}
if (disallowMipmap_ && level > 0) {
return;
}
std::string hashfile = LookupHashFile(cachekey, replacedInfo.hash, level);
const std::string filename = basePath_ + hashfile;

View file

@ -203,6 +203,7 @@ protected:
bool allowVideo_ = false;
bool ignoreAddress_ = false;
bool reduceHash_ = false;
bool disallowMipmap_ = false;
std::string gameID_;
std::string basePath_;
ReplacedTextureHash hash_ = ReplacedTextureHash::QUICK;