mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 19:08:55 -04:00
Added ability to suppress texture caching in BamCache
This commit is contained in:
parent
4f0f812902
commit
b9d7c0dd69
@ -56,10 +56,16 @@ BamCache() :
|
||||
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();
|
||||
|
||||
|
@ -100,6 +100,7 @@ private:
|
||||
Filename _root;
|
||||
int _flush_time;
|
||||
int _max_kbytes;
|
||||
bool _cache_textures;
|
||||
static BamCache *_global_ptr;
|
||||
|
||||
BamCacheIndex *_index;
|
||||
|
Loading…
x
Reference in New Issue
Block a user