Browse Source

release write locks after writing

David Rose 18 years ago
parent
commit
79474cfdf6

+ 8 - 6
panda/src/particlesystem/baseParticleFactory.cxx

@@ -25,12 +25,13 @@
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 BaseParticleFactory::
 BaseParticleFactory::
 BaseParticleFactory() : 
 BaseParticleFactory() : 
+  _lifespan_base(1.0),
+  _lifespan_spread(0.0),
   _mass_base(1.0f),
   _mass_base(1.0f),
   _mass_spread(0.0f),
   _mass_spread(0.0f),
   _terminal_velocity_base(PhysicsObject::_default_terminal_velocity),
   _terminal_velocity_base(PhysicsObject::_default_terminal_velocity),
-  _terminal_velocity_spread(0.0f),
-  _lifespan_base(1.0),
-  _lifespan_spread(0.0) {
+  _terminal_velocity_spread(0.0f)
+{
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -40,12 +41,13 @@ BaseParticleFactory() :
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 BaseParticleFactory::
 BaseParticleFactory::
 BaseParticleFactory(const BaseParticleFactory &copy) : 
 BaseParticleFactory(const BaseParticleFactory &copy) : 
+  _lifespan_base(copy._lifespan_base),
+  _lifespan_spread(copy._lifespan_spread),
   _mass_base(copy._mass_base),
   _mass_base(copy._mass_base),
   _mass_spread(copy._mass_spread),
   _mass_spread(copy._mass_spread),
   _terminal_velocity_base(copy._terminal_velocity_base),
   _terminal_velocity_base(copy._terminal_velocity_base),
-  _terminal_velocity_spread(copy._terminal_velocity_spread),
-  _lifespan_base(copy._lifespan_base),
-  _lifespan_spread(copy._lifespan_spread) {
+  _terminal_velocity_spread(copy._terminal_velocity_spread)
+{
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 1 - 0
panda/src/particlesystem/spriteParticleRenderer.cxx

@@ -733,6 +733,7 @@ render(pvector< PT(PhysicsObject) >& po_vector, int ttl_particles) {
   for (i = 0; i < anim_count; ++i) {
   for (i = 0; i < anim_count; ++i) {
     for (j = 0; j < _anim_size[i]; ++j) {
     for (j = 0; j < _anim_size[i]; ++j) {
       _sprites[i][j]->clear_vertices();
       _sprites[i][j]->clear_vertices();
+      _sprite_writer[i][j].clear();      
 
 
       // We have to reassign the GeomVertexData and GeomPrimitive to
       // We have to reassign the GeomVertexData and GeomPrimitive to
       // the Geom, and the Geom to the GeomNode, in case it got
       // the Geom, and the Geom to the GeomNode, in case it got

+ 8 - 0
panda/src/particlesystem/spriteParticleRenderer.h

@@ -56,6 +56,14 @@ public:
     aspect_ratio(copy.aspect_ratio) {
     aspect_ratio(copy.aspect_ratio) {
   };
   };
 
 
+  void clear() {
+    vertex.clear();
+    color.clear();
+    rotate.clear();
+    size.clear();
+    aspect_ratio.clear();
+  }
+
   GeomVertexWriter vertex;
   GeomVertexWriter vertex;
   GeomVertexWriter color;
   GeomVertexWriter color;
   GeomVertexWriter rotate;
   GeomVertexWriter rotate;