mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
don't save texture cache until we have a texture image
This commit is contained in:
parent
e640f676e0
commit
5552a3a4df
@ -314,9 +314,8 @@ ns_load_texture(const Filename &orig_filename, int primary_file_num_channels,
|
|||||||
_textures[filename] = tex;
|
_textures[filename] = tex;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (store_record) {
|
if (store_record && tex->has_ram_image()) {
|
||||||
// Store the on-disk cache record for next time.
|
// Store the on-disk cache record for next time.
|
||||||
nassertr(tex->has_ram_image(), tex);
|
|
||||||
record->set_data(tex, false);
|
record->set_data(tex, false);
|
||||||
cache->store(record);
|
cache->store(record);
|
||||||
}
|
}
|
||||||
@ -440,7 +439,7 @@ ns_load_texture(const Filename &orig_filename,
|
|||||||
_textures[filename] = tex;
|
_textures[filename] = tex;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (store_record) {
|
if (store_record && tex->has_ram_image()) {
|
||||||
// Store the on-disk cache record for next time.
|
// Store the on-disk cache record for next time.
|
||||||
record->set_data(tex, false);
|
record->set_data(tex, false);
|
||||||
cache->store(record);
|
cache->store(record);
|
||||||
@ -541,7 +540,7 @@ ns_load_3d_texture(const Filename &filename_pattern,
|
|||||||
_textures[filename] = tex;
|
_textures[filename] = tex;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (store_record) {
|
if (store_record && tex->has_ram_image()) {
|
||||||
// Store the on-disk cache record for next time.
|
// Store the on-disk cache record for next time.
|
||||||
record->set_data(tex, false);
|
record->set_data(tex, false);
|
||||||
cache->store(record);
|
cache->store(record);
|
||||||
@ -633,7 +632,7 @@ ns_load_cube_map(const Filename &filename_pattern, bool read_mipmaps,
|
|||||||
_textures[filename] = tex;
|
_textures[filename] = tex;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (store_record) {
|
if (store_record && tex->has_ram_image()) {
|
||||||
// Store the on-disk cache record for next time.
|
// Store the on-disk cache record for next time.
|
||||||
record->set_data(tex, false);
|
record->set_data(tex, false);
|
||||||
cache->store(record);
|
cache->store(record);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user