From 13ac178d229cefc1ecc7049f27484dcb1f63e0b5 Mon Sep 17 00:00:00 2001 From: Zachary Pavlov Date: Thu, 16 Jul 2009 23:46:09 +0000 Subject: [PATCH] final part for the new margin override on palettes --- pandatool/src/palettizer/paletteGroup.cxx | 6 ++++-- pandatool/src/palettizer/palettizer.cxx | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pandatool/src/palettizer/paletteGroup.cxx b/pandatool/src/palettizer/paletteGroup.cxx index bb556e61a2..e6124bfc71 100644 --- a/pandatool/src/palettizer/paletteGroup.cxx +++ b/pandatool/src/palettizer/paletteGroup.cxx @@ -774,6 +774,8 @@ fillin(DatagramIterator &scan, BamReader *manager) { _num_pages = scan.get_uint32(); manager->read_pointers(scan, _num_pages); - _has_margin_override = scan.get_bool(); - _margin_override = scan.get_int16(); + if(Palettizer::_read_pi_version >= 19) { + _has_margin_override = scan.get_bool(); + _margin_override = scan.get_int16(); + } } diff --git a/pandatool/src/palettizer/palettizer.cxx b/pandatool/src/palettizer/palettizer.cxx index 13e0b14468..e374cbb0b1 100644 --- a/pandatool/src/palettizer/palettizer.cxx +++ b/pandatool/src/palettizer/palettizer.cxx @@ -37,7 +37,7 @@ Palettizer *pal = (Palettizer *)NULL; // allows us to easily update egg-palettize to write out additional // information to its pi file, without having it increment the bam // version number for all bam and boo files anywhere in the world. -int Palettizer::_pi_version = 18; +int Palettizer::_pi_version = 19; // Updated to version 8 on 3/20/03 to remove extensions from texture key names. // Updated to version 9 on 4/13/03 to add a few properties in various places. // Updated to version 10 on 4/15/03 to add _alpha_file_channel. @@ -49,6 +49,8 @@ int Palettizer::_pi_version = 18; // Updated to version 16 on 4/03/06 to add Palettizer::_cutout_mode et al. // Updated to version 17 on 3/02/07 to add TextureImage::_txa_wrap_u etc. // Updated to version 18 on 5/13/08 to add TextureProperties::_quality_level. +// Updated to version 19 on 7/16/09 to add PaletteGroup::_override_margin + int Palettizer::_min_pi_version = 8; // Dropped support for versions 7 and below on 7/14/03.