Index: trunk/src/lib/event/event_handler.cc
===================================================================
--- trunk/src/lib/event/event_handler.cc	(revision 6769)
+++ trunk/src/lib/event/event_handler.cc	(revision 6771)
@@ -156,16 +156,16 @@
   PRINTF(4)("Subscribing event type: %i\n", eventType);
   if( state == ES_ALL )
-    {
-      for(unsigned int i = 0; i < ES_NUMBER; i++)
-        if( likely(this->listeners[i][eventType] == NULL))
-          this->listeners[i][eventType] = el;
-        else
-          PRINTF(2)("%s of class %s tried to subscribe to event %i @ state %i but this event has already been subscribed\n", el->getName(), el->getClassName(), eventType, state);
-    }
+  {
+    for(unsigned int i = 0; i < ES_NUMBER; i++)
+      if( likely(this->listeners[i][eventType] == NULL))
+        this->listeners[i][eventType] = el;
+      else
+        PRINTF(2)("%s of class %s tried to subscribe to event %i @ state %i but this event has already been subscribed\n", el->getName(), el->getClassName(), eventType, state);
+  }
   else
     if( likely(this->listeners[state][eventType] == NULL))
-      {
-        this->listeners[state][eventType] = el;
-      }
+    {
+      this->listeners[state][eventType] = el;
+    }
     else
       PRINTF(2)("% of class %s tried to subscribe to event %i @ state %i but this event has already been subscribed\n", el->getName(), el->getClassName(), eventType, state);
@@ -203,22 +203,22 @@
     return;
   if( state == ES_ALL)
-    {
-      for(unsigned int i = 0; i < ES_NUMBER; i++)
-        {
-          for(unsigned int j = 0; j < EV_NUMBER; j++)
-            {
-              if( this->listeners[i][j] == el )
-                this->listeners[i][j] = NULL;
-            }
-        }
-    }
-  else
-    {
-      for(int j = 0; j < EV_NUMBER; j++)
-        {
-          if( this->listeners[state][j] == el )
-            this->listeners[state][j] = NULL;
-        }
-    }
+  {
+    for(unsigned int i = 0; i < ES_NUMBER; i++)
+    {
+      for(unsigned int j = 0; j < EV_NUMBER; j++)
+      {
+        if( this->listeners[i][j] == el )
+          this->listeners[i][j] = NULL;
+      }
+    }
+  }
+  else
+  {
+    for(int j = 0; j < EV_NUMBER; j++)
+    {
+      if( this->listeners[state][j] == el )
+        this->listeners[state][j] = NULL;
+    }
+  }
 }
 
@@ -231,20 +231,20 @@
 {
   if( state == ES_ALL)
-    {
-      for(int i = 0; i < ES_NUMBER; ++i)
-        {
-          for(int j = 0; j < EV_NUMBER; ++j)
-            {
-              this->listeners[i][j] = NULL;
-            }
-        }
-    }
-  else
+  {
+    for(int i = 0; i < ES_NUMBER; ++i)
     {
       for(int j = 0; j < EV_NUMBER; ++j)
-        {
-          this->listeners[state][j] = NULL;
-        }
-    }
+      {
+        this->listeners[i][j] = NULL;
+      }
+    }
+  }
+  else
+  {
+    for(int j = 0; j < EV_NUMBER; ++j)
+    {
+      this->listeners[state][j] = NULL;
+    }
+  }
 }
 
@@ -262,5 +262,5 @@
     SDL_WM_GrabInput(SDL_GRAB_OFF);
   else
-    ;//    SDL_WM_GrabInput(SDL_GRAB_ON);
+    SDL_WM_GrabInput(SDL_GRAB_ON);
 }
 
@@ -276,84 +276,84 @@
   EventListener* listener = NULL;
   while( SDL_PollEvent (&event))
-    {
-      switch( event.type)
-        {
-        case SDL_KEYDOWN:
-          ev.bPressed = true;
-          ev.type = event.key.keysym.sym;
-          if (unlikely(this->bUNICODE))
-              ev.x = event.key.keysym.unicode;
-          break;
-        case SDL_KEYUP:
-          ev.bPressed = false;
-          ev.type = event.key.keysym.sym;
-          if (unlikely(this->bUNICODE))
-            ev.x = event.key.keysym.unicode;
-          break;
-        case SDL_MOUSEMOTION:
-          ev.bPressed = false;
-          ev.type = EV_MOUSE_MOTION;
-          ev.x = event.motion.x;
-          ev.y = event.motion.y;
-          ev.xRel = event.motion.xrel;
-          ev.yRel = event.motion.yrel;
-          break;
-        case SDL_MOUSEBUTTONUP:
-          ev.bPressed = false;
-          ev.type = event.button.button + SDLK_LAST;
-          break;
-        case SDL_MOUSEBUTTONDOWN:
-          ev.bPressed = true;
-          ev.type = event.button.button + SDLK_LAST;
-          break;
-        case SDL_JOYAXISMOTION:
-          ev.bPressed = false;
-          ev.type = EV_JOY_AXIS_MOTION;
-          break;
-        case SDL_JOYBALLMOTION:
-          ev.bPressed = false;
-          ev.type = EV_JOY_BALL_MOTION;
-          break;
-        case SDL_JOYHATMOTION:
-          ev.bPressed = false;
-          ev.type = EV_JOY_HAT_MOTION;
-          break;
-        case SDL_JOYBUTTONDOWN:
-          ev.bPressed = true;
-          ev.type = EV_JOY_BUTTON;
-          break;
-        case SDL_JOYBUTTONUP:
-          ev.bPressed = true;
-          ev.type = EV_JOY_BUTTON;
-          break;
-        case SDL_VIDEORESIZE:
-          ev.resize = event.resize;
-          ev.type = EV_VIDEO_RESIZE;
-          break;
-        case SDL_QUIT:
-          ev.type = EV_MAIN_QUIT;
-          break;
-        default:
-          ev.type = EV_UNKNOWN;
-          break;
-        }
-
-      /* small debug routine: shows all events dispatched by the event handler */
-      PRINT(4)("\n==========================| EventHandler::process () |===\n");
-      PRINT(4)("=  Got Event nr %i, for state %i", ev.type, this->state);
-
-      listener = this->listeners[this->state][ev.type];
-      if( listener != NULL)
-        {
-          PRINT(4)("=  Event dispatcher msg: This event has been consumed\n");
-          PRINT(4)("=======================================================\n");
-          listener->process(ev);
-        }
-      else
-        {
-          PRINT(4)("=  Event dispatcher msg: This event has NOT been consumed\n");
-          PRINT(4)("=======================================================\n");
-        }
-    }
+  {
+    switch( event.type)
+    {
+      case SDL_KEYDOWN:
+        ev.bPressed = true;
+        ev.type = event.key.keysym.sym;
+        if (unlikely(this->bUNICODE))
+          ev.x = event.key.keysym.unicode;
+        break;
+      case SDL_KEYUP:
+        ev.bPressed = false;
+        ev.type = event.key.keysym.sym;
+        if (unlikely(this->bUNICODE))
+          ev.x = event.key.keysym.unicode;
+        break;
+      case SDL_MOUSEMOTION:
+        ev.bPressed = false;
+        ev.type = EV_MOUSE_MOTION;
+        ev.x = event.motion.x;
+        ev.y = event.motion.y;
+        ev.xRel = event.motion.xrel;
+        ev.yRel = event.motion.yrel;
+        break;
+      case SDL_MOUSEBUTTONUP:
+        ev.bPressed = false;
+        ev.type = event.button.button + SDLK_LAST;
+        break;
+      case SDL_MOUSEBUTTONDOWN:
+        ev.bPressed = true;
+        ev.type = event.button.button + SDLK_LAST;
+        break;
+      case SDL_JOYAXISMOTION:
+        ev.bPressed = false;
+        ev.type = EV_JOY_AXIS_MOTION;
+        break;
+      case SDL_JOYBALLMOTION:
+        ev.bPressed = false;
+        ev.type = EV_JOY_BALL_MOTION;
+        break;
+      case SDL_JOYHATMOTION:
+        ev.bPressed = false;
+        ev.type = EV_JOY_HAT_MOTION;
+        break;
+      case SDL_JOYBUTTONDOWN:
+        ev.bPressed = true;
+        ev.type = EV_JOY_BUTTON;
+        break;
+      case SDL_JOYBUTTONUP:
+        ev.bPressed = true;
+        ev.type = EV_JOY_BUTTON;
+        break;
+      case SDL_VIDEORESIZE:
+        ev.resize = event.resize;
+        ev.type = EV_VIDEO_RESIZE;
+        break;
+      case SDL_QUIT:
+        ev.type = EV_MAIN_QUIT;
+        break;
+      default:
+        ev.type = EV_UNKNOWN;
+        break;
+    }
+
+    /* small debug routine: shows all events dispatched by the event handler */
+    PRINT(4)("\n==========================| EventHandler::process () |===\n");
+    PRINT(4)("=  Got Event nr %i, for state %i", ev.type, this->state);
+
+    listener = this->listeners[this->state][ev.type];
+    if( listener != NULL)
+    {
+      PRINT(4)("=  Event dispatcher msg: This event has been consumed\n");
+      PRINT(4)("=======================================================\n");
+      listener->process(ev);
+    }
+    else
+    {
+      PRINT(4)("=  Event dispatcher msg: This event has NOT been consumed\n");
+      PRINT(4)("=======================================================\n");
+    }
+  }
 }
 
Index: trunk/src/lib/graphics/importer/vertex_array_model.cc
===================================================================
--- trunk/src/lib/graphics/importer/vertex_array_model.cc	(revision 6769)
+++ trunk/src/lib/graphics/importer/vertex_array_model.cc	(revision 6771)
@@ -268,5 +268,5 @@
           this->addNormal(0.0, 1, 0.0);
           this->addTexCoor((float)i/(float)resolutionX, (float)j/(float)resolutionY);
-          this->addColor((float)i/20.0, 0.0, (float)j/20.0);
+          this->addColor(1.0, 1.0, 1.0);
         }
     }
Index: trunk/src/story_entities/game_world_data.cc
===================================================================
--- trunk/src/story_entities/game_world_data.cc	(revision 6769)
+++ trunk/src/story_entities/game_world_data.cc	(revision 6771)
@@ -33,4 +33,5 @@
 #include "test_entity.h"
 #include "terrain.h"
+#include "skybox.h"
 #include "md2Model.h"
 #include "world_entities/projectiles/projectile.h"
@@ -59,5 +60,4 @@
 #include "ogg_player.h"
 #include "shader.h"
-
 
 
@@ -207,5 +207,8 @@
       //todo do this more elegant
       if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox"))
+      {
         this->sky = dynamic_cast<WorldEntity*>(created);
+        State::setSkyBox(dynamic_cast<SkyBox*>(this->sky));
+      }
       if( element->Value() != NULL && !strcmp( element->Value(), "Terrain"))
       {
@@ -263,4 +266,6 @@
     delete this->objectManager;
   }
+  if(State::getSkyBox())
+    State::setSkyBox(NULL);
 }
 
Index: trunk/src/world_entities/environments/water.cc
===================================================================
--- trunk/src/world_entities/environments/water.cc	(revision 6769)
+++ trunk/src/world_entities/environments/water.cc	(revision 6771)
@@ -85,4 +85,9 @@
 }
 
+/**
+ * @brief rebuilds the Grid below the WaterSurface, killing all hight information
+ *
+ * This should be called on all subGrid changes except wave and tick.
+ */
 void Water::rebuildGrid()
 {
@@ -118,4 +123,7 @@
 }
 
+/**
+ * after this a rebuild() must be called
+ */
 void Water::setResolution(unsigned int resX, unsigned int resY)
 {
@@ -124,4 +132,7 @@
 }
 
+/**
+ * after this a rebuild() must be called
+ */
 void Water::setSize(float sizeX, float sizeY)
 {
@@ -136,4 +147,12 @@
 
 
+/**
+ * @brief calculated the Position in the Grid, this Point is nearest to
+ * @param x, the x-position over the Grid
+ * @param z: the z-Position(or y) over the Grid
+ * @param row returns the row if not out of range
+ * @param column returns the column if not out of range
+ * @returns true if a valid point is found, false if any x or y are out of range
+ */
 bool Water::posToGridPoint(float x, float z, unsigned int& row, unsigned int& column)
 {
@@ -152,18 +171,28 @@
 void Water::draw() const
 {
-  if (this->grid != NULL)
-  {
-    //SkyBox::enableCubeMap();
-    WorldEntity::draw();
-    glBindTexture(GL_TEXTURE_2D, 15);
-    glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
-    glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
-    glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
-    glEnable(GL_TEXTURE_GEN_S);
-    glEnable(GL_TEXTURE_GEN_T);
-
-    glEnable(GL_BLEND);
+  assert (this->grid != NULL);
+  {
+    glMatrixMode(GL_MODELVIEW);
+    glPushMatrix();
+
+    /* translate */
+    glTranslatef (this->getAbsCoor ().x,
+                  this->getAbsCoor ().y,
+                  this->getAbsCoor ().z);
+    Vector tmpRot = this->getAbsDir().getSpacialAxis();
+    glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+
+    if (State::getSkyBox())
+    {
+      glBindTexture(GL_TEXTURE_2D, State::getSkyBox()->getTexture(SKY_TOP));
+      glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
+      glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
+      glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
+      glEnable(GL_TEXTURE_GEN_S);
+      glEnable(GL_TEXTURE_GEN_T);
+    }
     glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    this->grid->draw();
     // this->waterShader->activateShader();
     //  this->waterMaterial->select();
Index: trunk/src/world_entities/skybox.h
===================================================================
--- trunk/src/world_entities/skybox.h	(revision 6769)
+++ trunk/src/world_entities/skybox.h	(revision 6771)
@@ -12,8 +12,15 @@
 /* INCLUDES */
 #include "world_entity.h"
+#include "material.h"
 
-/* FORWARD DECLARATION */
-class Material;
-class Texture;
+enum SKY_SIDE
+{
+  SKY_TOP = 0,
+  SKY_BOTTOM,
+  SKY_LEFT,
+  SKY_RIGHT,
+  SKY_FRONT,
+  SKY_BACK
+};
 
 //! A Class to handle a SkyBox
@@ -46,4 +53,6 @@
                            const char* right, const char* front, const char* back);
 
+  GLuint getTexture(SKY_SIDE side) const { return (this->material[side]) ? this->material[side]->getDiffuseTexture(): 0; };
+
   static void enableCubeMap();
   static void disableCubeMap();
