Browse Source

fix LODNode startup

David Rose 19 years ago
parent
commit
97fbcbd507
2 changed files with 10 additions and 5 deletions
  1. 6 1
      panda/src/pgraph/lodNode.I
  2. 4 4
      panda/src/putil/updateSeq.I

+ 6 - 1
panda/src/pgraph/lodNode.I

@@ -292,6 +292,7 @@ CData(const LODNode::CData &copy) :
   _switch_vector(copy._switch_vector),
   _lowest(copy._lowest),
   _highest(copy._highest),
+  _bounds_seq(UpdateSeq::old()),
   _got_force_switch(copy._got_force_switch),
   _force_switch(copy._force_switch),
   _num_shown(copy._num_shown)
@@ -304,7 +305,11 @@ CData(const LODNode::CData &copy) :
 //  Description:
 ////////////////////////////////////////////////////////////////////
 INLINE LODNode::Switch::
-Switch(float in, float out) : _shown(false) {
+Switch(float in, float out) : 
+  _shown(false),
+  _bounds_seq(UpdateSeq::old()),
+  _verify_ok(false)
+{
   set_range(in, out);
 }
 

+ 4 - 4
panda/src/putil/updateSeq.I

@@ -208,7 +208,7 @@ operator ++ () {
   if (priv_is_special(new_seq)) {
     // Oops, wraparound.  We don't want to confuse the new value
     // with our special cases.
-    new_seq = (PN_int32)SC_old;
+    new_seq = (PN_int32)SC_old + 1;
   }
 
 #ifdef HAVE_THREADS
@@ -220,7 +220,7 @@ operator ++ () {
     if (priv_is_special(new_seq)) {
       // Oops, wraparound.  We don't want to confuse the new value
       // with our special cases.
-      new_seq = (PN_int32)SC_old;
+      new_seq = (PN_int32)SC_old + 1;
     }
     result = AtomicAdjust::compare_and_exchange(_seq, old_seq, new_seq);
   }
@@ -243,7 +243,7 @@ operator ++ (int) {
   if (priv_is_special(new_seq)) {
     // Oops, wraparound.  We don't want to confuse the new value
     // with our special cases.
-    new_seq = (PN_int32)SC_old;
+    new_seq = (PN_int32)SC_old + 1;
   }
 
 #ifdef HAVE_THREADS
@@ -255,7 +255,7 @@ operator ++ (int) {
     if (priv_is_special(new_seq)) {
       // Oops, wraparound.  We don't want to confuse the new value
       // with our special cases.
-      new_seq = (PN_int32)SC_old;
+      new_seq = (PN_int32)SC_old + 1;
     }
     result = AtomicAdjust::compare_and_exchange(_seq, old_seq, new_seq);
   }