Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 14, 2008, 6:23:52 PM (16 years ago)
Author:
landauf
Message:

fixed an interesting bug in ObjectList/MetaObjectList/Iterator: it's now possible to delete multiple objects in one function-call while iterating through the objects. (and it would have crashed with std::list as well, so no stupid comments please :D)

added a feature in Timer.cc, allowing timers to tick faster than orxonox. this is from core2-branch but got lost while merging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/tools/Timer.cc

    r1062 r1063  
    108108                // It's time to call the function
    109109                if (this->bLoop_)
    110                     // Q: Why '+=' and not '='? A: Think about it. It's more accurate like that. Seriously.
    111                     this->time_ += this->interval_;
     110                {
     111                    this->time_ += this->interval_; // Q: Why '+=' and not '='? A: Think about it. It's more accurate like that. Seriously.
     112                    while (this->time_ <= 0)
     113                    {
     114                        // The interval was shorter than one tick, so execute the function more than once
     115                        this->run();
     116                        this->time_ += this->interval_;
     117                    }
     118                }
    112119                else
    113120                    this->stopTimer(); // Stop the timer if we don't want to loop
     
    117124        }
    118125    }
    119 
    120126}
Note: See TracChangeset for help on using the changeset viewer.