[Orxonox-commit 1690] r6408 - code/branches/presentation2/src/orxonox/gamestates
rgrieder at orxonox.net
rgrieder at orxonox.net
Thu Dec 24 08:49:57 CET 2009
Author: rgrieder
Date: 2009-12-24 08:49:57 +0100 (Thu, 24 Dec 2009)
New Revision: 6408
Modified:
code/branches/presentation2/src/orxonox/gamestates/GSRoot.cc
Log:
Main loop optimisations.
Modified: code/branches/presentation2/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- code/branches/presentation2/src/orxonox/gamestates/GSRoot.cc 2009-12-23 21:03:08 UTC (rev 6407)
+++ code/branches/presentation2/src/orxonox/gamestates/GSRoot.cc 2009-12-24 07:49:57 UTC (rev 6408)
@@ -90,7 +90,11 @@
void GSRoot::update(const Clock& time)
{
for (ObjectList<Timer>::iterator it = ObjectList<Timer>::begin(); it; )
- (it++)->tick(time);
+ {
+ Timer* object = *it;
+ ++it;
+ object->tick(time);
+ }
/*** HACK *** HACK ***/
// Call the Tickable objects
@@ -100,8 +104,13 @@
// just loaded
leveldt = 0.0f;
}
+ float realdt = leveldt * TimeFactorListener::getTimeFactor();
for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; )
- (it++)->tick(leveldt * TimeFactorListener::getTimeFactor());
+ {
+ Tickable* object = *it;
+ ++it;
+ object->tick(realdt);
+ }
/*** HACK *** HACK ***/
}
More information about the Orxonox-commit
mailing list