Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5779 in orxonox.OLD for trunk/src/lib/graphics


Ignore:
Timestamp:
Nov 26, 2005, 2:20:58 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: ClassList is now in std::list style
ShellCommand is now in std::list style

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/text_engine/text_engine.cc

    r5515 r5779  
    6464{
    6565  // first remove all the remaining Texts (if any).
    66   tList<BaseObject>* textList = ClassList::getList(CL_TEXT);
     66  std::list<BaseObject*>* textList = ClassList::getList(CL_TEXT);
    6767  if (textList != NULL)
    6868  {
    69     tIterator<BaseObject>* textIterator = textList->getIterator();
    70     Text* text = dynamic_cast<Text*>(textIterator->firstElement());
    71     while( text != NULL)
     69    while(textList->size() > 0)
    7270    {
    73       delete text;
    74       text = dynamic_cast<Text*>(textIterator->nextElement());
     71      delete dynamic_cast<Text*>(textList->front());
    7572    }
    76     delete textIterator;
    7773  }
    7874  // delete all remaining fonts (There should not be Anything to do here)
    79   tList<BaseObject>* fontList = ClassList::getList(CL_FONT);
     75  std::list<BaseObject*>* fontList = ClassList::getList(CL_FONT);
    8076  if (fontList != NULL)
    8177  {
    82     tIterator<BaseObject>* fontIterator = fontList->getIterator();
    83     Font* font = dynamic_cast<Font*>(fontIterator->firstElement());
    84     while( font != NULL)
     78//    while (fontList->size() > 0)
    8579    {
     80      Font* font = dynamic_cast<Font*>(fontList->front());
    8681      if (likely(font != Font::getDefaultFont()))
    8782        ResourceManager::getInstance()->unload(font, RP_GAME);
    88       font = dynamic_cast<Font*>(fontIterator->nextElement());
    8983    }
    90     delete fontIterator;
    9184  }
    92 
    9385  this->disableFonts();
    9486
     
    133125void TextEngine::debug() const
    134126{
    135   tList<BaseObject>* textList = ClassList::getList(CL_TEXT);
     127  list<BaseObject*>* textList = ClassList::getList(CL_TEXT);
    136128  if (textList != NULL)
    137129  {
     
    139131    PRINT(0)("+ TEXT ENGINE DEBUG INFORMATION +\n");
    140132    PRINT(0)("+-------------------------------+\n");
    141     PRINT(0)("Reference: %p; Text Counts: %d\n", this, textList->getSize());
     133    PRINT(0)("Reference: %p; Text Counts: %d\n", this, textList->size());
    142134
    143     tIterator<BaseObject>* textIterator = textList->getIterator();
    144     Text* text = dynamic_cast<Text*>(textIterator->firstElement());
    145     while( text != NULL)
    146       {
    147         text->debug();
    148         text = dynamic_cast<Text*>(textIterator->nextElement());
    149       }
    150     delete textIterator;
     135    list<BaseObject*>::iterator text;
     136    for ( text = textList->begin(); text != textList->end(); text++)
     137      dynamic_cast<Text*>(*text)->debug();
    151138    PRINT(0)("+---------------------------TE--+\n");
    152139  }
Note: See TracChangeset for help on using the changeset viewer.