Index: orxonox/trunk/importer/material.cc
===================================================================
--- orxonox/trunk/importer/material.cc	(revision 3186)
+++ orxonox/trunk/importer/material.cc	(revision 3195)
@@ -36,6 +36,6 @@
 PathList::PathList()
 {
-  pathName = NULL;
-  next = NULL;
+  this->pathName = NULL;
+  this->next = NULL;
 }
 
@@ -48,7 +48,7 @@
 PathList::PathList(char* pName)
 {
-  pathName = new char [strlen(pName)+1];
-  strcpy (pathName, pName);
-  next = NULL;
+  this->pathName = new char [strlen(pName)+1];
+  strcpy (this->pathName, pName);
+  this->next = NULL;
 }
 
@@ -60,8 +60,8 @@
 PathList::~PathList()
 {
-  if (pathName)
-    delete []pathName;
-  if (next)
-    delete next;
+  if (this->pathName)
+    delete []this->pathName;
+  if (this->next)
+    delete this->next;
 }
 
@@ -114,7 +114,7 @@
 Material::Material()
 {
-  init();
-  
-  setName ("");
+  this->init();
+  
+  this->setName ("");
 }
 
@@ -125,7 +125,7 @@
 Material::Material (char* mtlName)
 {
-  init();
-  
-  setName (mtlName);
+  this->init();
+  
+  this->setName (mtlName);
 }
 
@@ -136,11 +136,11 @@
 {
   if (verbose >= 2)
-    printf ("delete Material %s.\n", name);
-  if (name)
-    delete []name;
-  if (diffuseTextureSet)
-    glDeleteTextures (1, &diffuseTexture);
-  if (nextMat)
-    delete nextMat;
+    printf ("delete Material %s.\n", this->name);
+  if (this->name)
+    delete []this->name;
+  if (this->diffuseTextureSet)
+    glDeleteTextures (1, &this->diffuseTexture);
+  if (this->nextMat)
+    delete this->nextMat;
 }
 
@@ -171,20 +171,20 @@
   if (verbose >= 3)
     printf ("initializing new Material.\n");
-  nextMat = NULL;
-  name ="";
-  setIllum(1);
-  setDiffuse(0,0,0);
-  setAmbient(0,0,0);
-  setSpecular(.5,.5,.5);
-  setShininess(2.0);
-  setTransparency(0.0);
-
-  if (!pathList)
-    pathList = new PathList("");
-
-
-  diffuseTextureSet = false;
-  ambientTextureSet = false;
-  specularTextureSet = false;
+  this->nextMat = NULL;
+  this->name ="";
+  this->setIllum(1);
+  this->setDiffuse(0,0,0);
+  this->setAmbient(0,0,0);
+  this->setSpecular(.5,.5,.5);
+  this->setShininess(2.0);
+  this->setTransparency(0.0);
+
+  if (!this->pathList)
+    this->pathList = new PathList("");
+
+
+  this->diffuseTextureSet = false;
+  this->ambientTextureSet = false;
+  this->specularTextureSet = false;
 
   
@@ -227,23 +227,23 @@
   // setting diffuse color
   //  glColor3f (diffuse[0], diffuse[1], diffuse[2]);
-  glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuse);
+  glMaterialfv(GL_FRONT, GL_DIFFUSE, this->diffuse);
 
   // setting ambient color
-  glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);
+  glMaterialfv(GL_FRONT, GL_AMBIENT, this->ambient);
 
   // setting up Sprecular
-  glMaterialfv(GL_FRONT, GL_SPECULAR, specular);
+  glMaterialfv(GL_FRONT, GL_SPECULAR, this->specular);
 
   // setting up Shininess
-  glMaterialf(GL_FRONT, GL_SHININESS, shininess);
+  glMaterialf(GL_FRONT, GL_SHININESS, this->shininess);
   
   // setting illumination Model 
-  if (illumModel == 1)
+  if (this->illumModel == 1) //! \todo make this work, if no vertex-normals are read.
     glShadeModel(GL_FLAT);
-  else if (illumModel >= 2)
+  else if (this->illumModel >= 2)
     glShadeModel(GL_SMOOTH);
 
-  if (diffuseTextureSet)
-    glBindTexture(GL_TEXTURE_2D, diffuseTexture);
+  if (this->diffuseTextureSet)
+    glBindTexture(GL_TEXTURE_2D, this->diffuseTexture);
   else
     glBindTexture(GL_TEXTURE_2D, 0);
@@ -258,8 +258,8 @@
 void Material::setName (char* mtlName)
 {
-  name = new char [strlen(mtlName)+1];
-  strcpy(name, mtlName);
+  this->name = new char [strlen(mtlName)+1];
+  strcpy(this->name, mtlName);
   if (verbose >= 3)
-    printf("setting Material Name to %s.\n", name);
+    printf("setting Material Name to %s.\n", this->name);
 
   //  printf ("adding new Material: %s, %p\n", this->getName(), this);
@@ -271,5 +271,5 @@
 char* Material::getName (void)
 {
-  return name;
+  return this->name;
 }
 
@@ -281,6 +281,6 @@
 {
   if (verbose >= 3)
-    printf("setting illumModel of Material %s to %i\n", name, illum);
-  illumModel = illum;
+    printf("setting illumModel of Material %s to %i\n", this->name, illum);
+  this->illumModel = illum;
   //  printf ("setting illumModel to: %i\n", illumModel);
 }
@@ -290,5 +290,5 @@
 */void Material::setIllum (char* illum)
 {
-  setIllum (atoi(illum));
+  this->setIllum (atoi(illum));
 }
 
@@ -302,9 +302,9 @@
 {
   if (verbose >= 3)
-    printf ("setting Diffuse Color of Material %s to r=%f g=%f b=%f.\n", name, r, g, b);
-  diffuse[0] = r;
-  diffuse[1] = g;
-  diffuse[2] = b;  
-  diffuse[3] = 1.0;
+    printf ("setting Diffuse Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
+  this->diffuse[0] = r;
+  this->diffuse[1] = g;
+  this->diffuse[2] = b;  
+  this->diffuse[3] = 1.0;
 
 }
@@ -317,5 +317,5 @@
   float r,g,b;
   sscanf (rgb, "%f %f %f", &r, &g, &b);
-  setDiffuse (r, g, b);
+  this->setDiffuse (r, g, b);
 }
 
@@ -329,9 +329,9 @@
 {
   if (verbose >=3)
-    printf ("setting Ambient Color of Material %s to r=%f g=%f b=%f.\n", name, r, g, b);
-  ambient[0] = r;
-  ambient[1] = g;
-  ambient[2] = b;
-  ambient[3] = 1.0;
+    printf ("setting Ambient Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
+  this->ambient[0] = r;
+  this->ambient[1] = g;
+  this->ambient[2] = b;
+  this->ambient[3] = 1.0;
 }
 /**
@@ -343,5 +343,5 @@
   float r,g,b;
   sscanf (rgb, "%f %f %f", &r, &g, &b);
-  setAmbient (r, g, b);
+  this->setAmbient (r, g, b);
 }
 
@@ -355,9 +355,9 @@
 {
   if (verbose >= 3)
-    printf ("setting Specular Color of Material %s to r=%f g=%f b=%f.\n", name, r, g, b);
-  specular[0] = r;
-  specular[1] = g;
-  specular[2] = b;
-  specular[3] = 1.0;
+    printf ("setting Specular Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
+  this->specular[0] = r;
+  this->specular[1] = g;
+  this->specular[2] = b;
+  this->specular[3] = 1.0;
  }
 /**
@@ -369,5 +369,5 @@
   float r,g,b;
   sscanf (rgb, "%f %f %f", &r, &g, &b);
-  setSpecular (r, g, b);
+  this->setSpecular (r, g, b);
 }
 
@@ -378,5 +378,5 @@
 void Material::setShininess (float shini)
 {
-  shininess = shini;
+  this->shininess = shini;
 }
 /**
@@ -386,5 +386,5 @@
 void Material::setShininess (char* shini)
 {
-  setShininess (atof(shini));
+  this->setShininess (atof(shini));
 }
 
@@ -396,6 +396,6 @@
 {
   if (verbose >= 3)
-    printf ("setting Transparency of Material %s to %f.\n", name, trans);
-  transparency = trans;
+    printf ("setting Transparency of Material %s to %f.\n", this->name, trans);
+  this->transparency = trans;
 }
 /**
@@ -405,5 +405,5 @@
 void Material::setTransparency (char* trans)
 {
-  setTransparency (atof(trans));
+  this->setTransparency (atof(trans));
 }
 
@@ -414,5 +414,5 @@
 void Material::addTexturePath(char* pathName)
 {
-  pathList->addPath (pathName);
+  this->pathList->addPath (pathName);
 }
 
@@ -464,5 +464,5 @@
 
   //  diffuseTextureSet = loadBMP(dMap, &diffuseTexture);
-  diffuseTextureSet = loadImage(dMap, &diffuseTexture);
+  this->diffuseTextureSet = this->loadImage(dMap, &this->diffuseTexture);
 
 }
@@ -471,4 +471,5 @@
    \brief Sets the Materials Ambient Map
    \param aMap the Name of the Image to Use
+   \todo implement this
 */
 void Material::setAmbientMap(char* aMap)
@@ -481,4 +482,5 @@
    \brief Sets the Materials Specular Map
    \param sMap the Name of the Image to Use
+   \todo implement this
 */
 void Material::setSpecularMap(char* sMap)
@@ -491,4 +493,5 @@
    \brief Sets the Materials Bumpiness
    \param bump the Name of the Image to Use
+   \todo implemet this
 */
 void Material::setBump(char* bump)
@@ -544,5 +547,5 @@
 	    pImage->data[i+2] = temp;
 	  }
-      loadTexToGL (pImage, texture);
+      this->loadTexToGL (pImage, texture);
     }
   else
@@ -570,5 +573,5 @@
 	  if (verbose >=2)
 	    printf ("Requested bmp-image. Trying to Import.\n");
-	  return loadBMP(imgNameWithPath, texture);
+	  return this->loadBMP(imgNameWithPath, texture);
 	}
       
@@ -577,5 +580,5 @@
 	  if (verbose >=2)
 	    printf ("Requested jpeg-image. Trying to Import\n");
-	  return loadJPG(imgNameWithPath, texture);
+	  return this->loadJPG(imgNameWithPath, texture);
 	}
       else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".tga", 4))
@@ -583,5 +586,5 @@
 	  if (verbose >=2)
 	    printf ("Requested tga-image. Trying to Import\n");
-	  return loadTGA(imgNameWithPath, texture);
+	  return this->loadTGA(imgNameWithPath, texture);
 	}
       else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".png", 4))
@@ -589,5 +592,5 @@
 	  if (verbose >=2)
 	    printf ("Requested png-image. Trying to Import\n");
-	  return loadPNG(imgNameWithPath, texture);
+	  return this->loadPNG(imgNameWithPath, texture);
 	}
       else
@@ -704,7 +707,6 @@
       pImage->data[i+2] = temp;
     }
-  loadTexToGL (pImage, texture);
-  
-  return true;
+  this->loadTexToGL (pImage, texture);
+  
 
   if (pImage)
@@ -717,4 +719,5 @@
       free(pImage);
     }
+  return true;
 
 }
@@ -802,5 +805,5 @@
     exit(0);
   
-  loadTexToGL (pImage, texture);
+  this->loadTexToGL (pImage, texture);
   if (pImage)
     {
@@ -947,5 +950,5 @@
     }
   
-  loadTexToGL (pImage, texture);
+  this->loadTexToGL (pImage, texture);
 
   return true;
@@ -1130,5 +1133,5 @@
   while(currentpixel < pixelcount);	// Loop while there are still pixels left
 
-  loadTexToGL (pImage, texture);
+  this->loadTexToGL (pImage, texture);
 
   return true;
@@ -1265,5 +1268,5 @@
     }
   */
-  loadTexToGL (pImage, texture);  
+  this->loadTexToGL (pImage, texture);  
   
   free(pImage->data);
