Browse Source

bam: Add forward compatibility for bam 6.46

See #1657 and 052bd770300f407b11a428f3cfb74e24515abdd1
rdb 4 months ago
parent
commit
66c9264f30
2 changed files with 10 additions and 1 deletions
  1. 8 0
      panda/src/pgraph/modelRoot.cxx
  2. 2 1
      panda/src/putil/bam.h

+ 8 - 0
panda/src/pgraph/modelRoot.cxx

@@ -41,6 +41,10 @@ register_with_read_factory() {
 void ModelRoot::
 void ModelRoot::
 write_datagram(BamWriter *manager, Datagram &dg) {
 write_datagram(BamWriter *manager, Datagram &dg) {
   ModelNode::write_datagram(manager, dg);
   ModelNode::write_datagram(manager, dg);
+
+  if (manager->get_file_minor_ver() >= 46) {
+    manager->write_handle(dg, TypeHandle::none());
+  }
 }
 }
 
 
 /**
 /**
@@ -67,4 +71,8 @@ make_from_bam(const FactoryParams &params) {
 void ModelRoot::
 void ModelRoot::
 fillin(DatagramIterator &scan, BamReader *manager) {
 fillin(DatagramIterator &scan, BamReader *manager) {
   ModelNode::fillin(scan, manager);
   ModelNode::fillin(scan, manager);
+
+  if (manager->get_file_minor_ver() >= 46) {
+    manager->read_handle(scan);
+  }
 }
 }

+ 2 - 1
panda/src/putil/bam.h

@@ -32,7 +32,7 @@ static const unsigned short _bam_major_ver = 6;
 // Bumped to major version 6 on 2006-02-11 to factor out PandaNode::CData.
 // Bumped to major version 6 on 2006-02-11 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_last_minor_ver = 45;
+static const unsigned short _bam_last_minor_ver = 46;
 static const unsigned short _bam_minor_ver = 44;
 static const unsigned short _bam_minor_ver = 44;
 // Bumped to minor version 14 on 2007-12-19 to change default ColorAttrib.
 // Bumped to minor version 14 on 2007-12-19 to change default ColorAttrib.
 // Bumped to minor version 15 on 2008-04-09 to add TextureAttrib::_implicit_sort.
 // Bumped to minor version 15 on 2008-04-09 to add TextureAttrib::_implicit_sort.
@@ -66,5 +66,6 @@ static const unsigned short _bam_minor_ver = 44;
 // Bumped to minor version 43 on 2018-12-06 to expand BillboardEffect and CompassEffect.
 // Bumped to minor version 43 on 2018-12-06 to expand BillboardEffect and CompassEffect.
 // Bumped to minor version 44 on 2018-12-23 to rename CollisionTube to CollisionCapsule.
 // Bumped to minor version 44 on 2018-12-23 to rename CollisionTube to CollisionCapsule.
 // Bumped to minor version 45 on 2020-03-18 to add Texture::_clear_color.
 // Bumped to minor version 45 on 2020-03-18 to add Texture::_clear_color.
+// Bumped to minor version 46 on 2025-08-03 to add ModelRoot::_loader_type.
 
 
 #endif
 #endif