Jeck - Profile and cache improvements, booster duplicate likelihood reduced.

* Cache now tracks missing textures for RetrieveQuad, not just RetrieveCard/RetrieveTexture.
* Profile options are no longer overwritten when switching profiles.
* Main menu notifies of alternate profile- "Database: X" becomes "Profile: Y of X cards."
* Boosters iterates through cards, replacing duplicates. Stops after 15 tries to prevent infinite loops on small sets.
* Very simplistic theme switcher, only displays when alternate themes are present.
This commit is contained in:
wagic.jeck
2009-09-08 03:23:19 +00:00
parent a0b1da9810
commit ad7006e2de
9 changed files with 145 additions and 49 deletions

View File

@@ -7,7 +7,7 @@
#include "MTGCard.h"
#define CACHE_SIZE_PIXELS 2000000
#define MAX_CACHE_OBJECTS 100
#define MAX_CACHE_OBJECTS 200
class WCachedResource{
public:
@@ -84,6 +84,7 @@ public:
void ClearMisses();
void ClearUnlocked();
void ClearSamples();
void Refresh(); //Refreshes all files in cache, for when mode/profile changes.
unsigned int nowTime();
@@ -111,7 +112,6 @@ private:
bool RemoveOldestTexture();
bool RemoveOldestSample();
bool cleanup();
void clearSamples();
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);
@@ -121,6 +121,8 @@ private:
//For cached stuff
map<string,WCachedTexture*> textureCache;
map<string,WCachedSample*> sampleCache;
vector<string> mTextureMissing; //For managed textures.
//Current access time.
int lastTime;