Changeset 8758 in orxonox.OLD for branches/fontdata/src/lib/graphics/text_engine/font.cc
- Timestamp:
- Jun 23, 2006, 10:20:35 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/fontdata/src/lib/graphics/text_engine/font.cc
r8757 r8758 50 50 this->loadFontFromTTF(fontFile, renderSize); 51 51 } 52 52 53 53 54 /** … … 108 109 { } 109 110 111 Font& Font::operator=(const Font& font) 112 { 113 this->data = font.data; 114 this->setDiffuseMap(font.data->texData); 115 116 return *this; 117 }; 118 119 110 120 /** 111 121 * @brief initializes a Font (with default values) … … 113 123 void Font::init() 114 124 { 125 this->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 126 115 127 this->setClassID(CL_FONT, "Font"); 116 128 if (Font::defaultFontData.get() == NULL) … … 152 164 { 153 165 this->setStyle("c"); 154 this->createFastTexture(); 155 if (this->getTexture() != 0) 166 if (this->createFastTexture()) 156 167 return true; 157 168 else … … 186 197 if (newSurf != NULL) 187 198 { 188 this->data-> setSurface(newSurf);189 this->data-> setAlpha(hasAlpha);190 this-> data->setTexture(Texture::loadTexToGL(newSurf));199 this->data->texData->setSurface(newSurf); 200 this->data->texData->setAlpha(hasAlpha); 201 this->setTexture(Texture::loadTexToGL(newSurf)); 191 202 } 192 203 else … … 479 490 // sprintf( outName, "%s-glyphs.bmp", this->getName()); 480 491 // SDL_SaveBMP(tmpSurf, outName); 481 this->data-> setAlpha(true);482 if (this->data-> setSurface(tmpSurf))483 (this->data->setTexture(Texture::loadTexToGL(tmpSurf)));492 this->data->texData->setAlpha(true); 493 if (this->data->texData->setSurface(tmpSurf)) 494 this->setTexture(Texture::loadTexToGL(tmpSurf)); 484 495 return true; 485 496 } 497 498 /** 499 * @brief the Internal implementation of setting up the Texture. 500 * @param texture the Texture to load. 501 * @returns true on success, false otherwise. 502 */ 503 bool Font::setTexture(GLuint texture) 504 { 505 bool retVal = this->data->texData->setTexture(texture); 506 this->setDiffuseMap(data->texData, 0); 507 printf("this->texture %d\n", texture); 508 //printf(this->getT) 509 this->debug(); 510 return retVal; 511 }; 486 512 487 513 /** … … 577 603 void Font::debug() const 578 604 { 605 Material::debug(); 606 607 PRINT(0)("TEST %p and %p\n", this->data.get(), this->data->texData.get()); 579 608 // print the loaded font's style 580 609 int style = TTF_STYLE_NORMAL;
Note: See TracChangeset
for help on using the changeset viewer.