Changeset 5779 in orxonox.OLD for trunk/src/lib/graphics/text_engine
- Timestamp:
- Nov 26, 2005, 2:20:58 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/text_engine/text_engine.cc
r5515 r5779 64 64 { 65 65 // 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); 67 67 if (textList != NULL) 68 68 { 69 tIterator<BaseObject>* textIterator = textList->getIterator(); 70 Text* text = dynamic_cast<Text*>(textIterator->firstElement()); 71 while( text != NULL) 69 while(textList->size() > 0) 72 70 { 73 delete text; 74 text = dynamic_cast<Text*>(textIterator->nextElement()); 71 delete dynamic_cast<Text*>(textList->front()); 75 72 } 76 delete textIterator;77 73 } 78 74 // 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); 80 76 if (fontList != NULL) 81 77 { 82 tIterator<BaseObject>* fontIterator = fontList->getIterator(); 83 Font* font = dynamic_cast<Font*>(fontIterator->firstElement()); 84 while( font != NULL) 78 // while (fontList->size() > 0) 85 79 { 80 Font* font = dynamic_cast<Font*>(fontList->front()); 86 81 if (likely(font != Font::getDefaultFont())) 87 82 ResourceManager::getInstance()->unload(font, RP_GAME); 88 font = dynamic_cast<Font*>(fontIterator->nextElement());89 83 } 90 delete fontIterator;91 84 } 92 93 85 this->disableFonts(); 94 86 … … 133 125 void TextEngine::debug() const 134 126 { 135 tList<BaseObject>* textList = ClassList::getList(CL_TEXT);127 list<BaseObject*>* textList = ClassList::getList(CL_TEXT); 136 128 if (textList != NULL) 137 129 { … … 139 131 PRINT(0)("+ TEXT ENGINE DEBUG INFORMATION +\n"); 140 132 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()); 142 134 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(); 151 138 PRINT(0)("+---------------------------TE--+\n"); 152 139 }
Note: See TracChangeset
for help on using the changeset viewer.