From 405a725cd041edd0bcfb70f0995205ebe18422e2 Mon Sep 17 00:00:00 2001 From: "wagic.jeck" Date: Tue, 13 Oct 2009 00:43:32 +0000 Subject: [PATCH] Jeck - Quick hack fix for cache miss recording, proving that's the source of the cache speed issue. Runs at full speed with card images and unmanaged textures... but still too slow without. I think I can clear this up in the next six hours. Hopefully :) --- projects/mtg/src/WResourceManager.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/projects/mtg/src/WResourceManager.cpp b/projects/mtg/src/WResourceManager.cpp index d98094d88..5b86f6761 100644 --- a/projects/mtg/src/WResourceManager.cpp +++ b/projects/mtg/src/WResourceManager.cpp @@ -1277,18 +1277,13 @@ cacheItem * WCache::Get(string id, int style, int submod } } - if(style == RETRIEVE_MANAGE){ - if(item){ - managed[lookup] = item; //Record a hit. + if(style == RETRIEVE_MANAGE){ + managed[lookup] = item; //Record hit or miss + if(item) item->deadbolt(); //Make permanent. - } - else if(mError == CACHE_ERROR_404) - managed[lookup] = item; //File not found. Record a miss } else{ - if(!item && mError != CACHE_ERROR_404) - RemoveMiss(lookup); - else + //Record it, hit or miss. cache[lookup] = item; }