Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 3, 2006, 12:19:30 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

File:
1 edited

Legend:

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

    r9406 r9869  
    3333
    3434#include "graphics_engine.h"
    35 #include "util/loading/resource_manager.h"
    36 #include "class_list.h"
    3735
    3836#include "debug.h"
     
    4038/// TEXT-ENGINE ///
    4139///////////////////
     40ObjectListDefinition(TextEngine);
    4241/**
    4342 *  standard constructor
     
    4544TextEngine::TextEngine ()
    4645{
    47    this->setClassID(CL_TEXT_ENGINE, "TextEngine");
    48    this->setName("TextEngine");
    49    this->enableFonts();
     46  this->registerObject(this, TextEngine::_objectList);
     47  this->setName("TextEngine");
     48  this->enableFonts();
    5049}
    5150
     
    6261{
    6362  // first remove all the remaining Texts (if any).
    64   const std::list<BaseObject*>* textList = ClassList::getList(CL_TEXT);
    65   if (textList != NULL)
    66   {
    67     while(textList->size() > 0)
    68       delete dynamic_cast<Text*>(textList->front());
    69   }
     63  while (!Text::objectList().empty())
     64    delete Text::objectList().front();
    7065  // delete all remaining fonts (There should not be Anything to do here)
    71   const std::list<BaseObject*>* fontList = ClassList::getList(CL_FONT);
    72   if (fontList != NULL)
     66
     67  //const std::list<BaseObject*>* fontList = ClassList::getList(CL_FONT);
     68  //if (fontList != NULL)
    7369  {
    7470    ///FIXME
    75 //    while (fontList->size() > 0)
     71    //    while (fontList->size() > 0)
    7672    {
    77 //      Font* font = dynamic_cast<Font*>(fontList->back());
     73      //      Font* font = dynamic_cast<Font*>(fontList->back());
    7874      //if (likely(font != Font::getDefaultFont()))
    7975      //        ResourceManager::getInstance()->unload(font, RP_GAME);
     
    9187{
    9288  if (!TTF_WasInit())
    93     {
    94       if(TTF_Init()==-1)
    95         PRINTF(1)("TTF_Init: %s\n", TTF_GetError());
     89  {
     90    if(TTF_Init()==-1)
     91      PRINTF(1)("TTF_Init: %s\n", TTF_GetError());
    9692
    97       TextEngine::checkVersion();
    98     }
     93    TextEngine::checkVersion();
     94  }
    9995  else
    10096    PRINTF(4)("Fonts already initialized\n");
     
    107103{
    108104  if (TTF_WasInit())
    109     {
    110 //      Font::removeDefaultFont();
    111       TTF_Quit();
    112     }
     105  {
     106    //      Font::removeDefaultFont();
     107    TTF_Quit();
     108  }
    113109  else
    114110    PRINTF(4)("Fonts were not initialized.\n");
     
    122118void TextEngine::debug() const
    123119{
    124   const std::list<BaseObject*>* textList = ClassList::getList(CL_TEXT);
    125   if (textList != NULL)
     120  PRINT(0)("+-------------------------------+\n");
     121  PRINT(0)("+ TEXT ENGINE DEBUG INFORMATION +\n");
     122  PRINT(0)("+-------------------------------+\n");
     123  PRINT(0)("Reference: %p; Text Counts: %d\n", this, Text::objectList().size());
     124
     125  for (ObjectList<Text>::const_iterator it = Text::objectList().begin();
     126       it != Text::objectList().end();
     127       ++it)
    126128  {
    127     PRINT(0)("+-------------------------------+\n");
    128     PRINT(0)("+ TEXT ENGINE DEBUG INFORMATION +\n");
    129     PRINT(0)("+-------------------------------+\n");
    130     PRINT(0)("Reference: %p; Text Counts: %d\n", this, textList->size());
    131 
    132     std::list<BaseObject*>::const_iterator text;
    133     for ( text = textList->begin(); text != textList->end(); text++)
    134       dynamic_cast<Text*>(*text)->debug();
     129      (*it)->debug();
    135130    PRINT(0)("+---------------------------TE--+\n");
    136131  }
     
    152147      compile_version.minor == link_version.minor &&
    153148      compile_version.patch == link_version.patch)
    154     {
    155       return true;
    156     }
     149  {
     150    return true;
     151  }
    157152  else
    158     {
    159       PRINTF(2)("compiled with SDL_ttf version: %d.%d.%d\n",
    160                 compile_version.major,
    161                 compile_version.minor,
    162                 compile_version.patch);
     153  {
     154    PRINTF(2)("compiled with SDL_ttf version: %d.%d.%d\n",
     155              compile_version.major,
     156              compile_version.minor,
     157              compile_version.patch);
    163158
    164       PRINTF(2)("running with SDL_ttf version: %d.%d.%d\n",
    165                 link_version.major,
    166                 link_version.minor,
    167                 link_version.patch);
    168       return false;
    169     }
     159    PRINTF(2)("running with SDL_ttf version: %d.%d.%d\n",
     160              link_version.major,
     161              link_version.minor,
     162              link_version.patch);
     163    return false;
     164  }
    170165}
Note: See TracChangeset for help on using the changeset viewer.