mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
fix reading bams 4.18
This commit is contained in:
parent
a3702b8a8f
commit
71cb47f94c
@ -1032,10 +1032,24 @@ make_from_bam(const FactoryParams ¶ms) {
|
||||
|
||||
parse_params(params, scan, manager);
|
||||
object->fillin(scan, manager);
|
||||
manager->register_finalize(object);
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: qpGeom::finalize
|
||||
// Access: Public, Virtual
|
||||
// Description: Called by the BamReader to perform any final actions
|
||||
// needed for setting up the object after all objects
|
||||
// have been read and all pointers have been completed.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void qpGeom::
|
||||
finalize(BamReader *manager) {
|
||||
CDWriter cdata(_cycler);
|
||||
reset_geom_rendering(cdata);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: qpGeom::fillin
|
||||
// Access: Protected
|
||||
@ -1122,6 +1136,9 @@ write_datagram(BamWriter *manager, Datagram &dg) const {
|
||||
|
||||
dg.add_uint8(_primitive_type);
|
||||
dg.add_uint8(_shade_model);
|
||||
|
||||
// Actually, we shouldn't bother writing out _geom_rendering; we'll
|
||||
// just throw it away anyway.
|
||||
dg.add_uint16(_geom_rendering);
|
||||
}
|
||||
|
||||
@ -1166,7 +1183,11 @@ fillin(DatagramIterator &scan, BamReader *manager) {
|
||||
|
||||
_primitive_type = (PrimitiveType)scan.get_uint8();
|
||||
_shade_model = (ShadeModel)scan.get_uint8();
|
||||
_geom_rendering = scan.get_uint16();
|
||||
|
||||
// To be removed: we no longer read _geom_rendering from the bam
|
||||
// file; instead, we rederive it in finalize().
|
||||
scan.get_uint16();
|
||||
|
||||
_got_usage_hint = false;
|
||||
_modified = qpGeom::get_next_modified();
|
||||
}
|
||||
|
@ -198,6 +198,8 @@ public:
|
||||
static void register_with_read_factory();
|
||||
virtual void write_datagram(BamWriter *manager, Datagram &dg);
|
||||
|
||||
virtual void finalize(BamReader *manager);
|
||||
|
||||
protected:
|
||||
static TypedWritable *make_from_bam(const FactoryParams ¶ms);
|
||||
void fillin(DatagramIterator &scan, BamReader *manager);
|
||||
|
Loading…
x
Reference in New Issue
Block a user