- Put back delayed loading functionality for the Deck editor
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-09-09 13:51:29 +00:00
parent 91a9387e33
commit c0be024093
3 changed files with 9 additions and 1 deletions
+1
View File
@@ -80,6 +80,7 @@ public:
WResourceManager();
~WResourceManager();
bool isCardInCache(MTGCard * card, int type = CACHE_CARD);
JQuad * RetrieveCard(MTGCard * card, int type = CACHE_CARD, int style = RETRIEVE_NORMAL);
JSample * RetrieveSample(string filename, int style = RETRIEVE_NORMAL);
JTexture * RetrieveTexture(string filename, int style = RETRIEVE_NORMAL);
+5 -1
View File
@@ -546,7 +546,11 @@ void GameStateDeckViewer::renderCard(int id, float rotation){
JQuad * quad = backQuad;
int showName = 1;
quad = resources.RetrieveCard(card);
if (resources.RetrieveCard(card,CACHE_CARD,RETRIEVE_EXISTING) || last_user_activity > (abs(2-id) + 1)* NO_USER_ACTIVITY_SHOWCARD_DELAY){
quad = resources.RetrieveCard(card);
showName = 0;
}
if (quad){
showName = 0;
+3
View File
@@ -299,6 +299,9 @@ WCachedTexture * WResourceManager:: getCachedCard(MTGCard * card, int type, bool
if(miss != textureCache.end() && miss->second == NULL)
return NULL; //We've found a cache miss, so return null.
if(miss == textureCache.end() && !makenew)
return NULL; //cache empty and don't want to create
WCachedTexture * ctex = textureCache[filename];
//Failed to find it in cache!
if(!ctex && makenew){