Browse Source

support backward compatibility

David Rose 23 years ago
parent
commit
7117ac1d72

+ 2 - 1
pandatool/src/egg-palettize/palettizer.cxx

@@ -41,13 +41,14 @@ 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 = 6;
+int Palettizer::_pi_version = 7;
 // Updated to version 1 on 12/11/00 to add _remap_char_uv.
 // Updated to version 2 on 12/19/00 to add TexturePlacement::_dest.
 // Updated to version 3 on 12/19/00 to add PaletteGroup::_dependency_order.
 // Updated to version 4 on 5/3/01 to add PaletteGroup::_dirname_order.
 // Updated to version 5 on 10/31/01 to add TextureProperties::_force_format.
 // Updated to version 6 on 3/14/02 to add TextureImage::_alpha_mode.
+// Updated to version 7 on 8/23/02 to add TextureProperties::_anisotropic_degree.
 
 int Palettizer::_read_pi_version = 0;
 

+ 5 - 1
pandatool/src/egg-palettize/textureProperties.cxx

@@ -709,7 +709,11 @@ fillin(DatagramIterator &scan, BamReader *manager) {
   }
   _minfilter = (EggTexture::FilterType)scan.get_int32();
   _magfilter = (EggTexture::FilterType)scan.get_int32();
-  _anisotropic_degree = scan.get_int32();
+  if (Palettizer::_read_pi_version >= 7) {
+    _anisotropic_degree = scan.get_int32();
+  } else {
+    _anisotropic_degree = 0;
+  }
   manager->read_pointer(scan);  // _color_type
   manager->read_pointer(scan);  // _alpha_type
 }