From 7e392afdbe4a3e072781e92ae22c0529d90ef398 Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 19 Feb 2001 20:06:45 +0000 Subject: [PATCH] *** empty log message *** --- panda/src/gobj/texture.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index c3a476d7b4..70398b5c38 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -428,6 +428,14 @@ write_datagram(BamWriter *manager, Datagram &me) me.add_uint8(_magfiltercolor); me.add_uint8(_magfilteralpha); me.add_int16(_anisotropic_degree); + + // We also need to write out the pixel buffer's format, even though + // that's not stored as part of the texture structure. + bool has_pbuffer = (_pbuffer != (PixelBuffer *)NULL); + me.add_bool(has_pbuffer); + if (has_pbuffer) { + me.add_uint8(_pbuffer->get_format()); + } } //////////////////////////////////////////////////////////////////// @@ -456,6 +464,16 @@ fillin(DatagramIterator &scan, BamReader *manager) { _magfilteralpha = (enum FilterType) scan.get_uint8(); _anisotropic_degree = scan.get_int16(); + + if (scan.get_remaining_size() > 0) { + bool has_pbuffer = scan.get_bool(); + if (has_pbuffer) { + PixelBuffer::Format format = (PixelBuffer::Format)scan.get_uint8(); + if (_pbuffer != (PixelBuffer *)NULL) { + _pbuffer->set_format(format); + } + } + } } ////////////////////////////////////////////////////////////////////