Index: trunk/src/lib/graphics/text_engine/text.cc
===================================================================
--- trunk/src/lib/graphics/text_engine/text.cc	(revision 5515)
+++ trunk/src/lib/graphics/text_engine/text.cc	(revision 5767)
@@ -32,5 +32,5 @@
  * @param type The renderType to display this font in
  */
-Text::Text(const char* fontFile, unsigned int textSize, TEXT_RENDER_TYPE type)
+Text::Text(const char* fontFile, unsigned int textSize)
 {
   this->init();
@@ -38,5 +38,4 @@
   if (fontFile != NULL)
     this->setFont(fontFile, FONT_DEFAULT_RENDER_SIZE);
-  this->setType(type);
   this->setSizeY2D(this->size = textSize);
 }
@@ -49,5 +48,5 @@
 Text::~Text()
 {
-  if (this->font != NULL && this->font != Font::defaultFont)
+  if (this->font != NULL && this->font != Font::getDefaultFont())
     ResourceManager::getInstance()->unload(this->font);
 
@@ -68,9 +67,7 @@
   this->externText = NULL;
   this->setAlignment(TEXT_DEFAULT_ALIGNMENT);
-  this->texture = 0;
   this->blending = TEXT_DEFAULT_BLENDING;
   this->color = TEXT_DEFAULT_COLOR;
   this->size = TEXT_DEFAULT_SIZE;
-  this->setType(TEXT_RENDER_DYNAMIC);
 
   this->setText(NULL);
@@ -89,5 +86,5 @@
 
   // unloading the Font if we alrady have one loaded.
-  if (this->font != NULL && this->font != Font::defaultFont)
+  if (this->font != NULL && this->font != Font::getDefaultFont())
     ResourceManager::getInstance()->unload(this->font);
   this->font = NULL;
@@ -102,16 +99,4 @@
       PRINTF(2)("Font %s could not be loaded, probably file not found\n", fontFile);
   }
-}
-
-/**
- *  sets the Type of this Text
- * @param type the type to set.
- */
-void Text::setType(TEXT_RENDER_TYPE type)
-{
-  if (this->font != NULL && this->font->fontTTF)
-    this->type = type;
-  else
-    this->type = TEXT_RENDER_DYNAMIC;
 }
 
@@ -167,35 +152,6 @@
         tmpText++;
       }
-      this->setSizeX2D(this->width = width *this->getSizeY2D());
+      this->setSizeX2D(width *this->getSizeY2D());
     }
-  }
-}
-
-
-/**
- *  creates a texture out of the given parameters !! TEXT_STATIC !! - mode
- *
- * this has to be called every time by the user, to if changes were made.
- * this is only for TEXT_STATIC-mode
- */
-void Text::createTexture()
-{
-  SDL_Surface* tmpSurf = NULL;
-  if (this->texture)
-    glDeleteTextures(1, &this->texture);
-  if (likely(this->font != NULL))
-  {
-    SDL_Color theColor = { (int)(this->color.x*255), (int)(this->color.y*255), (int)(this->color.z*255) };
-    tmpSurf = TTF_RenderText_Blended(this->font->fontTTF,
-                                     this->text,
-                                     theColor);
-  }
-  if (tmpSurf != NULL)
-  {
-    this->texture = loadTexture(tmpSurf, &this->texCoord);
-
-    this->width = tmpSurf->w;
-    this->height = tmpSurf->h;
-    SDL_FreeSurface(tmpSurf);
   }
 }
@@ -209,7 +165,7 @@
   // transform for alignment.
   if (this->getAlignment() == TEXT_ALIGN_RIGHT)
-    glTranslatef(-this->width, 0, 0);
+    glTranslatef(-this->getSizeX2D(), 0, 0);
   else if (this->getAlignment() == TEXT_ALIGN_CENTER || this->getAlignment() == TEXT_ALIGN_SCREEN_CENTER)
-    glTranslatef(-this->width/2, 0, 0);
+    glTranslatef(-this->getSizeX2D()/2, 0, 0);
 
   // drawing this Text.
@@ -222,74 +178,52 @@
   glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, GL_MODULATE );
 
-  if(likely(type & TEXT_RENDER_DYNAMIC ))
-  {
-    Glyph** glyphArray;
-    if (likely (this->font != NULL))
+  Glyph** glyphArray;
+  if (likely (this->font != NULL))
+  {
+    glyphArray = this->font->getGlyphArray();
+    glBindTexture(GL_TEXTURE_2D, font->getFastTextureID());
+  }
+  else
+  {
+    if (unlikely(Font::getDefaultFont() == NULL))
+      Font::initDefaultFont();
+    glyphArray = Font::getDefaultFont()->getGlyphArray();
+    glBindTexture(GL_TEXTURE_2D, Font::getDefaultFont()->getFastTextureID());
+  }
+  const char* tmpText = this->externText;
+  if (this->externText == NULL)
+    tmpText = this->text;
+  if (likely(tmpText != NULL))
+  {
+    glTranslatef(getAbsCoor2D().x, getAbsCoor2D().y, 0);
+    glRotatef(this->getAbsDir2D(), 0, 0, 1);
+    Glyph* tmpGlyph;
+    float posX = 0.0f;
+    while (likely(*tmpText != '\0'))
     {
-      glyphArray = this->font->getGlyphArray();
-      glBindTexture(GL_TEXTURE_2D, font->getFastTextureID());
+      if(likely((tmpGlyph = glyphArray[*tmpText]) != NULL))
+      {
+        glBegin(GL_QUADS);
+
+        glTexCoord2f(tmpGlyph->texCoord[0], tmpGlyph->texCoord[2]);
+        glVertex2d(posX, 0);
+
+        glTexCoord2f(tmpGlyph->texCoord[0], tmpGlyph->texCoord[3]);
+        glVertex2d(posX, this->size);
+
+        glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[3]);
+        glVertex2d(posX+tmpGlyph->width*this->size, this->size);
+
+        glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[2]);
+        glVertex2d(posX+tmpGlyph->width*this->size, 0);
+
+        glEnd();
+        glEndList();
+        posX += tmpGlyph->advance * this->size;
+      }
+      ++tmpText;
     }
-    else
-    {
-      if (unlikely(Font::getDefaultFont() == NULL))
-        Font::initDefaultFont();
-      glyphArray = Font::getDefaultFont()->getGlyphArray();
-      glBindTexture(GL_TEXTURE_2D, Font::getDefaultFont()->getFastTextureID());
-    }
-    const char* tmpText = this->externText;
-    if (this->externText == NULL)
-      tmpText = this->text;
-    if (likely(tmpText != NULL))
-    {
-      glTranslatef(getAbsCoor2D().x, getAbsCoor2D().y, 0);
-      glRotatef(this->getAbsDir2D(), 0, 0, 1);
-      Glyph* tmpGlyph;
-      float posX = 0.0f;
-      while (likely(*tmpText != '\0'))
-      {
-        if(likely((tmpGlyph = glyphArray[*tmpText]) != NULL))
-        {
-          glBegin(GL_QUADS);
-
-          glTexCoord2f(tmpGlyph->texCoord[0], tmpGlyph->texCoord[2]);
-          glVertex2d(posX, 0);
-
-          glTexCoord2f(tmpGlyph->texCoord[0], tmpGlyph->texCoord[3]);
-          glVertex2d(posX, this->size);
-
-          glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[3]);
-          glVertex2d(posX+tmpGlyph->width*this->size, this->size);
-
-          glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[2]);
-          glVertex2d(posX+tmpGlyph->width*this->size, 0);
-
-          glEnd();
-          glEndList();
-          posX += tmpGlyph->advance * this->size;
-        }
-        ++tmpText;
-      }
-    }
-  }
-  else //(if type & TEXT_RENDER_STATIC)
-  {
-    glBindTexture(GL_TEXTURE_2D, this->texture);
-    glBegin(GL_QUADS);
-
-    glTexCoord2f(this->texCoord.minU, this->texCoord.minV);
-    glVertex2f(this->getAbsCoor2D().x,   this->getAbsCoor2D().y  );
-
-    glTexCoord2f(this->texCoord.maxU, this->texCoord.minV);
-    glVertex2f(this->getAbsCoor2D().x + this->width, this->getAbsCoor2D().y  );
-
-    glTexCoord2f(this->texCoord.maxU, this->texCoord.maxV);
-    glVertex2f(this->getAbsCoor2D().x + this->width, getAbsCoor2D().y + this->height);
-
-    glTexCoord2f(this->texCoord.minU, this->texCoord.maxV);
-    glVertex2f(getAbsCoor2D().x, getAbsCoor2D().y + this->height);
-
-    glEnd();
-
-  }
+  }
+
   glPopMatrix();
 }
