Browse Source

GeomVertexArrayData::get_modified() wasn't getting updated

David Rose 18 years ago
parent
commit
820a9fb99b

+ 5 - 18
panda/src/gobj/geomVertexArrayData.I

@@ -156,9 +156,9 @@ get_modified() const {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE CPT(GeomVertexArrayDataHandle) GeomVertexArrayData::
 INLINE CPT(GeomVertexArrayDataHandle) GeomVertexArrayData::
 get_handle(Thread *current_thread) const {
 get_handle(Thread *current_thread) const {
+  const CData *cdata = _cycler.read_unlocked(current_thread);
   return new GeomVertexArrayDataHandle(this, current_thread, 
   return new GeomVertexArrayDataHandle(this, current_thread, 
-                                       _cycler.read_unlocked(current_thread),
-                                       false);
+                                       cdata, false);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -172,9 +172,9 @@ get_handle(Thread *current_thread) const {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE PT(GeomVertexArrayDataHandle) GeomVertexArrayData::
 INLINE PT(GeomVertexArrayDataHandle) GeomVertexArrayData::
 modify_handle(Thread *current_thread) {
 modify_handle(Thread *current_thread) {
+  CData *cdata = _cycler.write_upstream(true, current_thread);
   return new GeomVertexArrayDataHandle(this, current_thread, 
   return new GeomVertexArrayDataHandle(this, current_thread, 
-                                       _cycler.write_upstream(true, current_thread),
-                                       true);
+                                       cdata, true);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -266,7 +266,7 @@ operator = (const GeomVertexArrayData::CData &copy) {
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: GeomVertexArrayDataHandle::Constructor
 //     Function: GeomVertexArrayDataHandle::Constructor
-//       Access: Public
+//       Access: Private
 //  Description:
 //  Description:
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE GeomVertexArrayDataHandle::
 INLINE GeomVertexArrayDataHandle::
@@ -377,19 +377,6 @@ get_read_pointer() const {
   return _cdata->_buffer.get_read_pointer();
   return _cdata->_buffer.get_read_pointer();
 }
 }
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: GeomVertexArrayDataHandle::get_write_pointer
-//       Access: Public
-//  Description: Returns a writable pointer to the beginning of the
-//               actual data stream.
-////////////////////////////////////////////////////////////////////
-INLINE unsigned char *GeomVertexArrayDataHandle::
-get_write_pointer() {
-  nassertr(_writable, NULL);
-  check_resident();
-  return _cdata->_buffer.get_write_pointer();
-}
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: GeomVertexArrayDataHandle::get_array_format
 //     Function: GeomVertexArrayDataHandle::get_array_format
 //       Access: Public
 //       Access: Public

+ 14 - 0
panda/src/gobj/geomVertexArrayData.cxx

@@ -636,6 +636,20 @@ fillin(DatagramIterator &scan, BamReader *manager, void *extra_data) {
   _modified = Geom::get_next_modified();
   _modified = Geom::get_next_modified();
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: GeomVertexArrayDataHandle::get_write_pointer
+//       Access: Public
+//  Description: Returns a writable pointer to the beginning of the
+//               actual data stream.
+////////////////////////////////////////////////////////////////////
+unsigned char *GeomVertexArrayDataHandle::
+get_write_pointer() {
+  nassertr(_writable, NULL);
+  check_resident();
+  _cdata->_modified = Geom::get_next_modified();
+  return _cdata->_buffer.get_write_pointer();
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: GeomVertexArrayDataHandle::set_num_rows
 //     Function: GeomVertexArrayDataHandle::set_num_rows
 //       Access: Public
 //       Access: Public

+ 1 - 1
panda/src/gobj/geomVertexArrayData.h

@@ -259,7 +259,7 @@ public:
   INLINE GeomVertexArrayData *get_object();
   INLINE GeomVertexArrayData *get_object();
 
 
   INLINE const unsigned char *get_read_pointer() const;
   INLINE const unsigned char *get_read_pointer() const;
-  INLINE unsigned char *get_write_pointer();
+  unsigned char *get_write_pointer();
 
 
 PUBLISHED:
 PUBLISHED:
   INLINE const GeomVertexArrayFormat *get_array_format() const;
   INLINE const GeomVertexArrayFormat *get_array_format() const;