Index: /trunk/src/lib/graphics/effects/graphics_effect.cc
===================================================================
--- /trunk/src/lib/graphics/effects/graphics_effect.cc	(revision 6978)
+++ /trunk/src/lib/graphics/effects/graphics_effect.cc	(revision 6979)
@@ -37,6 +37,4 @@
   this->setClassID(CL_GRAPHICS_EFFECT, "GraphicsEffect");
   this->bActivated = false;
-
-  this->bActivated = GraphicsEngine::getInstance()->loadGraphicsEffect(this);
 }
 
@@ -47,6 +45,5 @@
 GraphicsEffect::~GraphicsEffect()
 {
-  if( this->bActivated)
-    GraphicsEngine::getInstance()->unloadGraphicsEffect(this);
+
 }
 
Index: /trunk/src/lib/graphics/graphics_engine.cc
===================================================================
--- /trunk/src/lib/graphics/graphics_engine.cc	(revision 6978)
+++ /trunk/src/lib/graphics/graphics_engine.cc	(revision 6979)
@@ -46,7 +46,7 @@
 #include "load_param.h"
 #include "factory.h"
+#include "class_list.h"
 
 #ifdef __WIN32__
- #include "class_list.h"
  #include "static_model.h"
 #endif
@@ -85,6 +85,8 @@
   this->hwExtensions = NULL;
 
-  // initialize the TextEngine
+  // initialize the Modules
   TextEngine::getInstance();
+  this->graphicsEffects = NULL;
+
 }
 
@@ -115,6 +117,6 @@
 
   SDL_QuitSubSystem(SDL_INIT_VIDEO);
-//   if (this->screen != NULL)
-//     SDL_FreeSurface(this->screen);
+  //   if (this->screen != NULL)
+  //     SDL_FreeSurface(this->screen);
 
   GraphicsEngine::singletonRef = NULL;
@@ -128,6 +130,6 @@
 void GraphicsEngine::loadParams(const TiXmlElement* root)
 {
-  LoadParamXML(root, "GraphicsEffect", this, GraphicsEngine, loadGraphicsEffectXML)
-      .describe("loads a graphics effect");
+  LoadParamXML(root, "GraphicsEffect", this, GraphicsEngine, loadGraphicsEffects)
+  .describe("loads a graphics effect");
 }
 
@@ -169,8 +171,8 @@
   this->initVideo(atoi(resolution.getString(0)), atoi(resolution.getString(1)), 16);
 
-//   GraphicsEffect* fe = new FogEffect(NULL);
-//   this->loadGraphicsEffect(fe);
-//   fe->activate();
-//   PRINTF(0)("--------------------------------------------------------------\n");
+  //   GraphicsEffect* fe = new FogEffect(NULL);
+  //   this->loadGraphicsEffect(fe);
+  //   fe->activate();
+  //   PRINTF(0)("--------------------------------------------------------------\n");
 
   //LenseFlare* ge = new LenseFlare();
@@ -203,5 +205,5 @@
   {
     PRINTF(1)("could not initialize SDL Video\n");
-      //      return -1;
+    //      return -1;
   }
   // initialize SDL_GL-settings
@@ -214,8 +216,8 @@
   const SDL_VideoInfo* videoInfo = SDL_GetVideoInfo ();
   if( videoInfo == NULL)
-    {
-      PRINTF(1)("Failed getting Video Info :%s\n", SDL_GetError());
-      SDL_Quit ();
-    }
+  {
+    PRINTF(1)("Failed getting Video Info :%s\n", SDL_GetError());
+    SDL_Quit ();
+  }
   if( videoInfo->hw_available)
     this->videoFlags |= SDL_HWSURFACE;
@@ -226,5 +228,5 @@
     VideoFlags |= SDL_HWACCEL;
   */
-    // setting up the Resolution
+  // setting up the Resolution
   this->setResolution(resX, resY, bbp);
 
@@ -293,5 +295,5 @@
   const char* extensions = (const char*) glGetString(GL_EXTENSIONS);
 
-//  printf("%s %s %s\n %s", renderer, vendor, version, extensions);
+  //  printf("%s %s %s\n %s", renderer, vendor, version, extensions);
 
   if (this->hwRenderer == NULL && renderer != NULL)
@@ -348,28 +350,28 @@
     SDL_FreeSurface(screen);
   if((this->screen = SDL_SetVideoMode(this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags | this->fullscreenFlag)) == NULL)
-    {
-      PRINTF(1)("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags, SDL_GetError());
-      //    SDL_Quit();
-      //    return -1;
-    }
-    glViewport(0, 0, width, height);                     // Reset The Current Viewport
+  {
+    PRINTF(1)("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags, SDL_GetError());
+    //    SDL_Quit();
+    //    return -1;
+  }
+  glViewport(0, 0, width, height);                     // Reset The Current Viewport
 
 #ifdef __WIN32__
-    // REBUILDING TEXTURES (ON WINDOWS CONTEXT SWITCH)
-    const std::list<BaseObject*>* texList = ClassList::getList(CL_TEXTURE);
-    if (texList != NULL)
-    {
-      std::list<BaseObject*>::const_iterator reTex;
-      for (reTex = texList->begin(); reTex != texList->end(); reTex++)
-        dynamic_cast<Texture*>(*reTex)->rebuild();
-    }
-    // REBUILDING MODELS
-    const std::list<BaseObject*>* modelList = ClassList::getList(CL_STATIC_MODEL);
-    if (texList != NULL)
-    {
-      std::list<BaseObject*>::const_iterator reModel;
-      for (reModel = modelList->begin(); reModel != modelList->end(); reModel++)
-        dynamic_cast<StaticModel*>(*reModel)->rebuild();
-    }
+  // REBUILDING TEXTURES (ON WINDOWS CONTEXT SWITCH)
+  const std::list<BaseObject*>* texList = ClassList::getList(CL_TEXTURE);
+  if (texList != NULL)
+  {
+    std::list<BaseObject*>::const_iterator reTex;
+    for (reTex = texList->begin(); reTex != texList->end(); reTex++)
+      dynamic_cast<Texture*>(*reTex)->rebuild();
+  }
+  // REBUILDING MODELS
+  const std::list<BaseObject*>* modelList = ClassList::getList(CL_STATIC_MODEL);
+  if (texList != NULL)
+  {
+    std::list<BaseObject*>::const_iterator reModel;
+    for (reModel = modelList->begin(); reModel != modelList->end(); reModel++)
+      dynamic_cast<StaticModel*>(*reModel)->rebuild();
+  }
 #endif /* __WIN32__ */
 }
@@ -444,8 +446,8 @@
 {
 #if DEBUG < 3
-   if (steal)
-     SDL_WM_GrabInput(SDL_GRAB_ON);
-   else
-     SDL_WM_GrabInput(SDL_GRAB_OFF);
+  if (steal)
+    SDL_WM_GrabInput(SDL_GRAB_ON);
+  else
+    SDL_WM_GrabInput(SDL_GRAB_OFF);
 #endif
 }
@@ -457,8 +459,8 @@
 bool GraphicsEngine::isStealingEvents()
 {
-   if (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON)
-     return true;
-   else
-     return false;
+  if (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON)
+    return true;
+  else
+    return false;
 };
 
@@ -539,5 +541,6 @@
 
   /* Check is there are any modes available */
-  if(this->videoModes == (SDL_Rect **)0){
+  if(this->videoModes == (SDL_Rect **)0)
+  {
     PRINTF(1)("No modes available!\n");
     exit(-1);
@@ -545,8 +548,10 @@
 
   /* Check if our resolution is restricted */
-  if(this->videoModes == (SDL_Rect **)-1){
+  if(this->videoModes == (SDL_Rect **)-1)
+  {
     PRINTF(2)("All resolutions available.\n");
   }
-  else{
+  else
+  {
     /* Print valid modes */
     PRINT(0)("Available Resoulution Modes are\n");
@@ -592,13 +597,13 @@
 
 #ifndef NO_TEXT
-      char tmpChar1[20];
-      sprintf(tmpChar1, "Current:  %4.0f", this->currentFPS);
-      this->geTextCFPS->setText(tmpChar1);
-      char tmpChar2[20];
-      sprintf(tmpChar2, "Max:    %4.0f", this->maxFPS);
-      this->geTextMaxFPS->setText(tmpChar2);
-      char tmpChar3[20];
-      sprintf(tmpChar3, "Min:    %4.0f", this->minFPS);
-      this->geTextMinFPS->setText(tmpChar3);
+    char tmpChar1[20];
+    sprintf(tmpChar1, "Current:  %4.0f", this->currentFPS);
+    this->geTextCFPS->setText(tmpChar1);
+    char tmpChar2[20];
+    sprintf(tmpChar2, "Max:    %4.0f", this->maxFPS);
+    this->geTextMaxFPS->setText(tmpChar2);
+    char tmpChar3[20];
+    sprintf(tmpChar3, "Min:    %4.0f", this->minFPS);
+    this->geTextMinFPS->setText(tmpChar3);
 #endif /* NO_TEXT */
 
@@ -608,7 +613,10 @@
 
   // tick the graphics effects
-  list<GraphicsEffect*>::iterator it;
-  for (it = this->graphicsEffects.begin(); it != this->graphicsEffects.end(); it++)
-    (*it)->tick(dt);
+  if (this->graphicsEffects != NULL || (this->graphicsEffects = ClassList::getList(CL_GRAPHICS_EFFECT)) != NULL)
+  {
+    std::list<BaseObject*>::const_iterator it;
+    for (it = this->graphicsEffects->begin(); it != this->graphicsEffects->end(); it++)
+      dynamic_cast<GraphicsEffect*>(*it)->tick(dt);
+  }
 }
 
@@ -625,8 +633,11 @@
   Shader::restoreShader();
 
-  //draw the graphics effects
-  list<GraphicsEffect*>::const_iterator it;
-  for (it = this->graphicsEffects.begin(); it != this->graphicsEffects.end(); it++)
-    (*it)->draw();
+  if (this->graphicsEffects != NULL)
+  {
+    //draw the graphics effects
+    list<BaseObject*>::const_iterator it;
+    for (it = this->graphicsEffects->begin(); it != this->graphicsEffects->end(); it++)
+      dynamic_cast<GraphicsEffect*>(*it)->draw();
+  }
 }
 
@@ -648,36 +659,36 @@
 #ifndef NO_TEXT
   if( display )
-{
-  if (this->geTextCFPS == NULL)
-  {
-    this->geTextCFPS = new Text("fonts/arial_black.ttf", 15);
-    this->geTextCFPS->setName("curFPS");
-    this->geTextCFPS->setAlignment(TEXT_ALIGN_LEFT);
-    this->geTextCFPS->setAbsCoor2D(5, 0);
-  }
-  if (this->geTextMaxFPS == NULL)
-  {
-    this->geTextMaxFPS = new Text("fonts/arial_black.ttf", 15);
-    this->geTextMaxFPS->setName("MaxFPS");
-    this->geTextMaxFPS->setAlignment(TEXT_ALIGN_LEFT);
-    this->geTextMaxFPS->setAbsCoor2D(5, 20);
-  }
-  if (this->geTextMinFPS == NULL)
-  {
-    this->geTextMinFPS = new Text("fonts/arial_black.ttf", 15);
-    this->geTextMinFPS->setName("MinFPS");
-    this->geTextMinFPS->setAlignment(TEXT_ALIGN_LEFT);
-    this->geTextMinFPS->setAbsCoor2D(5, 40);
-  }
-}
-else
-{
-  delete this->geTextCFPS;
-  this->geTextCFPS = NULL;
-  delete this->geTextMaxFPS;
-  this->geTextMaxFPS = NULL;
-  delete this->geTextMinFPS;
-  this->geTextMinFPS = NULL;
-}
+  {
+    if (this->geTextCFPS == NULL)
+    {
+      this->geTextCFPS = new Text("fonts/arial_black.ttf", 15);
+      this->geTextCFPS->setName("curFPS");
+      this->geTextCFPS->setAlignment(TEXT_ALIGN_LEFT);
+      this->geTextCFPS->setAbsCoor2D(5, 0);
+    }
+    if (this->geTextMaxFPS == NULL)
+    {
+      this->geTextMaxFPS = new Text("fonts/arial_black.ttf", 15);
+      this->geTextMaxFPS->setName("MaxFPS");
+      this->geTextMaxFPS->setAlignment(TEXT_ALIGN_LEFT);
+      this->geTextMaxFPS->setAbsCoor2D(5, 20);
+    }
+    if (this->geTextMinFPS == NULL)
+    {
+      this->geTextMinFPS = new Text("fonts/arial_black.ttf", 15);
+      this->geTextMinFPS->setName("MinFPS");
+      this->geTextMinFPS->setAlignment(TEXT_ALIGN_LEFT);
+      this->geTextMinFPS->setAbsCoor2D(5, 40);
+    }
+  }
+  else
+  {
+    delete this->geTextCFPS;
+    this->geTextCFPS = NULL;
+    delete this->geTextMaxFPS;
+    this->geTextMaxFPS = NULL;
+    delete this->geTextMinFPS;
+    this->geTextMinFPS = NULL;
+  }
   this->bDisplayFPS = display;
 #else
@@ -695,5 +706,5 @@
   switch (event.type)
   {
-    case EV_VIDEO_RESIZE:
+      case EV_VIDEO_RESIZE:
       this->resolutionChanged(event.resize);
       break;
@@ -705,5 +716,5 @@
  * @param root The XML-element to load GraphicsEffects from
  */
-void GraphicsEngine::loadGraphicsEffectXML(const TiXmlElement* root)
+void GraphicsEngine::loadGraphicsEffects(const TiXmlElement* root)
 {
   LOAD_PARAM_START_CYCLE(root, element);
@@ -714,40 +725,2 @@
   LOAD_PARAM_END_CYCLE(element);
 }
-
-
-/**
- * loads a GraphicsEffect into the engine
- * @param effect the GraphicsEffect to add
- */
-bool GraphicsEngine::loadGraphicsEffect(GraphicsEffect* effect)
-{
-  list<GraphicsEffect*>::iterator it;
-  for (it = this->graphicsEffects.begin(); it != this->graphicsEffects.end(); it++)
-    if( (*it) == effect)
-      return false;
-
-  this->graphicsEffects.push_back(effect);
-
-  return true;
-}
-
-
-/**
- * unloads a GraphicsEffect from the engine
- * @param effect the GraphicsEffect to remove
- */
-bool GraphicsEngine::unloadGraphicsEffect(GraphicsEffect* effect)
-{
-  list<GraphicsEffect*>::iterator it;
-  for (it = this->graphicsEffects.begin(); it != this->graphicsEffects.end(); it++)
-  {
-    if( (*it) == effect)
-    {
-      this->graphicsEffects.erase(it);
-      return true;
-    }
-  }
-
-  return false;
-}
-
Index: /trunk/src/lib/graphics/graphics_engine.h
===================================================================
--- /trunk/src/lib/graphics/graphics_engine.h	(revision 6978)
+++ /trunk/src/lib/graphics/graphics_engine.h	(revision 6979)
@@ -86,7 +86,5 @@
     void process(const Event  &event);
 
-    void loadGraphicsEffectXML(const TiXmlElement* root);
-    bool loadGraphicsEffect(GraphicsEffect* effect);
-    bool unloadGraphicsEffect(GraphicsEffect* effect);
+    void loadGraphicsEffects(const TiXmlElement* root);
 
 
@@ -134,5 +132,5 @@
     float                      minFPS;             //!< minimal frame rate we ever got since start.
 
-    std::list<GraphicsEffect*> graphicsEffects;    //!< list of graphics effects
+    const std::list<BaseObject*>* graphicsEffects; //!< list of graphics effects
 
 
