From 994d2dd85e5d43761ae94e5738865502fa0e4e39 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 1 May 2016 08:58:14 -0700 Subject: [PATCH] Skip video in replacement saving by default. --- Core/TextureReplacer.cpp | 7 ++++++- Core/TextureReplacer.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Core/TextureReplacer.cpp b/Core/TextureReplacer.cpp index 1461c0cb4a..4da568218e 100644 --- a/Core/TextureReplacer.cpp +++ b/Core/TextureReplacer.cpp @@ -35,7 +35,7 @@ static const std::string NEW_TEXTURE_DIR = "new/"; static const int VERSION = 1; static const int MAX_MIP_LEVELS = 64; -TextureReplacer::TextureReplacer() : enabled_(false) { +TextureReplacer::TextureReplacer() : enabled_(false), allowVideo_(false), hash_(ReplacedTextureHash::QUICK) { none_.alphaStatus_ = ReplacedTextureAlpha::UNKNOWN; } @@ -87,6 +87,8 @@ bool TextureReplacer::LoadIni() { return false; } + options->Get("video", &allowVideo_, false); + int version = 0; if (options->Get("version", &version, 0) && version > VERSION) { ERROR_LOG(G3D, "Unsupported texture replacement version %d, trying anyway", version); @@ -290,6 +292,9 @@ void TextureReplacer::NotifyTextureDecoded(const ReplacedTextureDecodeInfo &repl // Don't save the PPGe texture. return; } + if (replacedInfo.isVideo && !allowVideo_) { + return; + } std::string hashfile = LookupHashFile(replacedInfo.cachekey, replacedInfo.hash, level); const std::string filename = basePath_ + hashfile; diff --git a/Core/TextureReplacer.h b/Core/TextureReplacer.h index 49a82d5e2c..d90d484e28 100644 --- a/Core/TextureReplacer.h +++ b/Core/TextureReplacer.h @@ -165,6 +165,7 @@ protected: SimpleBuf saveBuf; bool enabled_; + bool allowVideo_; std::string gameID_; std::string basePath_; ReplacedTextureHash hash_;