From 88d573917ed8e458f68b408af5a691ac557da544 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 5 Feb 2009 00:04:35 +0000 Subject: [PATCH] allow automatic decompression when writing textures to file --- panda/src/gobj/texture.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index ccda616769..c128494399 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -2665,15 +2665,18 @@ do_read_dds(istream &in, const string &filename, bool header_only) { //////////////////////////////////////////////////////////////////// bool Texture:: do_write(const Filename &fullpath, int z, int n, bool write_pages, bool write_mipmaps) const { - if (!do_has_ram_image()) { - ((Texture *)this)->do_get_ram_image(); - } - nassertr(do_has_ram_image(), false); - if (is_txo_filename(fullpath)) { + if (!do_has_ram_image()) { + ((Texture *)this)->do_get_ram_image(); + } + nassertr(do_has_ram_image(), false); return do_write_txo_file(fullpath); } + if (!do_has_uncompressed_ram_image()) { + ((Texture *)this)->do_get_uncompressed_ram_image(); + } + nassertr(do_has_ram_mipmap_image(n), false); nassertr(_ram_image_compression == CM_off, false);