76 return _cache_models && _active;
88 _cache_textures = flag;
102 return _cache_textures && _active;
127 _cache_compressed_textures = flag;
142 return _cache_compressed_textures && _active;
166 _flush_time = flush_time;
198 _max_kbytes = max_kbytes;
254 if (_global_ptr == (
BamCache *)NULL) {
268 if (_global_ptr != (
BamCache *)NULL) {
281 if (_global_ptr != (
BamCache *)NULL) {
292 INLINE
void BamCache::
294 if (_index_stale_since == 0) {
295 _index_stale_since = time(NULL);
static void flush_global_index()
If there is a global BamCache object, calls flush_index() on it.
void set_active(bool flag)
Changes the state of the active flag.
This class maintains a cache of Bam and/or Txo objects generated from model files and texture images ...
static void consider_flush_global_index()
If there is a global BamCache object, calls consider_flush_index() on it.
void set_cache_models(bool flag)
Indicates whether model files (e.g.
void set_cache_compressed_textures(bool flag)
Indicates whether compressed texture files will be stored in the cache, as compressed txo files...
void set_cache_textures(bool flag)
Indicates whether texture files will be stored in the cache, as uncompressed txo files.
void flush_index()
Ensures the index is written to disk.
bool get_cache_textures() const
Returns whether texture files (e.g.
Filename get_root() const
Returns the current root pathname of the cache.
bool get_cache_compressed_textures() const
Returns whether compressed texture files will be stored in the cache, as compressed txo files...
The name of a file, such as a texture file or an Egg file.
Similar to MutexHolder, but for a reentrant mutex.
int get_cache_max_kbytes() const
Returns the maximum size, in kilobytes, which the cache is allowed to grow to.
bool get_cache_models() const
Returns whether model files (e.g.
int get_flush_time() const
Returns the time in seconds between automatic flushes of the cache index.
void set_flush_time(int flush_time)
Specifies the time in seconds between automatic flushes of the cache index.
void set_cache_max_kbytes(int max_kbytes)
Specifies the maximum size, in kilobytes, which the cache is allowed to grow to.
bool get_active() const
Returns true if the BamCache is currently active, false if it is not.
bool get_read_only() const
Returns true if the cache is in read-only mode.
void set_read_only(bool ro)
Can be used to put the cache in read-only mode, or take it out of read-only mode. ...
static BamCache * get_global_ptr()
Returns a pointer to the global BamCache object, which is used automatically by the ModelPool and Tex...
void consider_flush_index()
Flushes the index if enough time has elapsed since the index was last flushed.