Index: trunk/src/lib/graphics/text_engine/font.cc
===================================================================
--- trunk/src/lib/graphics/text_engine/font.cc	(revision 7193)
+++ trunk/src/lib/graphics/text_engine/font.cc	(revision 7221)
@@ -37,5 +37,5 @@
  * @param fontSize the Size of the Font in Pixels
  */
-Font::Font(const char* fontFile, unsigned int renderSize)
+Font::Font(const std::string& fontFile, unsigned int renderSize)
 {
   this->init();
@@ -44,5 +44,5 @@
   this->setStyle("c");
 
-  if (fontFile != NULL)
+  if (!fontFile.empty())
     this->loadFontFromTTF(fontFile);
 }
@@ -52,5 +52,5 @@
  * @param imageFile the ImageFile to load the Font From.
  */
-Font::Font(const char* imageFile)
+Font::Font(const std::string& imageFile)
 {
   this->init();
@@ -58,6 +58,6 @@
   //  this->setSize(fontSize);
   SDL_Surface* image = NULL;
-  if (imageFile != NULL)
-    image = IMG_Load(imageFile);
+  if (!imageFile.empty())
+    image = IMG_Load(imageFile.c_str());
   else
     return;
@@ -68,5 +68,5 @@
   }
   else
-    PRINTF(1)("loading from surface %s failed: %s\n", imageFile, IMG_GetError());
+    PRINTF(1)("loading from surface %s failed: %s\n", imageFile.c_str(), IMG_GetError());
 }
 
@@ -114,7 +114,7 @@
 
   //! @todo check if we really do not need to delete the fastTextureID here.
-//   if (this->fastTextureID != 0)
-//     if(glIsTexture(this->fastTextureID))
-//       glDeleteTextures(1, &this->fastTextureID);
+  //   if (this->fastTextureID != 0)
+  //     if(glIsTexture(this->fastTextureID))
+  //       glDeleteTextures(1, &this->fastTextureID);
 
   // erease this font out of the memory.
@@ -140,5 +140,5 @@
  * @returns true if loaded, false if something went wrong, or if a font was loaded before.
  */
-bool Font::loadFontFromTTF(const char* fontFile)
+bool Font::loadFontFromTTF(const std::string& fontFile)
 {
   // checking for existent Font.
@@ -222,20 +222,21 @@
  *   i: italic, b: bold, u, underline
  */
-void Font::setStyle(const char* renderStyle)
+void Font::setStyle(const std::string& renderStyle)
 {
   this->renderStyle = TTF_STYLE_NORMAL;
 
-  for (int i = 0; i < strlen(renderStyle); i++)
-    if (strncmp(renderStyle+i, "b", 1) == 0)
+  for (int i = 0; i < renderStyle.size(); i++)
+  {
+    if (renderStyle[i] == 'b')
       this->renderStyle |= TTF_STYLE_BOLD;
-  else if (strncmp(renderStyle+i, "i", 1) == 0)
-    this->renderStyle |= TTF_STYLE_ITALIC;
-  else if (strncmp(renderStyle+i, "u", 1) == 0)
-    this->renderStyle |= TTF_STYLE_UNDERLINE;
-
+    else if (renderStyle[i] == 'i')
+      this->renderStyle |= TTF_STYLE_ITALIC;
+    else if (renderStyle[i] == 'u')
+      this->renderStyle |= TTF_STYLE_UNDERLINE;
+  }
   if (likely(this->fontTTF != NULL))
     TTF_SetFontStyle(this->fontTTF, this->renderStyle);
-//  else
-//    PRINTF(2)("Font was not initialized, please do so before setting the Font-Style.\n");
+  //  else
+  //    PRINTF(2)("Font was not initialized, please do so before setting the Font-Style.\n");
 }
 
@@ -247,5 +248,5 @@
  * @param fileName the File to write the image into.
  */
-void Font::createAsciiImage(const char* fileName, unsigned int size) const
+void Font::createAsciiImage(const std::string& fileName, unsigned int size) const
 {
   if (this->fontTTF == NULL)
@@ -258,16 +259,16 @@
   SDL_Rect tmpRect; // this represents a Rectangle for blitting.
   SDL_Surface* tmpSurf =  SDL_CreateRGBSurface(SDL_SWSURFACE,
-                                               height*size, height*size,
-                                               32,
+                          height*size, height*size,
+                          32,
 #if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */
-                                               0x000000FF,
-                                               0x0000FF00,
-                                               0x00FF0000,
-                                               0xFF000000
+                          0x000000FF,
+                          0x0000FF00,
+                          0x00FF0000,
+                          0xFF000000
 #else
-                                               0xFF000000,
-                                               0x00FF0000,
-                                               0x0000FF00,
-                                               0x000000FF
+                          0xFF000000,
+                          0x00FF0000,
+                          0x0000FF00,
+                          0x000000FF
 #endif
                                               );
@@ -299,5 +300,5 @@
     }
   }
-  SDL_SaveBMP(tmpSurf, fileName);
+  SDL_SaveBMP(tmpSurf, fileName.c_str());
   SDL_FreeSurface(tmpSurf);
 }
@@ -409,5 +410,5 @@
 
   this->initGlyphs(32, numberOfGlyphs);
-//  this->glyphArray[32]->width = .5f; //!< @todo find out the real size of a Space
+  //  this->glyphArray[32]->width = .5f; //!< @todo find out the real size of a Space
 
   int rectSize = this->findOptimalFastTextureSize();
@@ -418,16 +419,16 @@
   SDL_Rect tmpRect; // this represents a Rectangle for blitting.
   SDL_Surface* tmpSurf =  SDL_CreateRGBSurface(SDL_SWSURFACE,
-                                               rectSize, rectSize,
-                                               32,
+                          rectSize, rectSize,
+                          32,
 #if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */
-                                               0x000000FF,
-                                               0x0000FF00,
-                                               0x00FF0000,
-                                               0xFF000000
+                          0x000000FF,
+                          0x0000FF00,
+                          0x00FF0000,
+                          0xFF000000
 #else
-                                               0xFF000000,
-                                               0x00FF0000,
-                                               0x0000FF00,
-                                               0x000000FF
+                          0xFF000000,
+                          0x00FF0000,
+                          0x0000FF00,
+                          0x000000FF
 #endif
                                               );
@@ -457,5 +458,5 @@
         break;
       }
-          // reading in the new Glyph
+      // reading in the new Glyph
       if (likely(this->fontTTF != NULL))
       {
@@ -521,5 +522,5 @@
   for (int i = from; i <= lastGlyph; i++)
   {
-      // setting up all the Glyphs we like.
+    // setting up all the Glyphs we like.
     glyphArray[i] = getGlyphMetrics(i);
   }
@@ -555,5 +556,5 @@
       if((tmpGlyph = this->glyphArray[i]) != NULL)
       {
-              // getting the height of the highest Glyph in the Line.
+        // getting the height of the highest Glyph in the Line.
         if (tmpGlyph->height*this->renderSize > maxLineHeight)
           maxLineHeight = (int)(tmpGlyph->height*this->renderSize);
@@ -563,5 +564,5 @@
           x = 0;
           y = y + maxLineHeight;
-                  //maxLineHeight = 0;
+          //maxLineHeight = 0;
         }
         if (y + maxLineHeight + 1 > size)
@@ -592,5 +593,6 @@
   if(style==TTF_STYLE_NORMAL)
     PRINTF(0)(" normal");
-  else {
+  else
+  {
     if(style&TTF_STYLE_BOLD)
       PRINTF(0)(" bold");
Index: trunk/src/lib/graphics/text_engine/font.h
===================================================================
--- trunk/src/lib/graphics/text_engine/font.h	(revision 7193)
+++ trunk/src/lib/graphics/text_engine/font.h	(revision 7221)
@@ -55,7 +55,7 @@
 {
   public:
-    Font(const char* fontFile,
+    Font(const std::string& fontFile,
          unsigned int renderSize);
-    Font(const char* imageFile);
+    Font(const std::string& imageFile);
     Font(char** xpmArray);
     virtual ~Font();
@@ -64,8 +64,8 @@
 
   //  font
-    bool loadFontFromTTF(const char* fontFile);
+    bool loadFontFromTTF(const std::string& fontFile);
     bool loadFontFromSDL_Surface(SDL_Surface* surface);
 
-    void setStyle(const char* renderStyle);
+    void setStyle(const std::string& renderStyle);
 
     /** @returns a Pointer to the Array of Glyphs */
@@ -78,5 +78,5 @@
     inline static Font* getDefaultFont() { if (Font::defaultFont == NULL) initDefaultFont(); return Font::defaultFont; };
 
-    void createAsciiImage(const char* fileName, unsigned int size) const;
+    void createAsciiImage(const std::string& fileName, unsigned int size) const;
     static void initDefaultFont();
     static void removeDefaultFont();
Index: trunk/src/lib/graphics/text_engine/text.cc
===================================================================
--- trunk/src/lib/graphics/text_engine/text.cc	(revision 7193)
+++ trunk/src/lib/graphics/text_engine/text.cc	(revision 7221)
@@ -32,9 +32,9 @@
  * @param type The renderType to display this font in
  */
-Text::Text(const char* fontFile, unsigned int textSize)
+Text::Text(const std::string& fontFile, unsigned int textSize)
 {
   this->init();
 
-  if (fontFile != NULL)
+  if (!fontFile.empty())
     this->setFont(fontFile, FONT_DEFAULT_RENDER_SIZE);
   this->setSizeY2D(textSize);
@@ -50,7 +50,4 @@
   if (this->font != NULL && this->font != Font::getDefaultFont())
     ResourceManager::getInstance()->unload(this->font);
-
-  if (this->text)
-    delete[] this->text;
 }
 
@@ -64,11 +61,10 @@
   // initialize this Text
   this->font = NULL;
-  this->text = NULL;
-  this->externText = NULL;
+  this->text = "";
   this->setAlignment(TEXT_DEFAULT_ALIGNMENT);
   this->blending = TEXT_DEFAULT_BLENDING;
   this->color = TEXT_DEFAULT_COLOR;
   this->setSize(TEXT_DEFAULT_SIZE);
-  this->setText(NULL);
+  this->setText("");
 }
 
@@ -78,5 +74,5 @@
  * @param fontSize the Size of the Font
  */
-void Text::setFont(const char* fontFile, unsigned int fontSize)
+void Text::setFont(const std::string& fontFile, unsigned int fontSize)
 {
   Font* tmpFont;
@@ -90,5 +86,5 @@
 
   // load a new Font
-  if (fontFile != NULL)
+  if (!fontFile.empty())
   {
     tmpFont = (Font*)ResourceManager::getInstance()->load(fontFile, TTF, RP_GAME, (int)fontSize);
@@ -96,5 +92,5 @@
       this->font = tmpFont;
     else
-      PRINTF(2)("Font %s could not be loaded, probably file not found\n", fontFile);
+      PRINTF(2)("Font %s could not be loaded, probably file not found\n", fontFile.c_str());
   }
 }
@@ -104,29 +100,7 @@
  * @param text the new text to set
  */
-void Text::setText(const char* text, bool isExtern)
-{
-  if (isExtern)
-  {
-    this->externText = text;
-
-    if (unlikely(this->text != NULL))
-    {
-      delete[] this->text;
-      this->text = NULL;
-    }
-  }
-  else
-  {
-    this->externText = NULL;
-    if (this->text)
-      delete[] this->text;
-    if (text != NULL)
-    {
-      this->text = new char[strlen(text)+1];
-      strcpy(this->text, text);
-    }
-    else
-      this->text = NULL;
-  }
+void Text::setText(const std::string& text)
+{
+  this->text = text;
 
   // setting up the Text-Width if DYNAMIC
@@ -138,16 +112,12 @@
 
     float width = 0;
-    const char* tmpText = this->externText;
-    if (this->externText == NULL)
-      tmpText = this->text;
-    if (tmpText != NULL)
+    if (!this->text.empty())
     {
-      while (*tmpText != '\0')
+      for (unsigned int i = 0; i < this->text.size(); i++)
       {
-        if(glyphArray[*tmpText] != NULL)
+        if(glyphArray[this->text[i]] != NULL)
         {
-          width += glyphArray[*tmpText]->advance;
+          width += glyphArray[this->text[i]]->advance;
         }
-        tmpText++;
       }
       this->setSizeX2D(width *this->getSizeY2D());
@@ -190,8 +160,5 @@
     glBindTexture(GL_TEXTURE_2D, Font::getDefaultFont()->getTexture());
   }
-  const char* tmpText = this->externText;
-  if (this->externText == NULL)
-    tmpText = this->text;
-  if (likely(tmpText != NULL))
+  if (likely(!this->text.empty()))
   {
     glTranslatef(getAbsCoor2D().x, getAbsCoor2D().y, 0);
@@ -201,7 +168,7 @@
 
     glBegin(GL_QUADS);
-    while (likely(*tmpText != '\0'))
+    for (unsigned int i = 0; i < this->text.size(); i++)
     {
-      if(likely((tmpGlyph = glyphArray[*tmpText]) != NULL))
+      if(likely((tmpGlyph = glyphArray[this->text[i]]) != NULL))
       {
         glTexCoord2f(tmpGlyph->texCoord[1], tmpGlyph->texCoord[2]);
@@ -219,5 +186,4 @@
         posX += tmpGlyph->advance * this->getSizeY2D();
       }
-      ++tmpText;
     }
     glEnd();
@@ -232,8 +198,5 @@
 void Text::debug() const
 {
-  if (this->externText == NULL)
-    PRINT(0)("=== TEXT: %s ===\n", this->text);
-  else
-    PRINT(0)("=== TEXT: %s ===\n", this->externText);
+  PRINT(0)("=== TEXT: %s ===\n", this->text.c_str());
 
   if (this->getBindNode())
Index: trunk/src/lib/graphics/text_engine/text.h
===================================================================
--- trunk/src/lib/graphics/text_engine/text.h	(revision 7193)
+++ trunk/src/lib/graphics/text_engine/text.h	(revision 7221)
@@ -39,14 +39,14 @@
 {
   public:
-    Text(const char* fontFile = NULL, unsigned int fontSize = TEXT_DEFAULT_SIZE);
+    Text(const std::string& fontFile = "", unsigned int fontSize = TEXT_DEFAULT_SIZE);
     virtual ~Text();
     void init();
 
-    void setFont(const char* fontFile, unsigned int renderSize);
+    void setFont(const std::string& fontFile, unsigned int renderSize);
 
-    void setText(const char* text, bool isExtern = false);
+    void setText(const std::string& text);
 
     /** @returns the String this Text displays */
-    inline const char* getText() const { return (externText == NULL)?this->text:this->externText; };
+    inline const std::string& getText() const { return this->text; };
     /** @param blending the blending intensity to set (between 0.0 and 1.0) */
     inline void setBlending(float blending) { this->blending = blending; };
@@ -69,6 +69,5 @@
     Font*             font;           //!< Font of this text
 
-    char*             text;           //!< The text to display
-    const char*       externText;     //!< the text to Display from an external Source.
+    std::string       text;           //!< The text to display
     Vector            color;          //!< The color of the font.
     float             blending;       //!< The blending intensity.
