diff --git a/projects/mtg/src/GameStateDeckViewer.cpp b/projects/mtg/src/GameStateDeckViewer.cpp index 3dfa3e24f..efb6b1ffe 100644 --- a/projects/mtg/src/GameStateDeckViewer.cpp +++ b/projects/mtg/src/GameStateDeckViewer.cpp @@ -586,20 +586,21 @@ void GameStateDeckViewer::renderCard(int id, float rotation){ JQuad * quad = NULL; int showName = 0; -#ifdef DEBUG_CACHE - quad = resources.RetrieveCard(card,RETRIEVE_NORMAL); -#else - quad = resources.RetrieveCard(card,RETRIEVE_EXISTING); -#endif - if (!quad && resources.RetrieveError() != CACHE_ERROR_404){ - if(last_user_activity > (abs(2-id) + 1)* NO_USER_ACTIVITY_SHOWCARD_DELAY) - quad = resources.RetrieveCard(card); - else{ - quad = backQuad; - showName = 1; + int cacheError = CACHE_ERROR_NONE; + + if(!options[Options::DISABLECARDS].number){ + quad = resources.RetrieveCard(card,RETRIEVE_EXISTING); + cacheError = resources.RetrieveError(); + if (!quad && cacheError != CACHE_ERROR_404){ + if(last_user_activity > (abs(2-id) + 1)* NO_USER_ACTIVITY_SHOWCARD_DELAY) + quad = resources.RetrieveCard(card); + else{ + quad = backQuad; + showName = 1; + } } } - + if (quad){ showName = 0; @@ -723,6 +724,8 @@ int GameStateDeckViewer::loadDeck(int deckid){ } current = myDeck->getNext(current); } + currentCard = NULL; + loadIndexes(); return 1; } diff --git a/projects/mtg/src/WResourceManager.cpp b/projects/mtg/src/WResourceManager.cpp index b6a26b25c..31981094a 100644 --- a/projects/mtg/src/WResourceManager.cpp +++ b/projects/mtg/src/WResourceManager.cpp @@ -814,20 +814,21 @@ void WResourceManager::CacheForState(int state){ else textureWCache.Resize(SMALL_CACHE_LIMIT,SMALL_CACHE_ITEMS); sampleWCache.Resize(SMALL_CACHE_LIMIT,MAX_CACHED_SAMPLES); - //ClearUnlocked(); break; //Deck editor and shop are entirely cache safe, so give it near infinite resources. case GAME_STATE_SHOP: case GAME_STATE_DECK_VIEWER: textureWCache.Resize(HUGE_CACHE_LIMIT,HUGE_CACHE_ITEMS); - //ClearUnlocked(); break; //Anything unknown, use large cache. default: textureWCache.Resize(LARGE_CACHE_LIMIT,LARGE_CACHE_ITEMS); - //Cleanup(); break; } + + //Switching game states clears the cache on PSP. + ClearUnlocked(); + #endif }