Index: /branches/water/src/world_entities/environments/mapped_water.cc
===================================================================
--- /branches/water/src/world_entities/environments/mapped_water.cc	(revision 8616)
+++ /branches/water/src/world_entities/environments/mapped_water.cc	(revision 8617)
@@ -31,4 +31,7 @@
   this->setClassID(CL_MAPPED_WATER, "MappedWater");
   this->toList(OM_ENVIRON);
+
+  // the NormalMapScale will be overwritten if its also set in the oxw file
+  this->setNormalMapScale(0.25f);
 
   if (root != NULL)
@@ -57,9 +60,13 @@
 
   // set the size of the refraction and reflection textures
-  
+
 
   // initialization of the texture coords, speeds etc...
+  // normalUV wont change anymore
+  this->normalUV = this->waterUV * this->kNormalMapScale;
+  // move and move2 are used for the reflection and refraction, the values are changed in tick()
   this->move = 0.0f;
-  this->kNormalMapScale = 0.25f;
+  this->move2 = this->move * this->kNormalMapScale;
+
 
   //unsigned int channels = 32;
@@ -174,4 +181,5 @@
   LoadParam(root, "wateruv", this, MappedWater, setWaterUV);
   LoadParam(root, "waterflow", this, MappedWater, setWaterFlow);
+  LoadParam(root, "normalmapscale", this, MappedWater, setNormalMapScale);
 }
 
@@ -198,6 +206,6 @@
   glBegin(GL_QUADS);
   // The back left vertice for the water
-  glMultiTexCoord2f(GL_TEXTURE0, 0.0f, g_WaterUV);            // Reflection texture
-  glMultiTexCoord2f(GL_TEXTURE1, 0.0f, refrUV - move);        // Refraction texture
+  glMultiTexCoord2f(GL_TEXTURE0, 0.0f, waterUV);            // Reflection texture
+  glMultiTexCoord2f(GL_TEXTURE1, 0.0f, waterUV - move);        // Refraction texture
   glMultiTexCoord2f(GL_TEXTURE2, 0.0f, normalUV + move2);     // Normal map texture
   glMultiTexCoord2f(GL_TEXTURE3, 0, 0);                       // DUDV map texture
@@ -212,6 +220,6 @@
 
   // The front right vertice for the water
-  glMultiTexCoord2f(GL_TEXTURE0, g_WaterUV, 0.0f);             // Reflection texture
-  glMultiTexCoord2f(GL_TEXTURE1, refrUV, 0.0f - move);         // Refraction texture
+  glMultiTexCoord2f(GL_TEXTURE0, waterUV, 0.0f);             // Reflection texture
+  glMultiTexCoord2f(GL_TEXTURE1, waterUV, 0.0f - move);         // Refraction texture
   glMultiTexCoord2f(GL_TEXTURE2, normalUV, 0.0f + move2);      // Normal map texture
   glMultiTexCoord2f(GL_TEXTURE3, 0, 0);                        // DUDV map texture
@@ -219,6 +227,6 @@
 
   // The back right vertice for the water
-  glMultiTexCoord2f(GL_TEXTURE0, g_WaterUV, g_WaterUV);        // Reflection texture
-  glMultiTexCoord2f(GL_TEXTURE1, refrUV, refrUV - move);       // Refraction texture
+  glMultiTexCoord2f(GL_TEXTURE0, waterUV, waterUV);        // Reflection texture
+  glMultiTexCoord2f(GL_TEXTURE1, waterUV, waterUV - move);       // Refraction texture
   glMultiTexCoord2f(GL_TEXTURE2, normalUV, normalUV + move2);  // Normal map texture
   glMultiTexCoord2f(GL_TEXTURE3, 0, 0);                        // DUDV map texture
@@ -230,14 +238,4 @@
   mat.unselect();
 
-  /*if(pos.y < this->waterPos.y)
-  {
-    // draw some fog
-    this->fog->activate();
-  }
-  else
-  {
-    this->fog->deactivate();
-  }*/
-
   glPopMatrix();
 }
@@ -249,9 +247,6 @@
 {
   // makes the water flow
-  // TODO change it so that the waterflow doesnt depend on the frame rate
-  this->move += this->g_WaterFlow;
+  this->move += this->waterFlow * dt;
   this->move2 = this->move * this->kNormalMapScale;
-  this->refrUV = this->g_WaterUV;
-  this->normalUV = this->g_WaterUV * this->kNormalMapScale; 
 }
 
Index: /branches/water/src/world_entities/environments/mapped_water.h
===================================================================
--- /branches/water/src/world_entities/environments/mapped_water.h	(revision 8616)
+++ /branches/water/src/world_entities/environments/mapped_water.h	(revision 8617)
@@ -44,6 +44,7 @@
     void setWaterPos(float x, float y, float z) { this->waterPos = Vector(x,y,z); };
     void setWaterSize(float x, float z) { this->xWidth = x; this->zWidth = z; };
-    void setWaterUV(float uv) { this->g_WaterUV = uv; };
-    void setWaterFlow(float flow) { this->g_WaterFlow = flow; };
+    void setWaterUV(float uv) { this->waterUV = uv; };
+    void setWaterFlow(float flow) { this->waterFlow = flow; };
+    void setNormalMapScale(float scale) { this->kNormalMapScale = scale; };
 
   private:
@@ -56,10 +57,9 @@
 
     float               move;                       //!< textures coords, speeds, positions for the shaded textures....
-    float               move2;                      //!<
-    float               g_WaterUV;                  //!<
-    float               g_WaterFlow;                //!<
-    float               refrUV;                     //!<
-    float               normalUV;                   //!<
-    float               kNormalMapScale;            //!<
+    float               move2;
+    float               waterUV;                    //!< size of the waves
+    float               waterFlow;                  //!< speed of the water
+    float               normalUV;
+    float               kNormalMapScale;
 
     int                 textureSize;                //!< height and width of the texture
@@ -67,8 +67,5 @@
     Shader*             shader;
     Shader::Uniform*    cam_uni;                    //!< uniform that is used for the camera position
-
-    //FogEffect*          fog;
-
 };
 
-#endif  /* _MAPPED_WATER_H */
+#endif
