Added ability to suppress texture caching in BamCache

This commit is contained in:
Josh Yelon 2007-06-17 07:02:47 +00:00
parent 4f0f812902
commit b9d7c0dd69
2 changed files with 12 additions and 1 deletions

View File

@ -55,11 +55,17 @@ BamCache() :
("model-cache-flush", 30,
PRC_DESC("This is the amount of time, in seconds, between automatic "
"flushes of the model-cache index."));
ConfigVariableBool model_cache_textures
("model-cache-textures", true,
PRC_DESC("If this is set to true, textures will also be cached in the "
"model cache, as txo files."));
ConfigVariableInt model_cache_max_kbytes
("model-cache-max-kbytes", 1048576,
PRC_DESC("This is the maximum size of the model cache, in kilobytes."));
_cache_textures = model_cache_textures;
_flush_time = model_cache_flush;
_max_kbytes = model_cache_max_kbytes;
@ -141,6 +147,10 @@ PT(BamCacheRecord) BamCache::
lookup(const Filename &source_filename, const string &cache_extension) {
consider_flush_index();
if ((cache_extension == "txo")&&(!_cache_textures)) {
return NULL;
}
Filename source_pathname(source_filename);
source_pathname.make_absolute();

View File

@ -100,6 +100,7 @@ private:
Filename _root;
int _flush_time;
int _max_kbytes;
bool _cache_textures;
static BamCache *_global_ptr;
BamCacheIndex *_index;