Index: branches/powerups/src/lib/graphics/graphics_engine.cc
===================================================================
--- branches/powerups/src/lib/graphics/graphics_engine.cc	(revision 5848)
+++ branches/powerups/src/lib/graphics/graphics_engine.cc	(revision 5955)
@@ -26,13 +26,13 @@
 #include "debug.h"
 
-#include "ini_parser.h"
+#include "parser/ini_parser/ini_parser.h"
 #include "substring.h"
 #include "text.h"
 
 #include "globals.h"
+#include "texture.h"
 
 #ifdef __WIN32__
  #include "class_list.h"
- #include "texture.h"
  #include "list.h"
  #include "model.h"
@@ -131,7 +131,7 @@
   const char* textures = iniParser->getVar(CONFIG_NAME_TEXTURES, CONFIG_SECTION_VIDEO_ADVANCED, "0");
   if (strchr(textures, '1') || !strcasecmp(textures, "true"))
-    this->texturesEnabled = true;
+    Texture::setTextureEnableState( true);
   else
-    this->texturesEnabled = false;
+    Texture::setTextureEnableState(false);
 
   // searching for a usefull resolution
@@ -365,9 +365,4 @@
 
 /**
- * if Textures should be enabled
-*/
-bool GraphicsEngine::texturesEnabled = true;
-
-/**
  *
  * @param show if The mouse-cursor should be visible
Index: branches/powerups/src/lib/graphics/graphics_engine.h
===================================================================
--- branches/powerups/src/lib/graphics/graphics_engine.h	(revision 5848)
+++ branches/powerups/src/lib/graphics/graphics_engine.h	(revision 5955)
@@ -83,6 +83,4 @@
 
   public:
-    static bool             texturesEnabled;    //!< if textures should be enabled (globally)
-
 
   private:
Index: branches/powerups/src/lib/graphics/importer/Makefile.am
===================================================================
--- branches/powerups/src/lib/graphics/importer/Makefile.am	(revision 5848)
+++ branches/powerups/src/lib/graphics/importer/Makefile.am	(revision 5955)
@@ -9,5 +9,6 @@
                            md2Model.cc \
                            material.cc \
-                           texture.cc
+                           texture.cc \
+                           texture_sequence.cc
 
 
@@ -20,4 +21,5 @@
                  material.h \
                  texture.h \
+                 texture_sequence.h \
                  anorms.h \
                  anormtab.h
Index: branches/powerups/src/lib/graphics/importer/material.h
===================================================================
--- branches/powerups/src/lib/graphics/importer/material.h	(revision 5848)
+++ branches/powerups/src/lib/graphics/importer/material.h	(revision 5955)
@@ -51,15 +51,15 @@
   static void addTexturePath(const char* pathName);
 
- private:
-  int         illumModel;       //!< The IlluminationModel is either flat or smooth.
-  float       diffuse [4];      //!< The diffuse color of the Material.
-  float       ambient [4];      //!< The ambient color of the Material.
-  float       specular [4];     //!< The specular color of the Material.
-  float       shininess;        //!< The shininess of the Material.
-  float       transparency;     //!< The transperency of the Material.
+  private:
+    int         illumModel;       //!< The IlluminationModel is either flat or smooth.
+    float       diffuse [4];      //!< The diffuse color of the Material.
+    float       ambient [4];      //!< The ambient color of the Material.
+    float       specular [4];     //!< The specular color of the Material.
+    float       shininess;        //!< The shininess of the Material.
+    float       transparency;     //!< The transperency of the Material.
   public:
-  Texture*    diffuseTexture;   //!< The diffuse texture of the Material.
-  Texture*    ambientTexture;   //!< The ambient texture of the Material.
-  Texture*    specularTexture;  //!< The specular texture of the Material.
+    Texture*    diffuseTexture;   //!< The diffuse texture of the Material.
+    Texture*    ambientTexture;   //!< The ambient texture of the Material.
+    Texture*    specularTexture;  //!< The specular texture of the Material.
 };
 #endif
Index: branches/powerups/src/lib/graphics/importer/texture.cc
===================================================================
--- branches/powerups/src/lib/graphics/importer/texture.cc	(revision 5848)
+++ branches/powerups/src/lib/graphics/importer/texture.cc	(revision 5955)
@@ -19,6 +19,6 @@
 
 #include "debug.h"
-#include "graphics_engine.h"
-
+
+// INCLUDING SDL_Image
 #ifdef HAVE_SDL_IMAGE_H
 #include <SDL_image.h>
@@ -45,4 +45,5 @@
 }
 
+
 /**
  *  Destructor of a Texture
@@ -65,5 +66,5 @@
 bool Texture::loadImage(const char* imageName)
 {
-  if (GraphicsEngine::texturesEnabled)
+  if (Texture::texturesEnabled)
     {
       if (this->image != NULL)
@@ -80,5 +81,5 @@
         {
           SDL_Surface* tmpSurf;
-          if (this->texture)
+          if (this->texture != 0 && glIsTexture(this->texture))
             glDeleteTextures(1, &this->texture);
           // load the new Image to memory
@@ -87,6 +88,13 @@
           {
             PRINTF(4)("loading Image %s\n", imageName);
-            if (this->prepareSurface(tmpSurf))
-              loadTexToGL();
+            bool hasAlpha;
+            SDL_Surface* newSurf = this->prepareSurface(tmpSurf, hasAlpha);
+            if (newSurf != NULL)
+            {
+              this->setSurface(newSurf);
+              this->setAlpha(hasAlpha);
+              this->setTexture(Texture::loadTexToGL(newSurf));
+            }
+
             SDL_FreeSurface(tmpSurf);
             return true;
@@ -108,10 +116,16 @@
 }
 
+
+/**
+ * rebuilds the texture.
+ * reloads the Texture from Memory to OpenGL.
+ */
 bool Texture::rebuild()
 {
   if (this->texture != 0)
     {
-      glDeleteTextures(1,&this->texture);
-      this->texture = 0;
+      if (glIsTexture(this->texture))
+        glDeleteTextures(1,&this->texture);
+      this->setTexture(0);
     }
 
@@ -119,26 +133,61 @@
     {
       PRINTF(3)("Reloading Texture of %s '%s'\n", this->getClassName(), this->getName());
-      this->loadTexToGL();
+      this->setTexture(loadTexToGL(this->image));
     }
-
-}
-
+}
+
+
+/**
+ * set the surface this Texture handles
+ * @param newSurface the new Surface to set as the image for this Texture.
+ *
+ * This deletes the old version of the stored Texture,
+ * and sets the newly given Surface as current.
+ */
+bool Texture::setSurface(SDL_Surface* newSurface)
+{
+  if (this->image != NULL)
+    SDL_FreeSurface(this->image);
+
+  this->image = newSurface;
+
+  return (this->image != NULL);
+}
+
+
+bool Texture::texturesEnabled = true;
+
+/**
+ * enables, disables textures
+ * @param texturesEnabled true if the textures should be enabled
+ */
+void Texture::setTextureEnableState(bool texturesEnabled)
+{
+  Texture::texturesEnabled = texturesEnabled;
+}
+
+
+//////////////////////////////////////
+// UTILITY FUNCTIONALITY OF TEXTURE //
+//////////////////////////////////////
 /**
  * converts surface to a new SDL_Surface, that is loadable by openGL
  * @param surface the Surface to convert
+ * @param hasAlpha if the newly created Surface has an alpha channel, true is returned otherwise false.
  * @returns a !!new!! Surface, that is loadable by openGL.
  */
-bool Texture::prepareSurface(SDL_Surface* surface)
+SDL_Surface* Texture::prepareSurface(SDL_Surface* surface, bool& hasAlpha)
 {
   PRINTF(4)("Loading texture to OpenGL-Environment.\n");
 
-  SDL_Surface* putSurface;
+  SDL_Surface* retSurface;
   SDL_Rect area;
   Uint32 saved_flags;
   Uint8  saved_alpha;
 
-  putSurface = SDL_CreateRGBSurface(SDL_SWSURFACE,
-                               surface->w, surface->h,
-                               32,
+  hasAlpha = false;
+  retSurface = SDL_CreateRGBSurface(SDL_SWSURFACE,
+                                    surface->w, surface->h,
+                                    32,
 #if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */
                                0x000000FF,
@@ -147,14 +196,13 @@
                                0xFF000000
 #else
-                               0xFF000000,
+                                   0xFF000000,
                                0x00FF0000,
                                0x0000FF00,
                                0x000000FF
 #endif
-                               );
-  if ( putSurface == NULL )
+                                   );
+  if ( retSurface == NULL )
   {
-    this->setSurface(NULL);
-    return false;
+    return NULL;
   }
 
@@ -171,5 +219,5 @@
   area.w = surface->w;
   area.h = surface->h;
-  SDL_BlitSurface(surface, &area, putSurface, &area);
+  SDL_BlitSurface(surface, &area, retSurface, &area);
 
   /* Restore the alpha blending attributes */
@@ -177,18 +225,8 @@
   {
     SDL_SetAlpha(surface, saved_flags | SDL_OPENGL, saved_alpha);
-    this->bAlpha = true;
-  }
-
-  return (this->setSurface(putSurface));
-}
-
-bool Texture::setSurface(SDL_Surface* newSurface)
-{
-  if (this->image != NULL)
-    SDL_FreeSurface(this->image);
-
-  this->image = newSurface;
-
-  return (this->image != NULL);
+    hasAlpha = true;
+  }
+
+  return (retSurface);
 }
 
@@ -199,16 +237,18 @@
  * @returns The ID of the texture.
  */
-GLuint Texture::loadTexToGL ()
-{
-  if (this->texture != 0 && glIsTexture(this->texture))
-    glDeleteTextures(1, &this->texture);
-  this->texture = 0;
-
-  if (this->image == NULL)
+GLuint Texture::loadTexToGL (const SDL_Surface* surface)
+{
+//   if (this->texture != 0 && glIsTexture(this->texture))
+//     glDeleteTextures(1, &this->texture);
+//   this->texture = 0;
+
+  GLuint texture;
+
+  if (surface == NULL)
     return 0;
 
   /* Create an OpenGL texture for the image */
-  glGenTextures(1, &this->texture);
-  glBindTexture(GL_TEXTURE_2D, this->texture);
+  glGenTextures(1, &texture);
+  glBindTexture(GL_TEXTURE_2D, texture);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
@@ -217,18 +257,18 @@
                0,
                GL_RGBA,
-               this->image->w, this->image->h,
+               surface->w, surface->h,
                0,
                GL_RGBA,
                GL_UNSIGNED_BYTE,
-               this->image->pixels);
+               surface->pixels);
   // build the MipMaps
   gluBuild2DMipmaps(GL_TEXTURE_2D,
                     GL_RGBA,
-                    this->image->w,
-                    this->image->h,
+                    surface->w,
+                    surface->h,
                     GL_RGBA,
                     GL_UNSIGNED_BYTE,
-                    this->image->pixels);
+                    surface->pixels);
   glBindTexture(GL_TEXTURE_2D, 0);
-  return this->texture;
-}
+  return texture;
+}
Index: branches/powerups/src/lib/graphics/importer/texture.h
===================================================================
--- branches/powerups/src/lib/graphics/importer/texture.h	(revision 5848)
+++ branches/powerups/src/lib/graphics/importer/texture.h	(revision 5955)
@@ -14,8 +14,4 @@
 struct SDL_Surface;
 
-//! an enumerator for different procedural texture-types
-typedef enum TEXTURE_TYPE { TEXTURE_RADIAL_ALIAS,
-  TEXTURE_NOISE };
-
 //! A Class, that reads in Textures from different fileformats.
   class Texture : public BaseObject
@@ -27,5 +23,5 @@
 
       bool loadImage(const char* imageName);
-      bool rebuild();
+      virtual bool rebuild();
 
       /** @returns The textureID of this texture.  */
@@ -33,15 +29,30 @@
       /** @returns true if texture has alpha, false otherwise */
       inline bool hasAlpha() const {return bAlpha;}
+      /** @returns the stored image of this Texture */
+      const SDL_Surface* const getStoredImage() const { return this->image; };
+
+
+
+      static void setTextureEnableState(bool texturesEnabled);
+      /** @returns true if Textures are enabled */
+      inline static bool getTextureEnableState() { return Texture::texturesEnabled; };
+
+      // Utility functionality:
+      static SDL_Surface* prepareSurface(SDL_Surface* input, bool& hasAlpha);
+      static GLuint loadTexToGL (const SDL_Surface* surface);
 
     protected:
-      bool prepareSurface(SDL_Surface* input);
+
       bool setSurface(SDL_Surface* newSurface);
+      bool setAlpha(bool hasAlpha) { this->bAlpha = hasAlpha; };
+      bool setTexture(GLuint texture) { this->texture = texture; };
 
-      GLuint loadTexToGL ();
 
     private:
-      GLuint        texture;            //!< The Texture-ID of opengl from this Texture.
-      bool          bAlpha;             //!< if the texture has an alpha channel.
-      SDL_Surface*  image;              //!< The SDL_Surfce that stores the Texture on it.
+      GLuint           texture;            //!< The Texture-ID of opengl from this Texture.
+      bool             bAlpha;             //!< if the texture has an alpha channel.
+      SDL_Surface*     image;              //!< The SDL_Surfce that stores the Texture on it.
+
+      static bool      texturesEnabled;    //!< If the Textures are enabled.
   };
 
Index: branches/powerups/src/lib/graphics/importer/texture_sequence.cc
===================================================================
--- branches/powerups/src/lib/graphics/importer/texture_sequence.cc	(revision 5955)
+++ branches/powerups/src/lib/graphics/importer/texture_sequence.cc	(revision 5955)
@@ -0,0 +1,164 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER
+
+#include "texture_sequence.h"
+
+#include "debug.h"
+#include "graphics_engine.h"
+
+#ifdef HAVE_SDL_IMAGE_H
+#include <SDL_image.h>
+#else
+#include <SDL/SDL_image.h>
+#endif
+
+/**
+ *  Constructor for a Texture
+ */
+TextureSequence::TextureSequence(unsigned int count, ...)
+{
+  this->setClassID(CL_TEXTURE_SEQUENCE, "TextureSequence");
+
+  va_list textureNameList;
+  va_start(textureNameList, count);
+
+  this->loadImageSeries(count, textureNameList);
+}
+
+/**
+ * Destructor of a TextureSequence
+ *
+ * Frees Data, and deletes the textures from GL
+ */
+TextureSequence::~TextureSequence()
+{
+  // delete all images
+  while(!this->images.empty())
+  {
+    SDL_FreeSurface(this->images.back());
+    this->images.pop_back();
+  }
+
+  this->setTexture(0);
+  // delete all textures.
+  while(!this->textures.empty())
+  {
+    if (glIsTexture(this->textures.back()))
+      glDeleteTextures(1, &this->textures.back());
+    this->textures.pop_back();
+  }
+}
+
+
+/**
+ * @brief rebuilds all the textures from the Images stored in this FrameSequence
+ */
+bool TextureSequence::rebuild()
+{
+  PRINTF(3)("Reloading TextureSequence of %s '%s'\n", this->getClassName(), this->getName());
+
+  for (unsigned int i = 0; i < this->textures.size(); i++)
+  {
+    if (glIsTexture(this->textures[i]))
+    {
+      glDeleteTextures(1, &this->textures[i]);
+      this->textures[i] = 0;
+    }
+
+    if (this->images[i] != NULL)
+      this->textures[i] = loadTexToGL(this->images[i]);
+  }
+}
+
+/**
+ * @brief loads an image Sequence
+ * @param count how many images to load to the TextureSequence
+ * @param ... the names of the Images to load
+ * @returns true on success, false otherwise
+ */
+bool TextureSequence::loadImageSeries(unsigned int count, ...)
+{
+  va_list textureNameList;
+  va_start(textureNameList, count);
+
+  return this->loadImageSeries(count, textureNameList);
+}
+
+/**
+ * @brief loads an image Sequence
+ * @param count how many images to load to the TextureSequence
+ * @param textures the names of the Images to load
+ * @returns true on success, false otherwise
+ */
+bool TextureSequence::loadImageSeries(unsigned int count, va_list textures)
+{
+  bool retVal = true;
+  for (unsigned int i = 0; i < count; i++)
+  {
+    if( !this->addFrame(va_arg(textures, char*)))
+      retVal = false;
+  }
+  return retVal;
+}
+
+/**
+ * @brief adds a new Frame to this Sequence (at the end)
+ * @param imageName the Name of the Image to add
+ * @returns true on success
+ */
+bool TextureSequence::addFrame(const char* imageName)
+{
+  if (imageName == NULL)
+    return false;
+
+  SDL_Surface* addSurface = IMG_Load(imageName);
+  bool success = this->addFrame(addSurface);
+  delete addSurface;
+
+  return success;
+}
+
+/**
+ * @brief adds a new Frame at the end of the Sequence.
+ * @param surface the Surface to add at the end of the Sequence.
+ */
+bool TextureSequence::addFrame(SDL_Surface* surface)
+{
+  if (surface == NULL)
+    return false;
+  bool hasAlpha;
+  SDL_Surface* newSurf = this->prepareSurface(surface, hasAlpha);
+  if (newSurf != NULL)
+  {
+    this->images.push_back(newSurf);
+    this->textures.push_back(Texture::loadTexToGL(newSurf));
+  }
+  this->setAlpha(hasAlpha);
+  return true;
+}
+
+
+
+/**
+ * @brief moves to the n'th texture which can then be retrieved via the Texture function: this->getTexture()
+ * @param frameNumber the n-th frame
+ */
+void TextureSequence::gotoFrame(unsigned int frameNumber)
+{
+  if (this->textures.size() > frameNumber)
+    this->setTexture(this->textures[frameNumber]);
+}
Index: branches/powerups/src/lib/graphics/importer/texture_sequence.h
===================================================================
--- branches/powerups/src/lib/graphics/importer/texture_sequence.h	(revision 5955)
+++ branches/powerups/src/lib/graphics/importer/texture_sequence.h	(revision 5955)
@@ -0,0 +1,48 @@
+/*!
+ * @file texture.h
+ * @brief Contains the texture class, that handles the reading of Images into Texutre-files.
+ */
+
+#ifndef _TEXTURE_SEQUENCE_H
+#define _TEXTURE_SEQUENCE_H
+
+#include "texture.h"
+
+#include "glincl.h"
+
+#include <vector>
+#include <stdarg.h>
+
+/* Forward Declaration */
+struct SDL_Surface;
+
+//! A Class, that reads in Textures from different fileformats.
+class TextureSequence : public Texture
+{
+  public:
+    TextureSequence(unsigned int count = 0, ...);
+  //  Texture(TEXTURE_TYPE type, int resolution);
+    ~TextureSequence();
+
+    bool loadImageSeries(unsigned int count, ...);
+    bool loadImageSeries(unsigned int count, va_list textureNames);
+    bool addFrame(const char* image);
+    bool addFrame(SDL_Surface* surface);
+
+    virtual bool rebuild();
+
+    /** @returns the count of frames in this sequence */
+    inline unsigned int getFrameCount() const { return this->textures.size(); };
+
+    void gotoFrame(unsigned int frameNumber);
+    /** @returns The textureID of the Frame @param frameNumber the n-th frame this texture-series.  */
+    inline GLuint getFrameTexture(unsigned int frameNumber) const { return (this->textures.size()>frameNumber)?this->textures[frameNumber]:0; };
+    /** @returns The SDL_Surface of the image at Frame @param frameNumber the n-th frame of this image-seriers */
+    const SDL_Surface* const getFrameImage(unsigned int frameNumber) const { return (this->images.size()>frameNumber)?this->images[frameNumber]:NULL; };
+
+  private:
+    std::vector<GLuint>          textures;            //!< The Texture-ID of opengl from this Texture.
+    std::vector<SDL_Surface*>    images;              //!< The SDL_Surfce that stores the Texture on it.
+};
+
+#endif /* _TEXTURE_SEQUENCE_H */
Index: branches/powerups/src/lib/graphics/light.cc
===================================================================
--- branches/powerups/src/lib/graphics/light.cc	(revision 5848)
+++ branches/powerups/src/lib/graphics/light.cc	(revision 5955)
@@ -22,5 +22,5 @@
 #include "glincl.h"
 #include "vector.h"
-#include "tinyxml.h"
+#include "parser/tinyxml/tinyxml.h"
 #include "load_param.h"
 #include "factory.h"
Index: branches/powerups/src/lib/graphics/render2D/element_2d.cc
===================================================================
--- branches/powerups/src/lib/graphics/render2D/element_2d.cc	(revision 5848)
+++ branches/powerups/src/lib/graphics/render2D/element_2d.cc	(revision 5955)
@@ -23,5 +23,5 @@
 #include "graphics_engine.h"
 #include "load_param.h"
-#include "tinyxml.h"
+#include "parser/tinyxml/tinyxml.h"
 #include "class_list.h"
 
Index: branches/powerups/src/lib/graphics/text_engine/font.cc
===================================================================
--- branches/powerups/src/lib/graphics/text_engine/font.cc	(revision 5848)
+++ branches/powerups/src/lib/graphics/text_engine/font.cc	(revision 5955)
@@ -181,6 +181,12 @@
     this->fontTTF = NULL;
   }
-  if (this->prepareSurface(surface))
-    this->loadTexToGL( );
+  bool hasAlpha;
+  SDL_Surface* newSurf = this->prepareSurface(surface, hasAlpha);
+  if (newSurf != NULL)
+  {
+    this->setSurface(newSurf);
+    this->setAlpha(hasAlpha);
+    this->setTexture(Texture::loadTexToGL(newSurf));
+  }
 
   // initializing the Glyphs.
@@ -491,5 +497,5 @@
 
   if (this->setSurface(tmpSurf))
-    loadTexToGL();
+    (this->setTexture(Texture::loadTexToGL(tmpSurf)));
 }
 
Index: branches/powerups/src/lib/graphics/text_engine/text_engine.cc
===================================================================
--- branches/powerups/src/lib/graphics/text_engine/text_engine.cc	(revision 5848)
+++ branches/powerups/src/lib/graphics/text_engine/text_engine.cc	(revision 5955)
@@ -64,5 +64,5 @@
 {
   // first remove all the remaining Texts (if any).
-  std::list<BaseObject*>* textList = ClassList::getList(CL_TEXT);
+  const std::list<BaseObject*>* textList = ClassList::getList(CL_TEXT);
   if (textList != NULL)
   {
@@ -71,5 +71,5 @@
   }
   // delete all remaining fonts (There should not be Anything to do here)
-  std::list<BaseObject*>* fontList = ClassList::getList(CL_FONT);
+  const std::list<BaseObject*>* fontList = ClassList::getList(CL_FONT);
   if (fontList != NULL)
   {
@@ -124,5 +124,5 @@
 void TextEngine::debug() const
 {
-  list<BaseObject*>* textList = ClassList::getList(CL_TEXT);
+  const list<BaseObject*>* textList = ClassList::getList(CL_TEXT);
   if (textList != NULL)
   {
@@ -132,5 +132,5 @@
     PRINT(0)("Reference: %p; Text Counts: %d\n", this, textList->size());
 
-    list<BaseObject*>::iterator text;
+    list<BaseObject*>::const_iterator text;
     for ( text = textList->begin(); text != textList->end(); text++)
       dynamic_cast<Text*>(*text)->debug();
