Erwan
- Put back delayed loading functionality for the Deck editor
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user