Index: branches/bsp_model/src/lib/graphics/importer/bsp_file.cc
===================================================================
--- branches/bsp_model/src/lib/graphics/importer/bsp_file.cc	(revision 7525)
+++ branches/bsp_model/src/lib/graphics/importer/bsp_file.cc	(revision 7544)
@@ -45,5 +45,5 @@
   int size;
   struct stat results;
-  name = "/home/stefalie/svn/orxonox/data/Kanti175.bsp";
+  name = "/root/data/Kanti175.bsp";
 
   if (stat( name , &results) == 0) {
@@ -256,5 +256,5 @@
     glTexImage2D(GL_TEXTURE_2D,
                  0,
-                 GL_RGB,
+                 GL_RGBA8,
                  1,
                  1,
@@ -264,6 +264,6 @@
                  (const GLvoid *)&(this->whiteTexture));
 
-    gluBuild2DMipmaps(	GL_TEXTURE_2D, GL_RGB, 1, 1,
-                       GL_RGB, GL_FLOAT,(const GLvoid *) &(this->whiteTexture));
+   gluBuild2DMipmaps(	GL_TEXTURE_2D, GL_RGBA8, 1, 1,
+                      GL_RGB, GL_UNSIGNED_BYTE,(const GLvoid *) &(this->whiteTexture));
     
     
@@ -373,22 +373,41 @@
 void BspFile::load_textures()
 {
-  char absFileName [228];
+  ::std::string absFileName;
   char fileName [228];
   char ext [100];
   struct stat results;
-
+ 
+ 
   this->Materials = new AMat[this->numTextures];
   for(int i = 0 ; i < this->numTextures; i++) {
     PRINTF(0)("BSP FILE: Texture : %s. \n", &this->textures[8+ 72*i]);
-
+    
+    
+    strcpy(fileName, &this->textures[8+ 72*i]);
+    if(strlen(fileName) == 0)
+    {
+     // 	Default Material
+      this->Materials[i].mat = new Material();
+    this->Materials[i].mat->setDiffuse(0.1,0.1,0.1);
+    this->Materials[i].mat->setAmbient(0.1,0.1,0.1 );
+    this->Materials[i].mat->setSpecular(0.4,0.4,0.4);
+    //this->Materials[i]->setShininess(100.0);
+    this->Materials[i].mat->setTransparency(1.0);
+    this->Materials[i].mat->setDiffuseMap("pictures/ground.tga");
+    this->Materials[i].mat->setAmbientMap("pictures/ground.tga");
+    this->Materials[i].mat->setSpecularMap("pictures/ground.tga");
+    this->Materials[i].alpha = false;
+     continue;
+    } 
+     
+    
     // Check for tga
     strcpy(fileName, &this->textures[8+ 72*i]);
-    strcpy (absFileName,"/home/stefalie/svn/orxonox/data/trunk/");
     strcpy(ext, ".tga");
     strncat (fileName, ext, strlen(fileName));
-    strncat(absFileName,fileName,strlen(fileName));
-    // absFileName = ResourceManager::getFullName(fileName);
-
-    if(stat( absFileName , &results) == 0) {
+
+    absFileName = ResourceManager::getFullName(fileName);
+
+    if(ResourceManager::isFile(absFileName)) {
       PRINTF(0)("BSP FILE: gefunden . \n");
       this->Materials[i] = this->loadMat(fileName);
@@ -397,11 +416,9 @@
     // Check for TGA
     strcpy(fileName, &this->textures[8+ 72*i]);
-    strcpy (absFileName,"/home/stefalie/svn/orxonox/data/trunk/");
     strcpy(ext, ".TGA");
     strncat (fileName, ext, strlen(fileName));
-    strncat(absFileName,fileName,strlen(fileName));
-    // absFileName = ResourceManager::getFullName(fileName);
-
-    if(stat( absFileName , &results) == 0) {
+    absFileName = ResourceManager::getFullName(fileName);
+
+    if(ResourceManager::isFile(absFileName)/*stat( absFileName.c_str() , &results) == 0*/) {
       PRINTF(0)("BSP FILE: gefunden . \n");
       this->Materials[i] = this->loadMat(fileName);
@@ -410,10 +427,8 @@
     // Check for jpg
     strcpy(fileName, &this->textures[8+ 72*i]);
-    strcpy (absFileName,"/home/stefalie/svn/orxonox/data/trunk/");
     strcpy(ext, ".jpg");
     strncat (fileName, ext, strlen(fileName));
-    strncat(absFileName,fileName,strlen(fileName));
-    // absFileName = ResourceManager::getFullName(fileName);
-    if(stat( absFileName , &results) == 0) {
+    absFileName = ResourceManager::getFullName(fileName);
+    if(ResourceManager::isFile(absFileName)) {
       PRINTF(0)("BSP FILE: gefunden . \n");
       this->Materials[i] =this->loadMat(fileName);
@@ -424,10 +439,8 @@
     // Check for JPG
     strcpy(fileName, &this->textures[8+ 72*i]);
-    strcpy (absFileName,"/home/stefalie/svn/orxonox/data/trunk/");
     strcpy(ext, ".JPG");
     strncat (fileName, ext, strlen(fileName));
-    strncat(absFileName,fileName,strlen(fileName));
-    // absFileName = ResourceManager::getFullName(fileName);
-    if(stat( absFileName , &results) == 0) {
+    absFileName = ResourceManager::getFullName(fileName);
+    if(ResourceManager::isFile(absFileName)) {
       PRINTF(0)("BSP FILE: gefunden . \n");
       this->Materials[i] =this->loadMat(fileName);
@@ -435,12 +448,13 @@
     }
 
-    // Check for jpeg
+   
+
+    // Check for bmp
     strcpy(fileName, &this->textures[8+ 72*i]);
-    strcpy (absFileName,"/home/stefalie/svn/orxonox/data/trunk/");
-    strcpy(ext, ".jpeg");
+    strcpy(ext, ".bmp");
     strncat (fileName, ext, strlen(fileName));
-    strncat(absFileName,fileName,strlen(fileName));
-    // absFileName = ResourceManager::getFullName(fileName);
-    if(stat( absFileName , &results) == 0) {
+    absFileName = ResourceManager::getFullName(fileName);
+
+    if(ResourceManager::isFile(absFileName)) {
       PRINTF(0)("BSP FILE: gefunden . \n");
       this->Materials[i] =this->loadMat(fileName);
@@ -448,46 +462,17 @@
     }
 
-
-    // Check for JPEG
-    strcpy(fileName, &this->textures[8+ 72*i]);
-    strcpy (absFileName,"/home/stefalie/svn/orxonox/data/trunk/");
-    strcpy(ext, ".JPEG");
-    strncat (fileName, ext, strlen(fileName));
-    strncat(absFileName,fileName,strlen(fileName));
-    // absFileName = ResourceManager::getFullName(fileName);
-    PRINTF(0)("BSP FILE: %s . \n", absFileName);
-    if(stat( absFileName , &results) == 0) {
-      PRINTF(0)("BSP FILE: gefunden . \n");
-      this->Materials[i] =this->loadMat(fileName);
-      continue;
-    }
-
-    // Check for bmp
-    strcpy(fileName, &this->textures[8+ 72*i]);
-    strcpy (absFileName,"/home/stefalie/svn/orxonox/data/trunk/");
-    strcpy(ext, ".bmp");
-    strncat (fileName, ext, strlen(fileName));
-    strncat(absFileName,fileName,strlen(fileName));
-    // absFileName = ResourceManager::getFullName(fileName);
-
-    if(stat( absFileName , &results) == 0) {
-      PRINTF(0)("BSP FILE: gefunden . \n");
-      this->Materials[i] =this->loadMat(fileName);
-      
-    }
-
     // Check for BMP
     strcpy(fileName, &this->textures[8+ 72*i]);
-    strcpy (absFileName,"/home/stefalie/svn/orxonox/data/trunk/");
     strcpy(ext, ".BMP");
     strncat (fileName, ext, strlen(fileName));
-    strncat(absFileName,fileName,strlen(fileName));
-    // absFileName = ResourceManager::getFullName(fileName);
-
-    if(false /*stat( absFileName , &results) == 0*/) {
+    absFileName = ResourceManager::getFullName(fileName);
+
+    if(ResourceManager::isFile(absFileName)) {
       PRINTF(0)("BSP FILE: gefunden . \n");
       this->Materials[i] = this->loadMat(fileName);
       continue;
     }
+    
+    
     // 	Default Material
     this->Materials[i].mat = new Material();
@@ -501,4 +486,5 @@
     this->Materials[i].mat->setSpecularMap("pictures/ground.tga");
     this->Materials[i].alpha = false;
+    
   }
 }
@@ -524,6 +510,4 @@
 
   tmp->setDiffuseMap(mat);
-  tmp->setAmbientMap(mat);
-  tmp->setSpecularMap(mat);
 
   tmpAMat.mat = tmp;
@@ -535,5 +519,5 @@
 {
   int      errorCode = 0;           //!< the error code for the texture loading functions
-  unsigned int   lightMap;                 //!< the OpenGL texture handle
+  unsigned int   lightMap;          //!< the OpenGL texture handle
   int      mipmapLevel = 0;         //!< the maximum mipmap level for this texture
   int      mipmapWidth = 0;         //!< the width of the mipmap
@@ -544,12 +528,13 @@
   {
   sc =  ((unsigned char *)(&lightMapTexture))[i];
-  sc *= 10.5/255.0;
+  sc *= 1/255.0;
   scale = 1.0;
   if(sc > 1.0f && (temp = (1.0f/sc)) < scale) scale=temp;
   scale*=255.0;
   sc*=scale;
-    ((unsigned char *)(&lightMapTexture))[i] = (unsigned char)sc; 
-    
-  
+  if(sc <= 205)
+    ((unsigned char *)(&lightMapTexture))[i] = (unsigned char)sc + 50; 
+  else
+    ((unsigned char *)(&lightMapTexture))[i] = (unsigned char)sc;
   }
   
Index: branches/bsp_model/src/lib/graphics/importer/bsp_manager.cc
===================================================================
--- branches/bsp_model/src/lib/graphics/importer/bsp_manager.cc	(revision 7525)
+++ branches/bsp_model/src/lib/graphics/importer/bsp_manager.cc	(revision 7544)
@@ -189,9 +189,10 @@
   }
   if(curFace.type == 3) return;
-  // if(this->bspFile->Materials[curFace.texture] != NULL)
-  //if(this->lastTex != curFace.texture) {
+//  if(this->bspFile->Materials[curFace.texture] != NULL)
+    
+  if(this->lastTex != curFace.texture) {
     this->bspFile->Materials[curFace.texture].mat->select();
-  //   this->lastTex = curFace.texture;
-  //}
+     this->lastTex = curFace.texture;
+  }
     
     if(curFace.lm_index < 0) 
@@ -208,7 +209,7 @@
     }
     
-    glColor4f(3.0,3.0,3.0,0.9);
-  glEnableClientState(GL_VERTEX_ARRAY );  
-  //glEnableClientState(GL_TEXTURE_COORD_ARRAY );
+    glColor4f(3.0,3.0,3.0,1.0);
+  glEnableClientState(GL_VERTEX_ARRAY );
+  glEnableClientState(GL_TEXTURE_COORD_ARRAY );
   glEnableClientState(GL_NORMAL_ARRAY );
   //  glEnableClientState(GL_COLOR_ARRAY);
@@ -223,5 +224,5 @@
   glClientActiveTextureARB(GL_TEXTURE1_ARB);
   glTexCoordPointer(2, GL_FLOAT, stride, &(curVertex[offset].texcoord[1]));
-  glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+  //glEnableClientState(GL_TEXTURE_COORD_ARRAY);
 
   
@@ -287,8 +288,8 @@
 void BspManager::draw_patch(face* Face)
 {
-  //if(this->lastTex != Face->texture) {
+  if(this->lastTex != Face->texture) {
     this->bspFile->Materials[Face->texture].mat->select();
-    //this->lastTex = Face->texture;
-  //}
+    this->lastTex = Face->texture;
+  }
   
   
@@ -306,5 +307,5 @@
     glEnable(GL_TEXTURE_2D);
 }
-    glColor4f(3.0,3.0,3.0,0.9);
+    glColor4f(3.0,3.0,3.0,1.0);
   
   glEnable( GL_AUTO_NORMAL);
@@ -328,5 +329,5 @@
     glClientActiveTextureARB(GL_TEXTURE1_ARB);
     glTexCoordPointer(2, GL_FLOAT, 44, &((((BspVertex*)(this->bspFile->patchVertice))[8*8*(Face->meshvert+i)]).texcoord[1][0]));
-    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+    //glEnableClientState(GL_TEXTURE_COORD_ARRAY);
 
     
