Index: /trunk/src/lib/graphics/importer/height_map.cc
===================================================================
--- /trunk/src/lib/graphics/importer/height_map.cc	(revision 7496)
+++ /trunk/src/lib/graphics/importer/height_map.cc	(revision 7497)
@@ -326,89 +326,33 @@
 
 
-HeightMap::HeightMap()
-{
-}
-
-
-HeightMap::HeightMap(const std::string& height_map_name = "")
+
+
+
+HeightMap::HeightMap(const std::string& heightMapName)
     : VertexArrayModel()
 {
-  this->setClassID(CL_HEIGHT_MAP, "HeightMap");
-  heightMap =  IMG_Load(height_map_name.c_str());
-  if(heightMap!=NULL)
-  {
-    /*
-        WHAT about following checks:
-    - image size (rectangular?)
-    - image file type (bw?)
-
-    */
-
-    PRINTF(0)("loading Image %s\n", height_map_name.c_str());
-    PRINTF(0)("width : %i\n", heightMap->w);
-    PRINTF(0)("height : %i\n", heightMap->h);
-    PRINTF(0)("%i Byte(s) per Pixel \n", heightMap->format->BytesPerPixel);
-    PRINTF(0)("Rshift : %i\n", heightMap->format->Rshift);
-    PRINTF(0)("Bshift: %i\n", heightMap->format->Bshift);
-    PRINTF(0)("Gshift: %i\n", heightMap->format->Gshift);
-    PRINTF(0)("Rmask: %i\n", heightMap->format->Rmask);
-    PRINTF(0)("Gmask: %i\n", heightMap->format->Gmask);
-  }
-
-  else
-    PRINTF(4)("oops! couldn't load %s for some reason.\n", height_map_name.c_str());
-
-
-  generateNormalVectorField();
-
-  shiftX = 0;
-  shiftY = 0;
-  shiftZ = 0;
-
-}
-
-HeightMap::HeightMap(const std::string& height_map_name = NULL, const std::string& color_map_name = NULL)
+  this->init(heightMapName);
+
+  this->colorMap = NULL;
+}
+
+HeightMap::HeightMap(const std::string& heightMapName, const std::string& colorMapName)
     : VertexArrayModel()
 {
-  this->setClassID(CL_HEIGHT_MAP, "HeightMap");
-
-  heightMap =  IMG_Load(height_map_name.c_str());
-  if(heightMap!=NULL)
-  {
-
-    PRINTF(0)("loading Image %s\n", height_map_name.c_str());
-    PRINTF(0)("width : %i\n", heightMap->w);
-    PRINTF(0)("height : %i\n", heightMap->h);
-    PRINTF(0)("%i Byte(s) per Pixel \n", heightMap->format->BytesPerPixel);
-    PRINTF(0)("Rshift : %i\n", heightMap->format->Rshift);
-    PRINTF(0)("Bshift: %i\n", heightMap->format->Bshift);
-    PRINTF(0)("Gshift: %i\n", heightMap->format->Gshift);
-    PRINTF(0)("Rmask: %i\n", heightMap->format->Rmask);
-    PRINTF(0)("Gmask: %i\n", heightMap->format->Gmask);
-  }
-
-  else
-    PRINTF(4)("oops! couldn't load %s for some reason.\n", height_map_name.c_str());
-
-
-  generateNormalVectorField();
-
-  colorMap=NULL;
-  if(color_map_name != "")
-  {
-    colorMap = IMG_Load(color_map_name.c_str());
-  }
-
-  if(colorMap != NULL)
-  {
-    PRINTF(0)("loading Image %s\n", color_map_name.c_str());
-    PRINTF(0)("width : %i\n", colorMap->w);
-    PRINTF(0)("height : %i\n", colorMap->h);
-    PRINTF(0)("%i Byte(s) per Pixel \n", colorMap->format->BytesPerPixel);
-    PRINTF(0)("Rshift : %i\n", colorMap->format->Rshift);
-    PRINTF(0)("Bshift: %i\n", colorMap->format->Bshift);
-    PRINTF(0)("Gshift: %i\n", colorMap->format->Gshift);
-    PRINTF(0)("Rmask: %i\n", colorMap->format->Rmask);
-    PRINTF(0)("Gmask: %i\n", colorMap->format->Gmask);
+
+  this->init(heightMapName);
+
+  this->colorMap = IMG_Load(colorMapName.c_str());
+  if( this->colorMap != NULL)
+  {
+    PRINTF(0)("loading Image %s\n", colorMapName.c_str());
+    PRINTF(0)("width : %i\n", this->colorMap->w);
+    PRINTF(0)("height : %i\n", this->colorMap->h);
+    PRINTF(0)("%i Byte(s) per Pixel \n", this->colorMap->format->BytesPerPixel);
+    PRINTF(0)("Rshift : %i\n", this->colorMap->format->Rshift);
+    PRINTF(0)("Bshift: %i\n", this->colorMap->format->Bshift);
+    PRINTF(0)("Gshift: %i\n", this->colorMap->format->Gshift);
+    PRINTF(0)("Rmask: %i\n", this->colorMap->format->Rmask);
+    PRINTF(0)("Gmask: %i\n", this->colorMap->format->Gmask);
   }
   else
@@ -438,5 +382,4 @@
   delete colorMap;
 
-
   for(int i=0;i <    heightMap->h/tileSize ; i++)
   {
@@ -450,19 +393,43 @@
   delete[] tiles;
 
-
-
-
-
   for(int i=0;i<heightMap->h;i++)
     delete[] normalVectorField [i];
   delete[] normalVectorField;
-
-
-
-
-
-
-
-}
+}
+
+
+
+void HeightMap::init(const std::string& heightMapName)
+{
+  this->setClassID(CL_HEIGHT_MAP, "HeightMap");
+
+  this->shiftX = 0;
+  this->shiftY = 0;
+  this->shiftZ = 0;
+
+  heightMap =  IMG_Load(heightMapName.c_str());
+  if( heightMap != NULL)
+  {
+    /*
+    WHAT about following checks:
+    - image size (rectangular?)
+    - image file type (bw?)
+    */
+    PRINTF(1)("loading Image %s\n", heightMapName.c_str());
+    PRINTF(1)("width : %i\n", heightMap->w);
+    PRINTF(1)("height : %i\n", heightMap->h);
+    PRINTF(1)("%i Byte(s) per Pixel \n", heightMap->format->BytesPerPixel);
+    PRINTF(1)("Rshift : %i\n", heightMap->format->Rshift);
+    PRINTF(1)("Bshift: %i\n", heightMap->format->Bshift);
+    PRINTF(1)("Gshift: %i\n", heightMap->format->Gshift);
+    PRINTF(1)("Rmask: %i\n", heightMap->format->Rmask);
+    PRINTF(1)("Gmask: %i\n", heightMap->format->Gmask);
+  }
+  else
+    PRINTF(1)("oops! couldn't load %s for some reason.\n", heightMapName.c_str());
+
+  generateNormalVectorField();
+}
+
 
 void HeightMap::load()
@@ -587,8 +554,8 @@
 
 
-  int xInt = (int)x / scaleX;
+  int xInt = (int)( x / scaleX);
   x -= (float)((int)x);
   xInt = heightMap->h - xInt;
-  int yInt = (int)y / scaleZ;
+  int yInt = (int)( y / scaleZ);
   y -= (float) ((int) y); /*yInt = heightMap->w - yInt;*/
 
Index: /trunk/src/lib/graphics/importer/height_map.h
===================================================================
--- /trunk/src/lib/graphics/importer/height_map.h	(revision 7496)
+++ /trunk/src/lib/graphics/importer/height_map.h	(revision 7497)
@@ -77,8 +77,9 @@
 
   public:
-    HeightMap();
-    HeightMap(const std::string&);
-    HeightMap(const std::string&, const std::string&);
+    HeightMap(const std::string& heightMapName);
+    HeightMap(const std::string& heightMapName, const std::string& colorMapName);
     virtual ~HeightMap();
+
+    void init(const std::string& heightMapName);
 
     void setAbsCoor(Vector V);
