Index: /branches/water/src/story_entities/game_world.cc
===================================================================
--- /branches/water/src/story_entities/game_world.cc	(revision 7813)
+++ /branches/water/src/story_entities/game_world.cc	(revision 7814)
@@ -497,6 +497,7 @@
       LightManager::getInstance()->draw();
       // draw everything to be included in the reflection
-      for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
-        this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
+      this->drawEntityList(State::getObjectManager()->getReflectionList());
+//       for (unsigned int i = 0; i < this->dataTank->drawLists.size(); ++i)
+//         this->drawEntityList(State::getObjectManager()->getObjectList(this->dataTank->drawLists[i]));
 
       // clean up from reflection rendering
Index: /branches/water/src/util/object_manager.cc
===================================================================
--- /branches/water/src/util/object_manager.cc	(revision 7813)
+++ /branches/water/src/util/object_manager.cc	(revision 7814)
@@ -65,7 +65,6 @@
       delete this->objectLists[i].front();
 
-  // delete reflectin list
-  while( !this->reflectionList.empty())
-    delete this->reflectionList.front();
+  // delete reflection list
+  this->reflectionList.clear();
 }
 
Index: /branches/water/src/world_entities/environments/mapped_water.cc
===================================================================
--- /branches/water/src/world_entities/environments/mapped_water.cc	(revision 7813)
+++ /branches/water/src/world_entities/environments/mapped_water.cc	(revision 7814)
@@ -34,13 +34,8 @@
     this->loadParams(root);
 
-  //! HACK FIXME HACK FIXME HACK FIXME HACK FIXME
   //! todo: rename texture to reflection texture
   // set up refleciton texture
-  //mat.setDiffuseMap(&this->texture, 0);
+  // FIXME mat.setDiffuseMap(this->texture, 0); doesnt work,
   mat.setDiffuseMap("pictures/dudvmap.bmp", GL_TEXTURE_2D, 0);
-/*  mat.setDiffuseMap("pictures/sky-replace.jpg", GL_TEXTURE_2D, 1);
-  mat.setDiffuseMap("pictures/sky-replace.jpg", GL_TEXTURE_2D, 2);
-  mat.setDiffuseMap("pictures/sky-replace.jpg", GL_TEXTURE_2D, 3);
-  mat.setDiffuseMap("pictures/sky-replace.jpg", GL_TEXTURE_2D, 4);*/
   // load refraction texture
   //mat.setDiffuseMap(&this->refractionTexture, 1);
@@ -71,4 +66,6 @@
   glTexImage2D(GL_TEXTURE_2D, 0, channels, this->textureSize, this->textureSize, 0, type, GL_UNSIGNED_INT, pTexture);
 
+  //gluBuild2DMipmaps(GL_TEXTURE_2D, channels, this->textureSize, this->textureSize, type,  GL_UNSIGNED_INT, pTexture);
+
   // Set the texture quality
   glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
@@ -80,5 +77,7 @@
   delete [] pTexture;
 
-  //  shader = new Shader( ResourceManager::getInstance()->getDataDir() + "/shaders/water.vert", ResourceManager::getInstance()->getDataDir() +"/shaders/mapped_water.frag");
+
+  //shader = new Shader( "/home/stefalie/svn/orxonox/data/trunk/shaders/water.vert", "/home/stefalie/svn/orxonox/data/trunk/shaders/mapped_water.frag");
+  shader = new Shader( ResourceManager::getInstance()->getDataDir() + "/shaders/mapped_water.vert", ResourceManager::getInstance()->getDataDir() +"/shaders/mapped_water.frag");
 }
 
@@ -101,4 +100,6 @@
   glTranslatef(0,this->waterHeight,0);
 
+  //HACK
+  glTranslatef(550,0,100);
   //glEnable(GL_LIGHTING);
 
@@ -111,5 +112,5 @@
   // HACK
 
-  //glDisable(GL_BLEND);
+  glDisable(GL_BLEND);
   //glActiveTexture(GL_TEXTURE0);
   //glBindTexture(GL_TEXTURE_2D, this->texture);
@@ -118,5 +119,6 @@
   glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(0));
 
-  // Shader init
+
+/*  // Shader init
   //this->shader->activateShader();
   GLint uniform;
@@ -162,34 +164,34 @@
   uniform = glGetUniformLocationARB(shader->getProgram(), "cameraPos");
   glUniform4fARB(uniform, vPosition.x, vPosition.y, vPosition.z, 1.0f);
-
+*/
   glBegin(GL_QUADS);
-  glNormal3f(0,1,0);
-  glMultiTexCoord2f(GL_TEXTURE0, 0,0);
-  glMultiTexCoord2f(GL_TEXTURE1, 0,0);
-  glMultiTexCoord2f(GL_TEXTURE2, 0,0);
-  glMultiTexCoord2f(GL_TEXTURE3, 0,0);
-  glMultiTexCoord2f(GL_TEXTURE4, 0,0);
-  glVertex3f(0,0,0);
-
-  glMultiTexCoord2f(GL_TEXTURE0, 1,0);
-  glMultiTexCoord2f(GL_TEXTURE1, 1,0);
-  glMultiTexCoord2f(GL_TEXTURE2, 1,0);
-  glMultiTexCoord2f(GL_TEXTURE3, 1,0);
-  glMultiTexCoord2f(GL_TEXTURE4, 1,0);
-  glVertex3f(100,0,0);
-
-  glMultiTexCoord2f(GL_TEXTURE0, 1,1);
-  glMultiTexCoord2f(GL_TEXTURE1, 1,1);
-  glMultiTexCoord2f(GL_TEXTURE2, 1,1);
-  glMultiTexCoord2f(GL_TEXTURE3, 1,1);
-  glMultiTexCoord2f(GL_TEXTURE4, 1,1);
-  glVertex3f(100,0,-100);
-
-  glMultiTexCoord2f(GL_TEXTURE0, 0,1);
-  glMultiTexCoord2f(GL_TEXTURE1, 0,1);
-  glMultiTexCoord2f(GL_TEXTURE2, 0,1);
-  glMultiTexCoord2f(GL_TEXTURE3, 0,1);
-  glMultiTexCoord2f(GL_TEXTURE4, 0,1);
-  glVertex3f(0,0,-100);
+  glNormal3f(0, 1, 0);
+  glMultiTexCoord2f(GL_TEXTURE0, 0, 0);
+  glMultiTexCoord2f(GL_TEXTURE1, 0, 0);
+  glMultiTexCoord2f(GL_TEXTURE2, 0, 0);
+  glMultiTexCoord2f(GL_TEXTURE3, 0, 0);
+  glMultiTexCoord2f(GL_TEXTURE4, 0, 0);
+  glVertex3f(-500, 0, 500);
+
+  glMultiTexCoord2f(GL_TEXTURE0, 1, 0);
+  glMultiTexCoord2f(GL_TEXTURE1, 1, 0);
+  glMultiTexCoord2f(GL_TEXTURE2, 1, 0);
+  glMultiTexCoord2f(GL_TEXTURE3, 1, 0);
+  glMultiTexCoord2f(GL_TEXTURE4, 1, 0);
+  glVertex3f(500, 0, 500);
+
+  glMultiTexCoord2f(GL_TEXTURE0, 1, 1);
+  glMultiTexCoord2f(GL_TEXTURE1, 1, 1);
+  glMultiTexCoord2f(GL_TEXTURE2, 1, 1);
+  glMultiTexCoord2f(GL_TEXTURE3, 1, 1);
+  glMultiTexCoord2f(GL_TEXTURE4, 1, 1);
+  glVertex3f(500, 0, -500);
+
+  glMultiTexCoord2f(GL_TEXTURE0, 0, 1);
+  glMultiTexCoord2f(GL_TEXTURE1, 0, 1);
+  glMultiTexCoord2f(GL_TEXTURE2, 0, 1);
+  glMultiTexCoord2f(GL_TEXTURE3, 0, 1);
+  glMultiTexCoord2f(GL_TEXTURE4, 0, 1);
+  glVertex3f(-500, 0, -500);
   glEnd();
   //this->shader->deactivateShader();
@@ -210,10 +212,10 @@
 {
   glPushAttrib(GL_VIEWPORT_BIT);
-  //   glPushMatrix();
+  
 
   //glLoadIdentity();
   glViewport(0,0, textureSize, textureSize);
 
-
+  glPushMatrix();
   // Clear the color and depth bits, reset the matrix and position our camera.
 
@@ -227,14 +229,14 @@
   //{
   // Translate the world, then flip it upside down
-  //   glTranslatef(0.0f, waterHeight*2.0f, 0.0f);
-  //  glScalef(1.0, -1.0, 1.0);
+  glTranslatef(0.0f, this->waterHeight*2.0f, 0.0f);
+  glScalef(1.0, -1.0, 1.0);
 
   // Since the world is updside down we need to change the culling to FRONT
-  //glCullFace(GL_FRONT);
+  glCullFace(GL_FRONT);
 
   // Set our plane equation and turn clipping on
-  // double plane[4] = {0.0, 1.0, 0.0, -waterHeight};
-  //   glEnable(GL_CLIP_PLANE0);
-  // glClipPlane(GL_CLIP_PLANE0, plane);
+  double plane[4] = {0.0, 1.0, 0.0, -waterHeight};
+  //glEnable(GL_CLIP_PLANE0);
+  //glClipPlane(GL_CLIP_PLANE0, plane);
 
   // Render the world upside down and clipped (only render the top flipped).
@@ -265,13 +267,15 @@
 {
 //  glBindTexture(GL_TEXTURE_2D, texture.getTexture()); //is done by mat.select();
-  glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(0));
+  //glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(0));
 
   //mat.setDiffuseMap(&texture, 0);
-  // mat.select();
+  mat.select();
   glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, textureSize, textureSize);
-
+  //glDisable(GL_CLIP_PLANE0);
+
+  glPopMatrix();
 
   glPopAttrib();
-  //   glPopMatrix();
+  
 }
 
Index: /branches/water/src/world_entities/skybox.cc
===================================================================
--- /branches/water/src/world_entities/skybox.cc	(revision 7813)
+++ /branches/water/src/world_entities/skybox.cc	(revision 7814)
@@ -74,4 +74,5 @@
   this->setClassID(CL_SKYBOX, "SkyBox");
   this->toList(OM_ENVIRON_NOTICK);
+  this->toReflectionList();
   //this->size = 100.0;
   this->textureSize = 1024.0f;
Index: /branches/water/src/world_entities/terrain.cc
===================================================================
--- /branches/water/src/world_entities/terrain.cc	(revision 7813)
+++ /branches/water/src/world_entities/terrain.cc	(revision 7814)
@@ -106,4 +106,5 @@
   this->setClassID(CL_TERRAIN, "Terrain");
   this->toList(OM_ENVIRON_NOTICK);
+  this->toReflectionList();
 
   this->objectList = 0;
Index: /branches/water/src/world_entities/world_entity.cc
===================================================================
--- /branches/water/src/world_entities/world_entity.cc	(revision 7813)
+++ /branches/water/src/world_entities/world_entity.cc	(revision 7814)
@@ -242,5 +242,14 @@
 }
 
-
+void WorldEntity::toReflectionList()
+{
+  State::getObjectManager()->toReflectionList( this );
+}
+
+void removeFromReflectionList()
+{
+/// TODO
+///  State::getObject
+}
 
 /**
Index: /branches/water/src/world_entities/world_entity.h
===================================================================
--- /branches/water/src/world_entities/world_entity.h	(revision 7813)
+++ /branches/water/src/world_entities/world_entity.h	(revision 7814)
@@ -73,5 +73,6 @@
 
   void toList(OM_LIST list);
-
+  void toReflectionList();
+  void removeFromReflectionList();
 
   /** @returns a Reference to the objectListNumber to set. */
