From 5552a3a4df3e6a962f45eab45b8a24b2a7822f73 Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 14 Nov 2008 20:01:50 +0000 Subject: [PATCH] don't save texture cache until we have a texture image --- panda/src/gobj/texturePool.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/panda/src/gobj/texturePool.cxx b/panda/src/gobj/texturePool.cxx index 9eeeaccc91..1599d8ee04 100644 --- a/panda/src/gobj/texturePool.cxx +++ b/panda/src/gobj/texturePool.cxx @@ -314,9 +314,8 @@ ns_load_texture(const Filename &orig_filename, int primary_file_num_channels, _textures[filename] = tex; } - if (store_record) { + if (store_record && tex->has_ram_image()) { // Store the on-disk cache record for next time. - nassertr(tex->has_ram_image(), tex); record->set_data(tex, false); cache->store(record); } @@ -440,7 +439,7 @@ ns_load_texture(const Filename &orig_filename, _textures[filename] = tex; } - if (store_record) { + if (store_record && tex->has_ram_image()) { // Store the on-disk cache record for next time. record->set_data(tex, false); cache->store(record); @@ -541,7 +540,7 @@ ns_load_3d_texture(const Filename &filename_pattern, _textures[filename] = tex; } - if (store_record) { + if (store_record && tex->has_ram_image()) { // Store the on-disk cache record for next time. record->set_data(tex, false); cache->store(record); @@ -633,7 +632,7 @@ ns_load_cube_map(const Filename &filename_pattern, bool read_mipmaps, _textures[filename] = tex; } - if (store_record) { + if (store_record && tex->has_ram_image()) { // Store the on-disk cache record for next time. record->set_data(tex, false); cache->store(record);