From 2ef337223e15b37d2f0b73e4f7506c766d0e6389 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Wed, 2 May 2018 13:15:42 +0700 Subject: [PATCH] Dump hires textures cache to file right after load from texture pack. It is more safe than dump when emulator closed. Fixed Texture cache fails to save to disk #1761 --- src/GLideNHQ/TxHiResCache.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/GLideNHQ/TxHiResCache.cpp b/src/GLideNHQ/TxHiResCache.cpp index 4cac4a38..a7a6da69 100644 --- a/src/GLideNHQ/TxHiResCache.cpp +++ b/src/GLideNHQ/TxHiResCache.cpp @@ -86,8 +86,10 @@ TxHiResCache::TxHiResCache(int maxwidth, } /* read in hires textures */ - if (!_cacheDumped) - TxHiResCache::load(0); + if (!_cacheDumped) { + if (TxHiResCache::load(0) && (_options & DUMP_HIRESTEXCACHE) != 0) + _cacheDumped = TxCache::save(_cachePath.c_str(), _getFileName().c_str(), _getConfig()); + } } void TxHiResCache::dump()