record Texture::pad_size in bam cache too

This commit is contained in:
David Rose 2012-01-22 21:19:59 +00:00
parent 75a00f9553
commit deb8a56b8a
2 changed files with 16 additions and 2 deletions

View File

@ -7146,6 +7146,11 @@ do_write_datagram_rawdata(CData *cdata, BamWriter *manager, Datagram &me) {
me.add_uint32(cdata->_x_size); me.add_uint32(cdata->_x_size);
me.add_uint32(cdata->_y_size); me.add_uint32(cdata->_y_size);
me.add_uint32(cdata->_z_size); me.add_uint32(cdata->_z_size);
me.add_uint32(cdata->_pad_x_size);
me.add_uint32(cdata->_pad_y_size);
me.add_uint32(cdata->_pad_z_size);
me.add_uint32(cdata->_num_views); me.add_uint32(cdata->_num_views);
me.add_uint8(cdata->_component_type); me.add_uint8(cdata->_component_type);
me.add_uint8(cdata->_component_width); me.add_uint8(cdata->_component_width);
@ -7384,6 +7389,15 @@ do_fillin_rawdata(CData *cdata, DatagramIterator &scan, BamReader *manager) {
cdata->_x_size = scan.get_uint32(); cdata->_x_size = scan.get_uint32();
cdata->_y_size = scan.get_uint32(); cdata->_y_size = scan.get_uint32();
cdata->_z_size = scan.get_uint32(); cdata->_z_size = scan.get_uint32();
if (manager->get_file_minor_ver() >= 30) {
cdata->_pad_x_size = scan.get_uint32();
cdata->_pad_y_size = scan.get_uint32();
cdata->_pad_z_size = scan.get_uint32();
} else {
do_set_pad_size(cdata, 0, 0, 0);
}
cdata->_num_views = 1; cdata->_num_views = 1;
if (manager->get_file_minor_ver() >= 26) { if (manager->get_file_minor_ver() >= 26) {
cdata->_num_views = scan.get_uint32(); cdata->_num_views = scan.get_uint32();
@ -7419,7 +7433,6 @@ do_fillin_rawdata(CData *cdata, DatagramIterator &scan, BamReader *manager) {
cdata->_ram_images[n]._image = image; cdata->_ram_images[n]._image = image;
} }
cdata->_loaded_from_image = true; cdata->_loaded_from_image = true;
do_set_pad_size(cdata, 0, 0, 0);
++(cdata->_image_modified); ++(cdata->_image_modified);
} }

View File

@ -33,7 +33,7 @@ static const unsigned short _bam_major_ver = 6;
// Bumped to major version 6 on 2/11/06 to factor out PandaNode::CData. // Bumped to major version 6 on 2/11/06 to factor out PandaNode::CData.
static const unsigned short _bam_first_minor_ver = 14; static const unsigned short _bam_first_minor_ver = 14;
static const unsigned short _bam_minor_ver = 29; static const unsigned short _bam_minor_ver = 30;
// Bumped to minor version 14 on 12/19/07 to change default ColorAttrib. // Bumped to minor version 14 on 12/19/07 to change default ColorAttrib.
// Bumped to minor version 15 on 4/9/08 to add TextureAttrib::_implicit_sort. // Bumped to minor version 15 on 4/9/08 to add TextureAttrib::_implicit_sort.
// Bumped to minor version 16 on 5/13/08 to add Texture::_quality_level. // Bumped to minor version 16 on 5/13/08 to add Texture::_quality_level.
@ -50,6 +50,7 @@ static const unsigned short _bam_minor_ver = 29;
// Bumped to minor version 27 on 10/9/11 to add stdfloat_double. // Bumped to minor version 27 on 10/9/11 to add stdfloat_double.
// Bumped to minor version 28 on 11/28/11 to add Texture::_auto_texture_scale. // Bumped to minor version 28 on 11/28/11 to add Texture::_auto_texture_scale.
// Bumped to minor version 29 on 12/17/11 to add GeomVertexColumn::_column_alignment. // Bumped to minor version 29 on 12/17/11 to add GeomVertexColumn::_column_alignment.
// Bumped to minor version 30 on 1/22/12 to add Texture::_pad_*_size.
#endif #endif