bam: Add forward compatibility for bam 6.46

See #1657 and 052bd77030
This commit is contained in:
rdb 2025-08-03 11:59:28 +02:00
parent ab357ea120
commit 66c9264f30
2 changed files with 10 additions and 1 deletions

View File

@ -41,6 +41,10 @@ register_with_read_factory() {
void ModelRoot::
write_datagram(BamWriter *manager, Datagram &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::
fillin(DatagramIterator &scan, BamReader *manager) {
ModelNode::fillin(scan, manager);
if (manager->get_file_minor_ver() >= 46) {
manager->read_handle(scan);
}
}

View File

@ -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.
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;
// 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.
@ -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 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 46 on 2025-08-03 to add ModelRoot::_loader_type.
#endif