Index: /orxonox/trunk/src/importer/object.cc
===================================================================
--- /orxonox/trunk/src/importer/object.cc	(revision 3206)
+++ /orxonox/trunk/src/importer/object.cc	(revision 3207)
@@ -90,5 +90,4 @@
   if (this->mtlFileName)
     delete []this->mtlFileName;
-
   PRINTF(2)("Deleting Materials.\n");
   if (this->material)
@@ -103,11 +102,9 @@
 void Object::draw (void) const
 {
-  if (verbose >=2)
-    printf("drawing the 3D-Objects\n"); 
+  PRINTF(2)("drawing the 3D-Objects\n"); 
   Group* walker = this->firstGroup;
   while (walker != NULL)
     {
-      if (verbose >= 3)
-	printf ("Drawing object %s\n", walker->name);
+      PRINTF(3)("Drawing object %s\n", walker->name);
       glCallList (walker->listNumber);
       walker = walker->next;
@@ -125,10 +122,8 @@
   if (groupNumber >= this->groupCount)
     {
-      if (verbose>=1)
-	printf ("You requested object number %i, but this File only contains of %i Objects.\n", groupNumber-1, this->groupCount);
+      PRINTF(1)("You requested object number %i, but this File only contains of %i Objects.\n", groupNumber-1, this->groupCount);
       return;
     }
-  if (verbose >=2)
-    printf("drawing the requested 3D-Objects if found.\n"); 
+  PRINTF(2)("drawing the requested 3D-Objects if found.\n"); 
   Group* walker = this->firstGroup;
   int counter = 0;
@@ -137,6 +132,5 @@
       if (counter == groupNumber)
 	{
-	  if (verbose >= 2)
-	    printf ("Drawing object number %i named %s\n", counter, walker->name);
+	  PRINTF(2)("Drawing object number %i named %s\n", counter, walker->name);
 	  glCallList (walker->listNumber);
 	  return;
@@ -145,6 +139,5 @@
       walker = walker->next;
     }
-  if (verbose >= 1)
-    printf("Object number %i in %s not Found.\n", groupNumber, this->objFileName);
+  PRINTF(1)("Object number %i in %s not Found.\n", groupNumber, this->objFileName);
   return;
 
@@ -159,6 +152,5 @@
 void Object::draw (char* groupName) const
 {
-  if (verbose >=2)
-    printf("drawing the requested 3D-Objects if found.\n"); 
+  PRINTF(2)("drawing the requested 3D-Objects if found.\n"); 
   Group* walker = this->firstGroup;
   while (walker != NULL)
@@ -166,6 +158,5 @@
       if (!strcmp(walker->name, groupName))
 	{
-	  if (verbose >= 2)
-	    printf ("Drawing object %s\n", walker->name);
+	  PRINTF(2)("Drawing object %s\n", walker->name);
 	  glCallList (walker->listNumber);
 	  return;
@@ -173,6 +164,5 @@
       walker = walker->next;
     }
-  if (verbose >= 2)
-    printf("Object Named %s in %s not Found.\n", groupName, this->objFileName);
+  PRINTF(1)("Object Named %s in %s not Found.\n", groupName, this->objFileName);
   return;
 }
@@ -194,6 +184,5 @@
 bool Object::initialize (void)
 {
-  if (verbose >=3)
-    printf("new 3D-Object is being created\n"); 
+  PRINTF(2)("new 3D-Object is being created\n"); 
 
   // setting the start group;
@@ -224,6 +213,5 @@
 bool Object::initGroup(Group* group)
 {
-  if (verbose >= 2)
-    printf("Adding new Group\n");
+  PRINTF(3)("Adding new Group\n");
   group->name = "";
   group->faceMode = -1;
@@ -259,6 +247,5 @@
 bool Object::cleanup(void)
 {
-  if (verbose >=2)
-    printf("cleaning up the 3D-Object to save Memory.\n");
+  PRINTF(3)("cleaning up the 3D-Object to save Memory.\n");
 
   if (this->vertices)
@@ -279,6 +266,5 @@
 bool Object::cleanupGroup (Group* group)
 {
-  if (verbose>=4)
-    printf ("Cleaning up group\n");
+  PRINTF(3)("Cleaning up group\n");
   if (group->firstFace != NULL)
     {
@@ -298,6 +284,5 @@
 bool Object::cleanupFace (Face* face)
 {
-  if (verbose>=4)
-    printf ("Cleaning up Face\n");
+  PRINTF(3)("Cleaning up Face\n");
 
   if (face->materialString != NULL)
@@ -337,6 +322,5 @@
 bool Object::importFile (char* fileName)
 {
-  if (verbose >=3)
-    printf("preparing to read in file: %s\n", fileName);
+  PRINTF(3)("preparing to read in file: %s\n", fileName);
 
 
@@ -361,9 +345,7 @@
   if (verbose >=2)
     if (strlen(objPath)> 0)
-      {
-	printf("Resolved file %s to folder: %s.\n", name, objPath);
-      }
+      PRINTF(0)("Resolved file %s to folder: %s.\n", name, objPath);
     else
-      printf("Resolved file %s.\n", name);
+      PRINTF(0)("Resolved file %s.\n", name);
   
   if (this->material)
@@ -390,6 +372,5 @@
   if (OBJ_FILE->fail())
     {
-      if (verbose >=1)
-	printf ("unable to open .OBJ file: %s\n Loading Box Object instead.\n", fileName);
+      PRINTF(1)("unable to open .OBJ file: %s\n Loading Box Object instead.\n", fileName);
       BoxObject();
       OBJ_FILE->close();
@@ -398,12 +379,10 @@
       return false;
     }
-  if (verbose >=2)
-    printf ("Reading from opened file %s\n", fileName);
+  PRINTF(2)("Reading from opened file %s\n", fileName);
   char Buffer[10000];
   while(!OBJ_FILE->eof())
     {
       OBJ_FILE->getline(Buffer, 10000);
-      if (verbose >=4)
-	printf ("Read input line: %s\n", Buffer);
+      PRINTF(3)("Read input line: %s\n", Buffer);
       
 
@@ -449,5 +428,5 @@
 	{
 	  if (verbose >= 2)
-	    printf("smoothing groups not supportet yet. line: %s\n", Buffer);
+	    PRINTF(2)("smoothing groups not supportet yet. line: %s\n", Buffer);
 	}
     }
@@ -468,6 +447,5 @@
 bool Object::readGroup (char* groupString)
 {
-  if (verbose >=3)
-    printf ("Read Group: %s.\n", groupString);
+  PRINTF(3)("Read Group: %s.\n", groupString);
   if (this->groupCount != 0 && this->currentGroup->faceCount>0)
     {
@@ -498,6 +476,5 @@
   float subbuffer3;
   sscanf (vertexString, "%f %f %f", &subbuffer1, &subbuffer2, &subbuffer3);
-  if (verbose >= 3)
-    printf ("reading in a vertex: %f %f %f\n", &subbuffer1, &subbuffer2, &subbuffer3);
+  PRINTF(3)("reading in a vertex: %f %f %f\n", &subbuffer1, &subbuffer2, &subbuffer3);
   this->vertices->addEntry(subbuffer1*scaleFactor, subbuffer2*scaleFactor, subbuffer3*scaleFactor);
   return true;
@@ -580,6 +557,5 @@
   float subbuffer3;
   sscanf (normalString, "%f %f %f", &subbuffer1, &subbuffer2, &subbuffer3);
-  if (verbose >=3 )
-    printf("found vertex-Normal %f, %f, %f\n", &subbuffer1,&subbuffer2,&subbuffer3);
+  PRINTF(3)("found vertex-Normal %f, %f, %f\n", &subbuffer1,&subbuffer2,&subbuffer3);
   this->normals->addEntry(subbuffer1, subbuffer2, subbuffer3);
   return true;
@@ -598,6 +574,5 @@
   float subbuffer2;
   sscanf (vTextureString, "%f %f", &subbuffer1, &subbuffer2);
-  if (verbose >=3 )
-    printf("found vertex-Texture %f, %f\n", &subbuffer1, &subbuffer2);
+  PRINTF(3)("found vertex-Texture %f, %f\n", &subbuffer1, &subbuffer2);
   this->vTexture->addEntry(subbuffer1);
   this->vTexture->addEntry(subbuffer2);
@@ -623,6 +598,5 @@
   
 
-  if (verbose >=2)
-    printf ("Opening mtlFile: %s\n", fileName);
+  PRINTF(2)("Opening mtlFile: %s\n", fileName);
 
   ifstream* MTL_FILE = new ifstream (fileName);
@@ -630,5 +604,5 @@
     {
       if (verbose >= 1)
-	printf ("unable to open file: %s\n", fileName);
+	PRINTF(2)("unable to open file: %s\n", fileName);
       MTL_FILE->close();
       delete []fileName;
@@ -641,6 +615,5 @@
     {
       MTL_FILE->getline(Buffer, 500);
-      if (verbose >= 4)
-	printf("found line in mtlFile: %s\n", Buffer);
+      PRINTF(4)("found line in mtlFile: %s\n", Buffer);
       
 
@@ -649,5 +622,5 @@
 	{
 	  tmpMat = tmpMat->addMaterial(Buffer+7);
-	  //	  printf ("%s, %p\n", tmpMat->getName(), tmpMat);
+	  //	  PRINTF(2)("%s, %p\n", tmpMat->getName(), tmpMat);
 	}
       // setting a illumMode
@@ -720,6 +693,5 @@
   if (!this->mtlFileName)
     {
-      if (verbose >= 1)
-	printf ("Not using new defined material, because no mtlFile found yet\n");
+      PRINTF(4)("Not using new defined material, because no mtlFile found yet\n");
       return false;
     }
@@ -758,5 +730,5 @@
       if ((this->currentGroup->listNumber = glGenLists(1)) == 0)
 	{
-	  printf ("list could not be created for this Object\n");
+	  PRINTF(1)("list could not be created for this Object\n");
 	  return false;
 	}
@@ -772,6 +744,5 @@
 		glEnd();
 	      this->currentGroup->faceMode = 0;
-	      if (verbose >= 2)
-		printf ("using material %s for coming Faces.\n", tmpFace->materialString);
+	      PRINTF(2)("using material %s for coming Faces.\n", tmpFace->materialString);
 	      Material* tmpMat;
 	      if ((tmpMat = material->search(tmpFace->materialString)) != NULL)
@@ -790,6 +761,5 @@
 	      
 	      this->currentGroup->faceMode = 3;
-	      if (verbose >=3)
-		printf ("found triag.\n");
+	      PRINTF(3)("found triag.\n");
 	    }
 	  
@@ -803,6 +773,5 @@
 		}
 	      this->currentGroup->faceMode = 4;
-	      if (verbose >=3 )
-		printf ("found quad.\n");
+	      PRINTF(3)("found quad.\n");
 	    }
 	  
@@ -812,6 +781,5 @@
 		glEnd();
 	      glBegin(GL_POLYGON);
-	      if (verbose >=3)
-		printf ("Polygon with %i faces found.", tmpFace->vertexCount);
+	      PRINTF(3)("Polygon with %i faces found.", tmpFace->vertexCount);
 	      this->currentGroup->faceMode = tmpFace->vertexCount;
 	    }
@@ -820,5 +788,5 @@
 	  while (tmpElem != NULL)
 	    {
-	      //      printf ("%s\n", tmpElem->value);
+	      //      PRINTF(2)("%s\n", tmpElem->value);
 	      this->addGLElement(tmpElem);
 	      tmpElem = tmpElem->next;
@@ -845,6 +813,5 @@
 bool Object::addGLElement (FaceElement* elem)
 {
-  if (verbose >=3)
-    printf ("importing grafical Element to openGL.\n");
+  PRINTF(3)("importing grafical Element to openGL.\n");
 
   if (elem->texCoordNumber != -1)
@@ -869,6 +836,5 @@
 {
   
-  if (verbose >=2)
-    printf("Normals are being calculated.\n");
+  PRINTF(2)("Normals are being calculated.\n");
 
   Vector* normArray = new Vector [vertices->getCount()/3];
@@ -927,6 +893,5 @@
     {
       normArray[i].normalize();
-      if (verbose >=3)
-	printf ("Found Normale number %d: (%f; %f, %f).\n", i, normArray[i].x, normArray[i].y, normArray[i].z);
+      PRINTF(3)("Found Normale number %d: (%f; %f, %f).\n", i, normArray[i].x, normArray[i].y, normArray[i].z);
 
       this->normals->addEntry(normArray[i].x, normArray[i].y, normArray[i].z);
