Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5341 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Oct 9, 2005, 11:44:40 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: init-function of Font

Location:
trunk/src/lib/graphics
Files:
2 edited

Legend:

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

    r5340 r5341  
    260260    {
    261261      Glyph** glyphArray;
    262       if (false /*likely (this->font != NULL)*/)
     262      if (likely (this->font != NULL))
    263263      {
    264264        glyphArray = this->font->getGlyphArray();
     
    438438Font::Font(const char* fontFile, unsigned int fontSize)
    439439{
    440   this->setClassID(CL_FONT, "Font");
    441   // setting default values.
    442   this->font = NULL;
    443   this->glyphArray = NULL;
    444   this->fastTextureID = 0;
     440  this->init();
    445441
    446442  this->setSize(fontSize);
     
    464460Font::Font(char** xpmArray)
    465461{
    466   this->setClassID(CL_FONT, "Font");
    467   // setting default values.
    468   this->font = NULL;
    469   this->glyphArray = NULL;
    470   this->fastTextureID = 0;
    471 
    472 //  this->setSize(fontSize);
     462  this->init();
     463
     464  //  this->setSize(fontSize);
    473465  SDL_Surface* image = NULL;
    474466  if (xpmArray != NULL)
     
    509501  if (likely(this->font != NULL))
    510502    TTF_CloseFont(this->font);
     503}
     504
     505/**
     506 * initializes a Font (with default values)
     507 */
     508void Font::init()
     509{
     510    this->setClassID(CL_FONT, "Font");
     511  // setting default values.
     512  this->font = NULL;
     513  this->glyphArray = NULL;
     514  this->fastTextureID = 0;
    511515}
    512516
  • trunk/src/lib/graphics/text_engine.h

    r5340 r5341  
    166166       unsigned int fontSize = FONT_DEFAULT_SIZE);
    167167  Font(char** xpmArray);
    168 
    169168  virtual ~Font();
     169
     170  void init();
    170171
    171172  // font
Note: See TracChangeset for help on using the changeset viewer.