47 INLINE
void set_active(
bool flag);
48 INLINE
bool get_active()
const;
50 INLINE
void set_cache_models(
bool flag);
51 INLINE
bool get_cache_models()
const;
53 INLINE
void set_cache_textures(
bool flag);
54 INLINE
bool get_cache_textures()
const;
56 INLINE
void set_cache_compressed_textures(
bool flag);
57 INLINE
bool get_cache_compressed_textures()
const;
59 INLINE
void set_cache_compiled_shaders(
bool flag);
60 INLINE
bool get_cache_compiled_shaders()
const;
65 INLINE
void set_flush_time(
int flush_time);
66 INLINE
int get_flush_time()
const;
68 INLINE
void set_cache_max_kbytes(
int max_kbytes);
69 INLINE
int get_cache_max_kbytes()
const;
71 INLINE
void set_read_only(
bool ro);
72 INLINE
bool get_read_only()
const;
75 const std::string &cache_extension);
78 void consider_flush_index();
81 void list_index(std::ostream &out,
int indent_level = 0)
const;
83 INLINE
static BamCache *get_global_ptr();
84 INLINE
static void consider_flush_global_index();
85 INLINE
static void flush_global_index();
88 MAKE_PROPERTY(active, get_active, set_active);
89 MAKE_PROPERTY(cache_models, get_cache_models, set_cache_models);
90 MAKE_PROPERTY(cache_textures, get_cache_textures, set_cache_textures);
91 MAKE_PROPERTY(cache_compressed_textures, get_cache_compressed_textures,
92 set_cache_compressed_textures);
93 MAKE_PROPERTY(cache_compiled_shaders, get_cache_compiled_shaders,
94 set_cache_compiled_shaders);
95 MAKE_PROPERTY(root, get_root, set_root);
96 MAKE_PROPERTY(flush_time, get_flush_time, set_flush_time);
97 MAKE_PROPERTY(cache_max_kbytes, get_cache_max_kbytes, set_cache_max_kbytes);
98 MAKE_PROPERTY(read_only, get_read_only, set_read_only);
102 bool read_index_pathname(
Filename &index_pathname,
103 std::string &index_ref_contents)
const;
105 void rebuild_index();
106 INLINE
void mark_index_stale();
109 void remove_from_index(
const Filename &source_filename);
111 void check_cache_size();
113 void emergency_read_only();
126 static std::string hash_filename(
const std::string &filename);
127 static void make_global();
131 bool _cache_textures;
132 bool _cache_compressed_textures;
133 bool _cache_compiled_shaders;
141 time_t _index_stale_since;
144 std::string _index_ref_contents;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class maintains a cache of Bam and/or Txo objects generated from model files and texture images ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This represents the in-memory index that records the list of files stored in the BamCache.
The name of a file, such as a texture file or an Egg file.
An instance of this class is written to the front of a Bam or Txo file to make the file a cached inst...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.