From 4a0b5d3d7ea4ffb502a5b777795b6a07568f0fee Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 13 Dec 2001 23:28:12 +0000 Subject: [PATCH] bam version 3.5 --- panda/src/gobj/texture.cxx | 14 +++++++++----- panda/src/putil/bam.h | 3 ++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index 9d03829520..6426e6d6ae 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -463,7 +463,7 @@ clear_gsg(GraphicsStateGuardianBase *gsg) { //////////////////////////////////////////////////////////////////// PixelBuffer *Texture:: get_ram_image() { - if (!has_ram_image()) { + if (!has_ram_image() && has_name()) { // Now we have to reload the texture image. gobj_cat.info() << "Reloading texture " << get_name() << "\n"; @@ -609,12 +609,18 @@ fillin(DatagramIterator &scan, BamReader *manager) { //Texture to know how the parent write_datagram works. And //makes the assumption that the only data being written is //the name - // scan.get_uint32(); // For historical purposes + + if (manager->get_file_minor_ver() < 5) { + // Obsolete parameter. + scan.get_uint32(); + } _wrapu = (enum WrapMode) scan.get_uint8(); _wrapv = (enum WrapMode) scan.get_uint8(); _minfilter = (enum FilterType) scan.get_uint8(); _magfilter = (enum FilterType) scan.get_uint8(); - // scan.get_uint16(); // placeholder for obsolete settings, remove this when you feel like bumping bam version number + if (manager->get_file_minor_ver() < 5) { + scan.get_uint16(); + } _anisotropic_degree = scan.get_int16(); if (scan.get_remaining_size() > 0) { @@ -646,12 +652,10 @@ fillin(DatagramIterator &scan, BamReader *manager) { void Texture:: write_datagram(BamWriter *manager, Datagram &me) { ImageBuffer::write_datagram(manager, me); - // me.add_uint32(0); // For historical purposes me.add_uint8(_wrapu); me.add_uint8(_wrapv); me.add_uint8(_minfilter); me.add_uint8(_magfilter); - // me.add_int16(0); // placeholder for obsolete settings, remove this when you feel like bumping bam version number me.add_int16(_anisotropic_degree); // We also need to write out the pixel buffer's format, even though diff --git a/panda/src/putil/bam.h b/panda/src/putil/bam.h index 2c3a04f1e7..df4fbf2021 100644 --- a/panda/src/putil/bam.h +++ b/panda/src/putil/bam.h @@ -32,12 +32,13 @@ static const unsigned short _bam_major_ver = 3; // Bumped to major version 2 on 7/6/00 due to major changes in Character. // Bumped to major version 3 on 12/8/00 to change float64's to float32's. -static const unsigned short _bam_minor_ver = 4; +static const unsigned short _bam_minor_ver = 5; // Bumped to minor version 1 on 12/15/00 to add FFT-style channel // compression. // Bumped to minor version 2 on 2/15/01 to add ModelNode::_preserve_transform. // Bumped to minor version 3 on 4/11/01 to support correctly ordered children. // Bumped to minor version 4 on 12/11/01 to transpose quaternions. +// Bumped to minor version 5 on 12/13/01 to remove obsolete fields from Texture. #endif