Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3653 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Mar 25, 2005, 6:14:40 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: now using iterator in world instead of old construct. on my pc, there is now a speedup of about 1 fps! (instead of 1fps i ve now 2fps :)) )

Location:
orxonox/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/util/list.h

    r3652 r3653  
    7070
    7171template<class T>
    72 tIterator<T>::tIterator (listElement<T>* startElement)
     72inline tIterator<T>::tIterator (listElement<T>* startElement)
    7373{
    7474  this->currentEl = startElement;
     
    9292      return NULL;
    9393    }
     94  if( this->currentEl == this->firstEl)
     95    {
     96      this->currentEl = this->currentEl->next;
     97      return this->firstEl->curr;
     98    }
    9499  if( this->currentEl->next == NULL)
    95100    return NULL;
    96   return this->currentEl->next->curr;
     101  this->currentEl = this->currentEl->next;
     102  return this->currentEl->curr;
    97103}
    98104
     
    247253
    248254template<class T>
    249 tIterator<T>* tList<T>::getIterator()
     255inline tIterator<T>* tList<T>::getIterator()
    250256{
    251257  if( this->size == 0) return NULL;
  • orxonox/trunk/src/story_entities/world.cc

    r3646 r3653  
    574574  glLoadIdentity();
    575575
    576   entity = this->entities->enumerate();
     576  //entity = this->entities->enumerate();
     577  tIterator<WorldEntity>* iterator = this->entities->getIterator();
     578  entity = iterator->nextElement();
    577579  while( entity != NULL )
    578580    {
    579581      if( entity->bDraw ) entity->draw();
    580       entity = this->entities->nextElement();
    581     }
     582      //entity = this->entities->nextElement();
     583      entity = iterator->nextElement();
     584    }
     585  delete iterator;
    582586 
    583587  glCallList (objectList);
Note: See TracChangeset for help on using the changeset viewer.