- Timestamp:
- Oct 9, 2005, 11:44:40 PM (19 years ago)
- Location:
- trunk/src/lib/graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/text_engine.cc
r5340 r5341 260 260 { 261 261 Glyph** glyphArray; 262 if ( false /*likely (this->font != NULL)*/)262 if (likely (this->font != NULL)) 263 263 { 264 264 glyphArray = this->font->getGlyphArray(); … … 438 438 Font::Font(const char* fontFile, unsigned int fontSize) 439 439 { 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(); 445 441 446 442 this->setSize(fontSize); … … 464 460 Font::Font(char** xpmArray) 465 461 { 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); 473 465 SDL_Surface* image = NULL; 474 466 if (xpmArray != NULL) … … 509 501 if (likely(this->font != NULL)) 510 502 TTF_CloseFont(this->font); 503 } 504 505 /** 506 * initializes a Font (with default values) 507 */ 508 void 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; 511 515 } 512 516 -
trunk/src/lib/graphics/text_engine.h
r5340 r5341 166 166 unsigned int fontSize = FONT_DEFAULT_SIZE); 167 167 Font(char** xpmArray); 168 169 168 virtual ~Font(); 169 170 void init(); 170 171 171 172 // font
Note: See TracChangeset
for help on using the changeset viewer.