Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3774 in orxonox.OLD for orxonox/branches/textEngine/src/lib/graphics


Ignore:
Timestamp:
Apr 11, 2005, 2:27:17 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/textEngine: debug() implemented

Location:
orxonox/branches/textEngine/src/lib/graphics/font
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/textEngine/src/lib/graphics/font/text_engine.cc

    r3773 r3774  
    149149   \todo FIX this is to slow/static
    150150*/
    151 void Text::draw(void)
     151void Text::draw(void) const
    152152{
    153153  // storing all the Transformation Matrices.
     
    225225}
    226226
     227/**
     228   \brief prints out some nice debug information about this text
     229*/
     230void Text::debug(void) const
     231{
     232  PRINT(0)("=== TEXT: %s ===\n", this->text);
     233  if (this->bindNode)
     234    PRINT(0)("is bind to %s; ref=%p\n", this->bindNode->getName(), this->bindNode);
     235  PRINT(0)("Relative Position: (%d::%d)\n", this->posSize.x, this->posSize.y);
     236  PRINT(0)("Color: %d %d %d\n", this->color.r, this->color.g, this->color.b);
     237}
    227238
    228239
     
    621632  // print the loaded font's style
    622633  int style;
    623   style=TTF_GetFontStyle(this->font);
     634  style = TTF_GetFontStyle(this->font);
    624635  PRINTF(0)("The font style is:");
    625636  if(style==TTF_STYLE_NORMAL)
     
    854865
    855866/**
    856    \brief draws all the Texts that have been initialized
    857 */
    858 void TextEngine::draw(void) const
     867   \brief deletes all the Text, and tries to delete all allocated fonts
     868*/
     869void TextEngine::flush(void)
    859870{
    860871  tIterator<Text>* textIterator = textList->getIterator();
     
    862873  while( text != NULL)
    863874    {
     875      delete text;
     876      text = textIterator->nextElement();
     877    }
     878  delete textIterator;
     879}
     880
     881/**
     882   \brief draws all the Texts that have been initialized
     883*/
     884void TextEngine::draw(void) const
     885{
     886  tIterator<Text>* textIterator = textList->getIterator();
     887  Text* text = textIterator->nextElement();
     888  while( text != NULL)
     889    {
    864890      text->draw();
    865891      text = textIterator->nextElement();
     
    867893  delete textIterator;
    868894}
     895
     896/**
     897   \brief outputs some nice Debug information
     898   
     899   \todo there should also be something outputted about Font
     900*/
     901void TextEngine::debug(void) const
     902{
     903  PRINT(0)("+-------------------------------+\n");
     904  PRINT(0)("+ TEXT ENGINE DEBUG INFORMATION +\n");
     905  PRINT(0)("+-------------------------------+\n");
     906  PRINT(0)("Reference: %p; Text Counts: %d\n", this, this->textList->getSize());
     907 
     908  tIterator<Text>* textIterator = textList->getIterator();
     909  Text* text = textIterator->nextElement();
     910  while( text != NULL)
     911    {
     912      text->debug();
     913      text = textIterator->nextElement();
     914    }
     915  delete textIterator;
     916  PRINT(0)("+---------------------------TE--+\n");
     917}
     918
    869919
    870920/**
  • orxonox/branches/textEngine/src/lib/graphics/font/text_engine.h

    r3773 r3774  
    107107  void createTexture();
    108108
    109   // Dynamic Text
    110  
    111 
    112 
    113   virtual void draw(void);
     109  void draw(void) const;
     110 
     111  void debug(void) const;
    114112
    115113 private:
     
    202200 
    203201  void deleteText(Text* text);
     202  void flush(void);
    204203
    205204  void draw(void) const;
    206205 
     206  void debug(void) const;
     207
    207208 private:
    208209  TextEngine(void);
Note: See TracChangeset for help on using the changeset viewer.