Index: orxonox/trunk/src/lib/graphics/text_engine.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/text_engine.cc	(revision 4320)
+++ orxonox/trunk/src/lib/graphics/text_engine.cc	(revision 4458)
@@ -76,5 +76,8 @@
 }
 
-
+/**
+   \brief tells the Text, that it should folow a PNode
+   \param bindNode: the node to bind this text to
+*/
 void Text::setBindNode(PNode* bindNode)
 {
@@ -277,4 +280,104 @@
 
 ////////////
+/// UTIL ///
+////////////
+/**
+   \brief Loads a Font from an SDL_surface into a texture.
+   \param surface The surface to make the texture of
+   \param texCoord The texture coordinates of the 4 corners of the texture
+   \returns the ID of the texture
+*/
+GLuint Text::loadTexture(SDL_Surface *surface, TexCoord* texCoord)
+{
+  GLuint texture;
+  int w, h;
+  SDL_Surface *image;
+  SDL_Rect area;
+  Uint32 saved_flags;
+  Uint8  saved_alpha;
+  
+  /* Use the surface width and height expanded to powers of 2 */
+  w = powerOfTwo(surface->w);
+  h = powerOfTwo(surface->h);
+  if (texCoord)
+    {
+      texCoord->minU = 0.0f;
+      texCoord->minV = 0.0f;
+      texCoord->maxU = (GLfloat)surface->w / w;
+      texCoord->maxV = (GLfloat)surface->h / h;
+    }
+  image = SDL_CreateRGBSurface(SDL_SWSURFACE,
+			       w, h,
+			       32,
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */
+			       0x000000FF, 
+			       0x0000FF00, 
+			       0x00FF0000, 
+			       0xFF000000
+#else
+			       0xFF000000,
+			       0x00FF0000, 
+			       0x0000FF00, 
+			       0x000000FF
+#endif
+			       );
+  if ( image == NULL ) {
+    return 0;
+  }
+  
+  /* Save the alpha blending attributes */
+  saved_flags = surface->flags&(SDL_SRCALPHA|SDL_RLEACCELOK);
+  saved_alpha = surface->format->alpha;
+  if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
+    SDL_SetAlpha(surface, 0, 0);
+  }
+  
+  /* Copy the surface into the GL texture image */
+  area.x = 0;
+  area.y = 0;
+  area.w = surface->w;
+  area.h = surface->h;
+  SDL_BlitSurface(surface, &area, image, &area);
+  
+  /* Restore the alpha blending attributes */
+  if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
+    SDL_SetAlpha(surface, saved_flags, saved_alpha);
+  }
+  
+  /* Create an OpenGL texture for the image */
+  glGenTextures(1, &texture);
+  glBindTexture(GL_TEXTURE_2D, texture);
+  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+  glTexImage2D(GL_TEXTURE_2D,
+	       0,
+	       GL_RGBA,
+	       w, h,
+	       0,
+	       GL_RGBA,
+	       GL_UNSIGNED_BYTE,
+	       image->pixels);
+  SDL_FreeSurface(image); /* No longer needed */
+  
+  return texture;
+}
+
+/**
+   \brief Quick utility function for texture creation 
+   \param input an integer
+   \returns the next bigger 2^n-integer than input
+*/
+int Text::powerOfTwo(int input)
+{
+  int value = 1;
+  
+  while ( value < input ) {
+    value <<= 1;
+  }
+  return value;
+}
+
+
+////////////
 /// FONT ///
 ////////////
@@ -358,5 +461,5 @@
    i: italic, b: bold, u, underline
 */
-void Font::setStyle(char* renderStyle)
+void Font::setStyle(const char* renderStyle)
 {
   this->renderStyle = TTF_STYLE_NORMAL;
@@ -690,107 +793,4 @@
 }
 
-////////////
-/// UTIL ///
-////////////
-/**
-   \brief Loads a Font from an SDL_surface into a texture.
-   \param surface The surface to make the texture of
-   \param texCoord The texture coordinates of the 4 corners of the texture
-   \returns the ID of the texture
-*/
-GLuint loadTexture(SDL_Surface *surface, TexCoord* texCoord)
-{
-  GLuint texture;
-  int w, h;
-  SDL_Surface *image;
-  SDL_Rect area;
-  Uint32 saved_flags;
-  Uint8  saved_alpha;
-  
-  /* Use the surface width and height expanded to powers of 2 */
-  w = powerOfTwo(surface->w);
-  h = powerOfTwo(surface->h);
-  if (texCoord)
-    {
-      texCoord->minU = 0.0f;
-      texCoord->minV = 0.0f;
-      texCoord->maxU = (GLfloat)surface->w / w;
-      texCoord->maxV = (GLfloat)surface->h / h;
-    }
-  image = SDL_CreateRGBSurface(SDL_SWSURFACE,
-			       w, h,
-			       32,
-#if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */
-			       0x000000FF, 
-			       0x0000FF00, 
-			       0x00FF0000, 
-			       0xFF000000
-#else
-			       0xFF000000,
-			       0x00FF0000, 
-			       0x0000FF00, 
-			       0x000000FF
-#endif
-			       );
-  if ( image == NULL ) {
-    return 0;
-  }
-  
-  /* Save the alpha blending attributes */
-  saved_flags = surface->flags&(SDL_SRCALPHA|SDL_RLEACCELOK);
-  saved_alpha = surface->format->alpha;
-  if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
-    SDL_SetAlpha(surface, 0, 0);
-  }
-  
-  /* Copy the surface into the GL texture image */
-  area.x = 0;
-  area.y = 0;
-  area.w = surface->w;
-  area.h = surface->h;
-  SDL_BlitSurface(surface, &area, image, &area);
-  
-  /* Restore the alpha blending attributes */
-  if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) {
-    SDL_SetAlpha(surface, saved_flags, saved_alpha);
-  }
-  
-  /* Create an OpenGL texture for the image */
-  glGenTextures(1, &texture);
-  glBindTexture(GL_TEXTURE_2D, texture);
-  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-  glTexImage2D(GL_TEXTURE_2D,
-	       0,
-	       GL_RGBA,
-	       w, h,
-	       0,
-	       GL_RGBA,
-	       GL_UNSIGNED_BYTE,
-	       image->pixels);
-  SDL_FreeSurface(image); /* No longer needed */
-  
-  return texture;
-}
-
-/**
-   \brief Quick utility function for texture creation 
-   \param input an integer
-   \returns the next bigger 2^n-integer than input
-*/
-int powerOfTwo(int input)
-{
-  int value = 1;
-  
-  while ( value < input ) {
-    value <<= 1;
-  }
-  return value;
-}
-
-
-
-
-
 
 ///////////////////
@@ -893,5 +893,5 @@
 /**
    \brief removes a Text from the List
-   \param the text to delete
+   \param text: the text to delete
 
    this only ereases allocated memory, and removes the text
