Changeset 8761 in orxonox.OLD for trunk/src/lib/graphics/text_engine
- Timestamp:
- Jun 24, 2006, 2:16:12 AM (19 years ago)
- Location:
- trunk/src/lib/graphics/text_engine
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/text_engine/font.cc
r8751 r8761 17 17 18 18 #include "font.h" 19 #include "text.h"20 19 21 20 #ifdef HAVE_SDL_IMAGE_H … … 24 23 #include <SDL/SDL_image.h> 25 24 #endif 25 26 26 #include "default_font.xpm" 27 27 28 28 #include "debug.h" 29 #include "stdlibincl.h"30 29 #include "compiler.h" 31 using namespace std; 30 31 32 Font::Font() 33 : data(Font::defaultFontData) 34 { 35 this->init(); 36 37 } 32 38 33 39 /** … … 37 43 */ 38 44 Font::Font(const std::string& fontFile, unsigned int renderSize) 39 : data( new FontData())45 : data(Font::defaultFontData) 40 46 { 41 47 this->init(); 42 48 43 44 this->data->renderSize = renderSize;45 this->setStyle("c");46 47 49 if (!fontFile.empty()) 48 this->loadFontFromTTF(fontFile); 49 } 50 this->loadFontFromTTF(fontFile, renderSize); 51 } 52 50 53 51 54 /** … … 54 57 */ 55 58 Font::Font(const std::string& imageFile) 56 : data( new FontData())59 : data(Font::defaultFontData) 57 60 { 58 61 this->init(); 62 59 63 this->setName(imageFile); 60 64 // this->setSize(fontSize); … … 78 82 */ 79 83 Font::Font(char** xpmArray) 80 : data( new FontData())84 : data(Font::defaultFontData) 81 85 { 82 86 this->init(); … … 92 96 } 93 97 else 94 PRINTF(1)(" loading from surfacefailed: %s\n", IMG_GetError());98 PRINTF(1)("Loading from XPM-array failed: %s\n", IMG_GetError()); 95 99 } 96 100 … … 105 109 { } 106 110 111 Font& Font::operator=(const Font& font) 112 { 113 Material::operator=(font); 114 this->data = font.data; 115 116 return *this; 117 }; 118 119 107 120 /** 108 121 * @brief initializes a Font (with default values) … … 110 123 void Font::init() 111 124 { 125 this->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 126 112 127 this->setClassID(CL_FONT, "Font"); 113 } 114 128 if (Font::defaultFontData.get() == NULL) 129 { 130 Font::initDefaultFont(); 131 this->data = Font::defaultFontData; 132 } 133 } 134 135 FontDataPointer Font::defaultFontData(NULL); 136 137 /** 138 * @brief initializes the default font 139 */ 140 void Font::initDefaultFont() 141 { 142 // temporarily create a Font. 143 Font::defaultFontData = FontDataPointer(new FontData); 144 // apply the Data. 145 printf("before: %p\n", defaultFontData.get()); 146 Font::defaultFontData = Font(font_xpm).data; 147 printf("after: %p\n", defaultFontData.get()); 148 } 115 149 116 150 /** … … 119 153 * @returns true if loaded, false if something went wrong, or if a font was loaded before. 120 154 */ 121 bool Font::loadFontFromTTF(const std::string& fontFile) 122 { 123 // checking for existent Font. 124 if (this->data->fontTTF != NULL) 125 { 126 TTF_CloseFont(this->data->fontTTF); 127 this->data->fontTTF = NULL; 128 } 129 155 bool Font::loadFontFromTTF(const std::string& fontFile, unsigned int renderSize) 156 { 157 this->data = FontDataPointer (new FontData()); 130 158 131 159 this->setName(fontFile); 132 this->data->fontTTF = TTF_OpenFont(this->getName(), this->data->renderSize); 160 this->data->fontTTF = TTF_OpenFont(fontFile.c_str(), renderSize); 161 this->data->renderSize = renderSize; 133 162 134 163 if(this->data->fontTTF != NULL) 135 164 { 136 this->createFastTexture(); 137 return (this->getTexture() != 0); 165 this->setStyle("c"); 166 if (this->createFastTexture()) 167 return true; 168 else 169 { 170 this->data = Font::defaultFontData; 171 return false; 172 } 138 173 } 139 174 else 140 175 { 141 176 PRINTF(1)("TTF_OpenFont: %s\n", TTF_GetError()); 177 this->data = Font::defaultFontData; 142 178 return false; 143 179 } … … 151 187 bool Font::loadFontFromSDL_Surface(SDL_Surface* surface) 152 188 { 153 // loading to a texture.154 189 if(surface == NULL) 155 190 return false; 156 191 157 if (this->data->fontTTF != NULL) 158 { 159 TTF_CloseFont(this->data->fontTTF); 160 this->data->fontTTF = NULL; 161 } 192 this->data = FontDataPointer (new FontData()); 193 // loading to a texture. 194 162 195 bool hasAlpha; 163 SDL_Surface* newSurf = this->prepareSurface(surface, hasAlpha);196 SDL_Surface* newSurf = Texture::prepareSurface(surface, hasAlpha); 164 197 if (newSurf != NULL) 165 198 { 166 this-> setSurface(newSurf);167 this-> setAlpha(hasAlpha);199 this->data->texData->setSurface(newSurf); 200 this->data->texData->setAlpha(hasAlpha); 168 201 this->setTexture(Texture::loadTexToGL(newSurf)); 202 } 203 else 204 { 205 this->data = Font::defaultFontData; 206 return false; 169 207 } 170 208 … … 223 261 // PRINTF(2)("Font was not initialized, please do so before setting the Font-Style.\n"); 224 262 } 225 226 Font* Font::defaultFont = NULL;227 263 228 264 /** … … 283 319 SDL_SaveBMP(tmpSurf, fileName.c_str()); 284 320 SDL_FreeSurface(tmpSurf); 285 }286 287 /**288 * @brief initializes the default font289 */290 void Font::initDefaultFont()291 {292 if (Font::defaultFont == NULL)293 Font::defaultFont = new Font(font_xpm);294 }295 296 /**297 * @brief deletes the default font298 */299 void Font::removeDefaultFont()300 {301 if (Font::defaultFont != NULL)302 delete Font::defaultFont;303 Font::defaultFont = NULL;304 321 } 305 322 … … 473 490 // sprintf( outName, "%s-glyphs.bmp", this->getName()); 474 491 // SDL_SaveBMP(tmpSurf, outName); 475 this-> setAlpha(true);476 if (this-> setSurface(tmpSurf))477 (this->setTexture(Texture::loadTexToGL(tmpSurf)));492 this->data->texData->setAlpha(true); 493 if (this->data->texData->setSurface(tmpSurf)) 494 this->setTexture(Texture::loadTexToGL(tmpSurf)); 478 495 return true; 479 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 }; 480 512 481 513 /** … … 569 601 * @brief a simple function to get some interesting information about this class 570 602 */ 571 void Font::debug() 572 { 603 void Font::debug() const 604 { 605 Material::debug(); 606 607 PRINT(0)("TEST %p and %p\n", this->data.get(), this->data->texData.get()); 573 608 // print the loaded font's style 574 609 int style = TTF_STYLE_NORMAL; -
trunk/src/lib/graphics/text_engine/font.h
r8751 r8761 11 11 #define _FONT_H 12 12 13 #include " texture.h"13 #include "material.h" 14 14 15 15 #include "font_data.h" … … 17 17 18 18 //! A class to handle a Font of a certain ttf-File/image-file, Size. 19 class Font : public Texture19 class Font : public Material /* TODO Material it should be */ 20 20 { 21 21 22 22 public: 23 Font( const std::string& fontFile,24 23 Font(); 24 Font(const std::string& fontFile, unsigned int renderSize); 25 25 Font(const std::string& imageFile); 26 26 Font(char** xpmArray); 27 27 virtual ~Font(); 28 28 29 // font 30 bool loadFontFromTTF(const std::string& fontFile); 29 Font& operator=(const Font& font); 30 /** @brief compare two fonts @param font the comparator, @returns true if they match */ 31 bool operator==(const Font& font) const { return this->data == font.data; }; 32 33 34 /// LOADING new Fonts 35 bool loadFontFromTTF(const std::string& fontFile, unsigned int renderSize); 31 36 bool loadFontFromSDL_Surface(SDL_Surface* surface); 32 37 … … 42 47 int getMaxDescent() const; 43 48 44 /** @returns the default Font */ 45 inline static Font* getDefaultFont() { if (Font::defaultFont == NULL) initDefaultFont(); return Font::defaultFont; }; 49 void createAsciiImage(const std::string& fileName, unsigned int size) const; 46 50 47 void createAsciiImage(const std::string& fileName, unsigned int size) const; 51 void debug() const; 52 53 private: 54 void init(); 55 void initGlyphs(Uint16 from, Uint16 count); 56 bool getGlyphMetrics(Glyph* glyph, Uint16 character); 48 57 static void initDefaultFont(); 49 static void removeDefaultFont(); 58 59 int findOptimalFastTextureSize(); 60 bool createFastTexture(); 61 62 bool setTexture(GLuint texture); 50 63 51 64 52 65 private: 53 void init(); 54 bool getGlyphMetrics(Glyph* glyph, Uint16 character); 66 static FontDataPointer defaultFontData; //!< a default font, that is used, if other fonts were unable to be loaded. 55 67 56 bool createFastTexture(); 57 58 void initGlyphs(Uint16 from, Uint16 count); 59 int findOptimalFastTextureSize(); 60 61 void debug(); 62 63 private: 64 static Font* defaultFont; //!< a default font, that is used, if other fonts were unable to be loaded. 65 66 fontDataPointer data; 68 FontDataPointer data; //!< A Data-Pointer to a Font. 67 69 }; 68 70 -
trunk/src/lib/graphics/text_engine/font_data.cc
r8751 r8761 27 27 */ 28 28 FontData::FontData() 29 : texData(new TextureData) 29 30 { 31 printf("CREATE FONT_DATA\n"); 30 32 this->fontTTF = NULL; 31 33 this->glyphArray = NULL; 34 this->renderStyle = TTF_STYLE_NORMAL; 35 this->renderSize = FONT_DEFAULT_RENDER_SIZE; 32 36 } 33 37 -
trunk/src/lib/graphics/text_engine/font_data.h
r8751 r8761 48 48 49 49 50 class FontData : public TextureData50 class FontData 51 51 { 52 52 friend class Font; 53 53 public: 54 FontData();55 54 ~FontData(); 56 55 … … 65 64 66 65 private: 66 FontData(); 67 68 private: 67 69 TTF_Font* fontTTF; //!< The font we use for this. 68 70 int renderStyle; //!< The Renderstyle … … 70 72 71 73 Glyph** glyphArray; //!< An Array of all the Glyphs stored in the Array of Glyphs. 74 75 TextureDataPointer texData; 72 76 }; 73 77 74 typedef CountPointer<FontData> fontDataPointer;78 typedef CountPointer<FontData> FontDataPointer; 75 79 76 80 #endif /* _FONT_DATA_H */ -
trunk/src/lib/graphics/text_engine/limited_width_text.cc
r8619 r8761 76 76 glActiveTexture(GL_TEXTURE0); 77 77 78 glEnable(GL_BLEND); 79 glEnable(GL_TEXTURE_2D); 80 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 81 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, GL_MODULATE ); 78 // glEnable(GL_BLEND); 79 // glEnable(GL_TEXTURE_2D); 80 // glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 81 // glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, GL_MODULATE ); 82 // 83 // glBindTexture(GL_TEXTURE_2D, this->font().getTexture()); 84 this->font().select(); 82 85 83 glBindTexture(GL_TEXTURE_2D, this->font()->getTexture());84 86 glTranslatef(getAbsCoor2D().x, getAbsCoor2D().y, 0); 85 87 glRotatef(this->getAbsDir2D(), 0, 0, 1); … … 90 92 for (unsigned int i = 0; i < this->_dotedText.size(); i++) 91 93 { 92 if(likely((tmpGlyph = this->font() ->getGlyphArray()[this->_dotedText[i]]) != NULL))94 if(likely((tmpGlyph = this->font().getGlyphArray()[this->_dotedText[i]]) != NULL)) 93 95 { 94 96 glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[2]); … … 118 120 void LimitedWidthText::setupTextWidth() 119 121 { 120 float dotsSize = this->font() ->getGlyphArray()[46]->advance * 3.0;122 float dotsSize = this->font().getGlyphArray()[46]->advance * 3.0; 121 123 122 124 float width = 0.0f; … … 134 136 this->_dotedText = this->text().substr(0, i) + "..."; 135 137 if (i > 0) 136 width -= this->font() ->getGlyphArray()[this->text()[i-1]]->advance;138 width -= this->font().getGlyphArray()[this->text()[i-1]]->advance; 137 139 width += dotsSize; 138 140 break; 139 141 } 140 142 // Advance the Text. 141 if(this->font() ->getGlyphArray()[this->text()[i]] != NULL)142 width += this->font() ->getGlyphArray()[this->text()[i]]->advance;143 if(this->font().getGlyphArray()[this->text()[i]] != NULL) 144 width += this->font().getGlyphArray()[this->text()[i]]->advance; 143 145 } 144 146 break; … … 152 154 this->_dotedText = std::string("...") + this->text().substr(i); 153 155 if (i + 1 < (int)text().size() ) 154 width -= this->font() ->getGlyphArray()[this->text()[i+1]]->advance;156 width -= this->font().getGlyphArray()[this->text()[i+1]]->advance; 155 157 width += dotsSize; 156 158 break; 157 159 } 158 160 // Advance the Text. 159 if(this->font() ->getGlyphArray()[this->text()[i]] != NULL)160 width += this->font() ->getGlyphArray()[this->text()[i]]->advance;161 if(this->font().getGlyphArray()[this->text()[i]] != NULL) 162 width += this->font().getGlyphArray()[this->text()[i]]->advance; 161 163 } 162 164 break; -
trunk/src/lib/graphics/text_engine/multi_line_text.cc
r8619 r8761 76 76 glActiveTexture(GL_TEXTURE0); 77 77 78 glColor4fv(&this->color()[0]);78 /* glColor4fv(&this->color()[0]); 79 79 glEnable(GL_BLEND); 80 80 glEnable(GL_TEXTURE_2D); … … 82 82 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, GL_MODULATE ); 83 83 84 glBindTexture(GL_TEXTURE_2D, this->font()->getTexture()); 84 glBindTexture(GL_TEXTURE_2D, this->font().getTexture());*/ 85 this->font().select(); 85 86 glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0); 86 87 glRotatef(this->getAbsDir2D(), 0, 0, 1); … … 99 100 ++lineNumber; 100 101 posX = 0.0f; 101 posY += this->lineSpacing + this->size(); //this->font() ->getMaxHeight();102 posY += this->lineSpacing + this->size(); //this->font().getMaxHeight(); 102 103 } 103 104 104 if(likely((tmpGlyph = this->font() ->getGlyphArray()[this->text()[i]]) != NULL))105 if(likely((tmpGlyph = this->font().getGlyphArray()[this->text()[i]]) != NULL)) 105 106 { 106 107 glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[2]); … … 141 142 { 142 143 this->lineEnds.push_back( i -1 ); 143 width = this->font() ->getGlyphArray()[this->text()[i-1]]->advance;144 width = this->font().getGlyphArray()[this->text()[i-1]]->advance; 144 145 } 145 146 else … … 148 149 149 150 // Advance the Text. 150 if(this->font() ->getGlyphArray()[this->text()[i]] != NULL)151 width += this->font() ->getGlyphArray()[this->text()[i]]->advance;151 if(this->font().getGlyphArray()[this->text()[i]] != NULL) 152 width += this->font().getGlyphArray()[this->text()[i]]->advance; 152 153 } 153 154 this->lineCount = lineEnds.size() + 1; 154 this->setSizeY2D((this->lineEnds.size()+1) * (this->lineSpacing + this->font() ->getMaxHeight()));155 this->setSizeY2D((this->lineEnds.size()+1) * (this->lineSpacing + this->font().getMaxHeight())); 155 156 } 156 157 -
trunk/src/lib/graphics/text_engine/text.cc
r8619 r8761 28 28 */ 29 29 Text::Text(const std::string& fontFile, unsigned int textSize) 30 : _font(fontFile, FONT_DEFAULT_RENDER_SIZE) 30 31 { 31 32 this->setClassID(CL_TEXT, "Text"); 32 33 33 34 // initialize this Text 34 this->_font = NULL;35 35 this->_size = textSize; 36 36 this->setSizeY2D(textSize); 37 this-> _color = TEXT_DEFAULT_COLOR;37 this->setColor(TEXT_DEFAULT_COLOR); 38 38 39 39 this->setAlignment(TEXT_DEFAULT_ALIGNMENT); 40 41 this->setFont(fontFile, FONT_DEFAULT_RENDER_SIZE);42 40 } 43 41 44 42 Text::Text(const Text& text) 43 : _font() 45 44 { 46 45 this->setClassID(CL_TEXT, "Text"); 47 this->_font = NULL;48 46 49 47 *this = text; … … 56 54 Text::~Text() 57 55 { 58 if (this->_font != NULL && this->_font != Font::getDefaultFont())59 ResourceManager::getInstance()->unload(this->_font);56 /* if (this->_font != NULL && this->_font != Font::getDefaultFont()) 57 ResourceManager::getInstance()->unload(this->_font);*/ 60 58 } 61 59 … … 69 67 return (this->_text == text._text && 70 68 this->_size == text._size && 71 this->_font == text._font && 72 this->_color == text._color); 69 this->_font == text._font ); 73 70 } 74 71 … … 91 88 { 92 89 this->_size = text._size; 93 this->_color = text._color;94 90 this->setAlignment(text.getAlignment()); 95 if (this->_font != NULL) 96 ResourceManager::getInstance()->unload(this->_font); 97 98 this->_font = (Font*)ResourceManager::getInstance()->copy( text._font ); //!< HACK 91 92 this->_font = text._font; 99 93 100 94 this->_text = text._text; … … 175 169 { 176 170 Font* newFont = NULL; 177 Font* oldFont = this->_font;171 // Font* oldFont = this->_font; 178 172 179 173 // load a new Font … … 183 177 if (newFont == NULL) 184 178 { 185 newFont = Font::getDefaultFont();179 // newFont = &Font::(); 186 180 PRINTF(2)("Font %s could not be loaded, probably file not found\n", fontFile.c_str()); 187 181 } 188 182 } 183 189 184 if (newFont == NULL) 190 newFont = Font::getDefaultFont(); 191 assert(newFont != NULL); 192 193 // unloading the Font if we alrady have one loaded. 194 this->_font = newFont; 195 if (oldFont != NULL && oldFont != Font::getDefaultFont()) 196 ResourceManager::getInstance()->unload(oldFont); 197 185 this->_font = Font(); 186 else 187 this->_font = *newFont; 188 189 printf("Font Texture is\n" ); 190 _font.debug(); 198 191 this->setupTextWidth(); 199 192 } … … 226 219 glTranslatef(-this->getSizeX2D()/2, 0, 0); 227 220 228 // drawing this Text. 229 // setting the Blending effects 230 glColor4fv(&this->_color[0]); 231 232 233 glActiveTexture(GL_TEXTURE0); 234 235 glEnable(GL_BLEND); 236 glEnable(GL_TEXTURE_2D); 237 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 238 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, GL_MODULATE ); 239 240 glBindTexture(GL_TEXTURE_2D, this->_font->getTexture()); 221 this->font().select(); 241 222 glTranslatef(getAbsCoor2D().x, getAbsCoor2D().y, 0); 242 223 glRotatef(this->getAbsDir2D(), 0, 0, 1); … … 247 228 for (unsigned int i = 0; i < this->_text.size(); i++) 248 229 { 249 if(likely((tmpGlyph = this->font() ->getGlyphArray()[this->_text[i]]) != NULL))230 if(likely((tmpGlyph = this->font().getGlyphArray()[this->_text[i]]) != NULL)) 250 231 { 251 232 glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[2]); … … 277 258 float width = 0; 278 259 for (unsigned int i = 0; i < this->_text.size(); i++) 279 if(this->_font ->getGlyphArray()[this->_text[i]] != NULL)280 width += this->_font ->getGlyphArray()[this->_text[i]]->advance;260 if(this->_font.getGlyphArray()[this->_text[i]] != NULL) 261 width += this->_font.getGlyphArray()[this->_text[i]]->advance; 281 262 this->setSizeX2D(width * this->size()); 282 263 } … … 288 269 void Text::debug() const 289 270 { 290 PRINT(0)("=== TEXT: %s (with Font:'%s') displaying %s ===\n", this->getName(), this->_font ->getName(), this->_text.c_str());291 PRINT(0)("Color: r=%0.2f g=%0.2f b=%0.2f a=%0.2f\n", this->_color.r(), this->_color.g(), this->_color.b(), this->_color.a());292 } 293 271 PRINT(0)("=== TEXT: %s (with Font:'%s') displaying %s ===\n", this->getName(), this->_font.getName(), this->_text.c_str()); 272 // PRINT(0)("Color: r=%0.2f g=%0.2f b=%0.2f a=%0.2f\n", this->_color.r(), this->_color.g(), this->_color.b(), this->_color.a()); 273 } 274 -
trunk/src/lib/graphics/text_engine/text.h
r8619 r8761 9 9 #include "element_2d.h" 10 10 #include "color.h" 11 #include "font.h" 11 12 12 13 #define TEXT_ALIGN_LEFT E2D_ALIGN_LEFT … … 20 21 21 22 // FORWARD DECLARATION 22 class Font;23 23 struct SDL_Surface; 24 24 … … 45 45 void setFont(const std::string& fontFile, unsigned int renderSize); 46 46 /** @param blending the blending intensity to set (between 0.0 and 1.0) */ 47 inline void setBlending(float blending) { this->_ color.a() = blending; };47 inline void setBlending(float blending) { this->_font.setTransparency(blending); }; 48 48 /** @param r red @param g green @param b blue @brief sets the Color of the Text to render (values in [0-1]) */ 49 void setColor(float r, float g, float b) { this->_ color = Color(r, g, b, this->_color.a()); };50 void setColor(float r, float g, float b, float a) { this->_ color = Color(r, g, b, a); };51 void setColor(const Color& color) { this->_ color = color; };49 void setColor(float r, float g, float b) { this->_font.setDiffuseColor(Color(r, g, b, this->blending())); }; 50 void setColor(float r, float g, float b, float a) { this->_font.setDiffuseColor(Color(r, g, b, a)); }; 51 void setColor(const Color& color) { this->_font.setDiffuseColor(color); }; 52 52 void setSize(float size); 53 53 … … 58 58 59 59 /** @returns the pointer to the stored Font (not changeable) */ 60 inline const Font * constfont() const { return this->_font; };60 inline const Font& font() const { return this->_font; }; 61 61 /** @returns the Blending Value [0 invisible 1.0 full visible */ 62 inline float blending() const { return this->_ color.a(); };62 inline float blending() const { return this->_font.diffuseColor().a(); }; 63 63 /** @returns: a Vector(r,g,b) @brief: retrieve a Vector holding the Color of the Text */ 64 inline const Color& color() const { return this->_ color; };64 inline const Color& color() const { return this->_font.diffuseColor(); }; 65 65 /** @returns the Size of the Text */ 66 66 inline float size() const { return this->_size; }; … … 76 76 77 77 private: 78 Font *_font; //!< Font of this text78 Font _font; //!< Font of this text 79 79 80 80 std::string _text; //!< The text to display 81 Color _color; //!< The color of the font.82 81 float _size; //!< The size of the Text. 83 82 }; -
trunk/src/lib/graphics/text_engine/text_engine.cc
r7428 r8761 75 75 // while (fontList->size() > 0) 76 76 { 77 Font* font = dynamic_cast<Font*>(fontList->back());78 if (likely(font != Font::getDefaultFont()))79 ResourceManager::getInstance()->unload(font, RP_GAME);77 // Font* font = dynamic_cast<Font*>(fontList->back()); 78 //if (likely(font != Font::getDefaultFont())) 79 // ResourceManager::getInstance()->unload(font, RP_GAME); 80 80 } 81 81 } … … 108 108 if (TTF_WasInit()) 109 109 { 110 Font::removeDefaultFont();110 // Font::removeDefaultFont(); 111 111 TTF_Quit(); 112 112 }
Note: See TracChangeset
for help on using the changeset viewer.