Jeck - Cache now pretty damn near guarantees successful retrieval.
* The only fail condition is if all resources are locked, or the file doesn't exist at all.
This commit is contained in:
@@ -6,8 +6,14 @@
|
||||
#include "MTGDeck.h"
|
||||
#include "MTGCard.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#define CACHE_SIZE_PIXELS 20000000
|
||||
#define MAX_CACHE_OBJECTS 2000
|
||||
#else
|
||||
#define CACHE_SIZE_PIXELS 2000000
|
||||
#define MAX_CACHE_OBJECTS 200
|
||||
#endif
|
||||
|
||||
|
||||
class WCachedResource{
|
||||
public:
|
||||
@@ -111,8 +117,11 @@ public:
|
||||
private:
|
||||
bool RemoveOldestTexture();
|
||||
bool RemoveOldestSample();
|
||||
|
||||
bool cleanup();
|
||||
|
||||
JTexture * attemptTexture(string filename, int mode = 0, int format = TEXTURE_FORMAT);
|
||||
|
||||
WCachedTexture * getCachedTexture(string filename, bool makenew = true, int mode = 0, int format = TEXTURE_FORMAT);
|
||||
WCachedTexture * getCachedCard(MTGCard * card, int type = CACHE_CARD, bool makenew = true);
|
||||
WCachedSample * getCachedSample(string filename, bool makenew = true);
|
||||
|
||||
Reference in New Issue
Block a user