Index: orxonox/trunk/importer/array.cc
===================================================================
--- orxonox/trunk/importer/array.cc	(revision 3099)
+++ orxonox/trunk/importer/array.cc	(revision 3140)
@@ -33,13 +33,13 @@
     printf("deleting array\n");
   Entry* walker = firstEntry;
-  Entry* last;
-  while (walker != NULL)
+  Entry* previous;
+  while (walker)
     {
-      last = walker;
+      previous = walker;
       walker = walker->next;
-      delete last;
+      delete previous;
     }
   if (finalized)
-    delete [] array;
+    delete []array;
 }
 
Index: orxonox/trunk/importer/framework.cc
===================================================================
--- orxonox/trunk/importer/framework.cc	(revision 3099)
+++ orxonox/trunk/importer/framework.cc	(revision 3140)
@@ -1,5 +1,20 @@
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+*/
+
 #include "framework.h"
 
-int verbose = 1;
+int verbose = 2;
 
 void DrawGLScene()
@@ -43,5 +58,5 @@
   // Create a new OpenGL window with the title "Cone3D Basecode" at
   // 640x480x32, fullscreen and check for errors along the way
-  if(wHandler.CreateGLWindow("Whandler Basecode", 640, 480, 32, FALSE) == FALSE)
+  if(wHandler.CreateGLWindow("Whandler Basecode", 800, 600, 32, FALSE) == FALSE)
   {
     // If an error is found, display a message, kill the GL and SDL screens (if they were created) and exit
Index: orxonox/trunk/importer/material.cc
===================================================================
--- orxonox/trunk/importer/material.cc	(revision 3099)
+++ orxonox/trunk/importer/material.cc	(revision 3140)
@@ -12,7 +12,78 @@
    main-programmer: Benjamin Grauer
    co-programmer: ...
+
+   TGA-code: borrowed from nehe-Tutorials
+
+   ToDo: 
+   - free SDL-surface when deleting Material.
+   - delete imgNameWithPath after use creation.
 */
 
 #include "material.h"
+
+// headers only for PathList
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <fstream>
+
+using namespace std;
+
+
+PathList::PathList()
+{
+  pathName = NULL;
+  next = NULL;
+}
+PathList::PathList(char* pName)
+{
+  pathName = new char [strlen(pName)+1];
+  strcpy (pathName, pName);
+  next = NULL;
+}
+
+PathList::~PathList()
+{
+  if (pathName)
+    delete []pathName;
+  if (next)
+    delete next;
+}
+
+void PathList::addPath (char* pName)
+{
+  if (pName[0] == '\0')
+    {
+      if (verbose >=3)
+	printf("not Adding empty Path to the List.\n");
+      return;
+    }
+  char* tmpPName = new char[strlen(pName)];
+  strncpy(tmpPName, pName, strlen(pName)-1);
+  tmpPName[strlen(pName)-1] = '\0';
+  printf ("%s\n",tmpPName);
+  if (access (tmpPName, F_OK) == 0)
+    {
+      struct stat status;
+      stat(tmpPName, &status);
+      if (status.st_mode & S_IFDIR)
+	{
+	  if (verbose >=2)
+	    printf ("Adding Path %s to the PathList.\n", pName);
+	  PathList* tmpPathList = this;
+	  while (tmpPathList->next)
+	    tmpPathList = tmpPathList->next;
+	  tmpPathList->next = new PathList(pName);
+	}
+      else
+	if (verbose >=1)
+	  printf ("You tried to add non-folder %s to a PathList.\n", tmpPName);
+    }
+  else
+    if (verbose >=1)
+      printf ("You tried to add non-existing folder %s to a PathList.\n", tmpPName);
+  delete []tmpPName;
+}
 
 /**
@@ -43,9 +114,11 @@
 Material::~Material()
 {
+  if (verbose >= 2)
+    printf ("delete Material %s.\n", name);
   if (name)
     delete []name;
-  if (verbose >= 2)
-    printf ("delete Material %s.\n", name);
-  if (nextMat != NULL)
+  if (diffuseTextureSet)
+    glDeleteTextures (1, &diffuseTexture);
+  if (nextMat)
     delete nextMat;
 }
@@ -60,12 +133,11 @@
   if (verbose >=2)
     printf ("adding Material %s.\n", mtlName);
-  Material* newMat = new Material(mtlName);
-  Material* tmpMat = this;
+   Material* tmpMat = this;
   while (tmpMat->nextMat != NULL)
     {
       tmpMat = tmpMat->nextMat;
     }
-  tmpMat->nextMat = newMat;
-  return newMat;
+  tmpMat->nextMat = new Material(mtlName);
+  return tmpMat->nextMat;
   
 }
@@ -79,11 +151,15 @@
     printf ("initializing new Material.\n");
   nextMat = NULL;
-
+  name ="";
   setIllum(1);
   setDiffuse(0,0,0);
   setAmbient(0,0,0);
-  setSpecular(0,0,0);
+  setSpecular(.5,.5,.5);
   setShininess(2.0);
   setTransparency(0.0);
+
+  if (!pathList)
+    pathList = new PathList("");
+
 
   diffuseTextureSet = false;
@@ -93,4 +169,65 @@
   
 }
+
+PathList *Material::pathList = NULL;
+
+/**
+   \brief Search for a Material called mtlName
+   \param mtlName the Name of the Material to search for
+   \returns Material named mtlName if it is found. NULL otherwise.
+*/
+Material* Material::search (char* mtlName)
+{
+  if (verbose >=3)
+    printf ("Searching for material %s", mtlName);
+  Material* searcher = this;
+  while (searcher != NULL)
+    {
+      if (verbose >= 3)
+	printf (".");
+      if (!strcmp (searcher->getName(), mtlName))
+	{
+	  if (verbose >= 3)
+	    printf ("found.\n");
+	  return searcher;
+	}
+      searcher = searcher->nextMat;
+    }
+  if (verbose >=3)
+    printf ("not found\n");
+  return NULL;
+}
+
+/**
+   \brief sets the material with which the following Faces will be painted
+*/
+bool Material::select (void)
+{
+  // setting diffuse color
+  //  glColor3f (diffuse[0], diffuse[1], diffuse[2]);
+  glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuse);
+
+  // setting ambient color
+  glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);
+
+  // setting up Sprecular
+  glMaterialfv(GL_FRONT, GL_SPECULAR, specular);
+
+  // setting up Shininess
+  glMaterialf(GL_FRONT, GL_SHININESS, shininess);
+  
+  // setting illumination Model 
+  if (illumModel == 1)
+    glShadeModel(GL_FLAT);
+  else if (illumModel >= 2)
+    glShadeModel(GL_SMOOTH);
+
+  if (diffuseTextureSet)
+    glBindTexture(GL_TEXTURE_2D, diffuseTexture);
+  else
+    glBindTexture(GL_TEXTURE_2D, 0);
+  
+}
+
 
 /**
@@ -100,8 +237,9 @@
 void Material::setName (char* mtlName)
 {
-  //  if (verbose >= 3)
-    printf("setting Material Name to %s.\n", mtlName);
-  name = new char [strlen(mtlName)];
+  name = new char [strlen(mtlName)+1];
   strcpy(name, mtlName);
+  if (verbose >= 3)
+    printf("setting Material Name to %s.\n", name);
+
   //  printf ("adding new Material: %s, %p\n", this->getName(), this);
 
@@ -122,5 +260,5 @@
 {
   if (verbose >= 3)
-    printf("setting illumModel of Material %s to %i", name, illum);
+    printf("setting illumModel of Material %s to %i\n", name, illum);
   illumModel = illum;
   //  printf ("setting illumModel to: %i\n", illumModel);
@@ -156,7 +294,7 @@
 void Material::setDiffuse (char* rgb)
 {
-  char r[20],g[20],b[20];
-  sscanf (rgb, "%s %s %s", r, g, b);
-  setDiffuse (atof(r), atof(g), atof(b));
+  float r,g,b;
+  sscanf (rgb, "%f %f %f", &r, &g, &b);
+  setDiffuse (r, g, b);
 }
 
@@ -182,7 +320,7 @@
 void Material::setAmbient (char* rgb)
 {
-  char r[20],g[20],b[20];
-  sscanf (rgb, "%s %s %s", r, g, b);
-  setAmbient (atof(r), atof(g), atof(b));
+  float r,g,b;
+  sscanf (rgb, "%f %f %f", &r, &g, &b);
+  setAmbient (r, g, b);
 }
 
@@ -208,7 +346,7 @@
 void Material::setSpecular (char* rgb)
 {
-  char r[20],g[20],b[20];
-  sscanf (rgb, "%s %s %s", r, g, b);
-  setSpecular (atof(r), atof(g), atof(b));
+  float r,g,b;
+  sscanf (rgb, "%f %f %f", &r, &g, &b);
+  setSpecular (r, g, b);
 }
 
@@ -246,8 +384,50 @@
 void Material::setTransparency (char* trans)
 {
-  char tr[20];
-  sscanf (trans, "%s", tr);
-  setTransparency (atof(tr));
-}
+  setTransparency (atof(trans));
+}
+
+/**
+   \brief Adds a Texture Path to the List of already existing Paths
+   \param pathName The Path to add.
+*/
+void Material::addTexturePath(char* pathName)
+{
+  pathList->addPath (pathName);
+}
+
+/**
+   \brief Searches for a Texture inside one of the defined Paths
+   \param texName The name of the texture o search for.
+   \returns pathName+texName if texName was found in the pathList. NULL if the Texture is not found.
+*/
+char* Material::searchTextureInPaths(char* texName) const
+{
+  char* tmpName = NULL;
+  PathList* pList = pathList;
+  while (pList)
+    {
+      if (pList->pathName)
+	{
+	  tmpName = new char [strlen(pList->pathName)+strlen(texName)+1];
+	  strcpy(tmpName, pList->pathName);
+	}
+      else
+	{
+	  tmpName = new char [strlen(texName)+1];
+	  tmpName[0]='\0';
+	}
+      strcat(tmpName, texName);
+      printf("%s\n", tmpName);
+      if (access (tmpName, F_OK) == 0)
+	return tmpName;
+      
+      if (tmpName)
+	delete []tmpName;
+      tmpName = NULL;
+      pList = pList->next;
+    }
+  return NULL;
+}
+
 
 // MAPPING //
@@ -262,5 +442,6 @@
     printf ("setting Diffuse Map %s\n", dMap);
 
-  diffuseTextureSet = loadBMP(dMap, &diffuseTexture);
+  //  diffuseTextureSet = loadBMP(dMap, &diffuseTexture);
+  diffuseTextureSet = loadImage(dMap, &diffuseTexture);
 
 }
@@ -293,4 +474,108 @@
 {
 
+}
+
+bool Material::loadTexToGL (Image* pImage, GLuint* texture)
+{
+  if (verbose >=3)
+    printf ("Loading texture to OpenGL-Environment.\n");
+  glGenTextures(1, texture);
+  glBindTexture(GL_TEXTURE_2D, *texture);
+  /* not Working, and not needed. 
+  glTexImage2D( GL_TEXTURE_2D, 0, 3, width,
+		height, 0, GL_BGR,
+		GL_UNSIGNED_BYTE, map->pixels );
+  */ 
+  gluBuild2DMipmaps(GL_TEXTURE_2D, 3, pImage->width, pImage->height, GL_RGB, GL_UNSIGNED_BYTE, pImage->data);
+  
+  glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);
+  glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR_MIPMAP_LINEAR);	
+}
+
+
+#ifdef HAVE_SDL_SDL_IMAGE_H
+bool Material::loadImage(char* imageName, GLuint* texture)
+{
+  char* imgNameWithPath = searchTextureInPaths(imageName);
+  if (imgNameWithPath)
+    {
+      SDL_Surface* map;
+      Image* pImage = new Image;
+      map=IMG_Load(imgNameWithPath);
+      if(!map)
+	{
+	  printf("IMG_Load: %s\n", IMG_GetError());
+	  return false;
+	}
+      pImage->height = map->h;
+      pImage->width  = map->w;
+      pImage->data   = (GLubyte*)map->pixels;
+      if( !IMG_isPNG(SDL_RWFromFile(imgNameWithPath, "rb")) && !IMG_isJPG(SDL_RWFromFile(imgNameWithPath, "rb")))
+	for (int i=0;i<map->h * map->w *3;i+=3)
+	  { 
+	    GLuint temp = pImage->data[i];
+	    pImage->data[i] = pImage->data[i+2];
+	    pImage->data[i+2] = temp;
+	  }
+      loadTexToGL (pImage, texture);
+    }
+  else
+    {
+      if (verbose >=1)
+	printf ("Image not Found: %s\n", imgNameWithPath);
+      return false;
+    }
+}
+
+
+#else /* HAVE_SDL_SDL_IMAGE_H */
+/**
+   \brief Makes the Programm ready to Read-in a texture-File
+   1. Checks what type of Image should be imported
+   2. ToDO: Checks where to find the Image
+*/
+bool Material::loadImage(char* imageName, GLuint* texture)
+{
+  char* imgNameWithPath = searchTextureInPaths(imageName);
+  if (imgNameWithPath)
+    {
+      if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".bmp", 4))
+	{
+	  if (verbose >=2)
+	    printf ("Requested bmp-image. Trying to Import.\n");
+	  return loadBMP(imgNameWithPath, texture);
+	}
+      
+      else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".jpg", 4) || !strncmp(imgNameWithPath+strlen(imgNameWithPath)-5, ".jpg", 5))
+	{
+	  if (verbose >=2)
+	    printf ("Requested jpeg-image. Trying to Import\n");
+	  return loadJPG(imgNameWithPath, texture);
+	}
+      else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".tga", 4))
+	{
+	  if (verbose >=2)
+	    printf ("Requested tga-image. Trying to Import\n");
+	  return loadTGA(imgNameWithPath, texture);
+	}
+      else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".png", 4))
+	{
+	  if (verbose >=2)
+	    printf ("Requested png-image. Trying to Import\n");
+	  return loadPNG(imgNameWithPath, texture);
+	}
+      else
+	{
+	  if (verbose >=1)
+	    printf ("Requested Image was not recognized in its type. (Maybe a type-Cast-error.)\n FileName: %s", imgNameWithPath);
+	  return false;
+	}
+    }
+  else
+    {
+      if (verbose >=1)
+	printf ("Image not Found: %s\n", imgNameWithPath);
+      return false;
+    }
 }
 
@@ -302,85 +587,668 @@
 bool Material::loadBMP (char* bmpName, GLuint* texture)
 {
-  SDL_Surface* map;
-  if (map = SDL_LoadBMP(bmpName))
-    {
-
-      glGenTextures( 1, texture );
-      /* Typical Texture Generation Using Data From The Bitmap */
-      glBindTexture( GL_TEXTURE_2D, *texture );
+  Image* pImage = new Image;
+  FILE *file;
+  unsigned long size;                 // size of the image in bytes.
+  unsigned long i;                    // standard counter.
+  unsigned short int planes;          // number of planes in image (must be 1) 
+  unsigned short int bpp;             // number of bits per pixel (must be 24)
+  GLuint temp;                          // temporary color storage for bgr-rgb conversion.
+
+  // make sure the file is there.
+  if ((file = fopen(bmpName, "rb"))==NULL)
+    {
+      if (verbose >=1)
+	printf("File Not Found : %s\n",bmpName);
+      return false;
+    }
+  // seek through the bmp header, up to the width/height:
+  fseek(file, 18, SEEK_CUR);
+  
+  // read the width
+  if ((i = fread(&pImage->width, 4, 1, file)) != 1) 
+    {
+      if (verbose >=1)
+	printf("Error reading width from %s.\n", bmpName);
+      return false;
+    }
+  // read the height 
+  if ((i = fread(&pImage->height, 4, 1, file)) != 1) 
+    {
+      if (verbose>=1)
+	printf("Error reading height from %s.\n", bmpName);
+      return false;
+    }
+  
+  // calculate the size (assuming 24 bits or 3 bytes per pixel).
+  size = pImage->width * pImage->height * 3;
+  
+  // read the planes
+  if ((fread(&planes, 2, 1, file)) != 1) 
+    {
+      if (verbose>=1)
+	printf("Error reading planes from %s.\n", bmpName);
+      return false;
+    }
+  if (planes != 1) 
+    {
+      if (verbose>=1)
+	printf("Planes from %s is not 1: %u\n", bmpName, planes);
+      return false;
+    }
+  
+  // read the bpp
+  if ((i = fread(&bpp, 2, 1, file)) != 1) 
+    {
+      if (verbose>=1)
+	printf("Error reading bpp from %s.\n", bmpName);
+      return false;
+    }
+  if (bpp != 24) 
+    {
+      if (verbose>=1)
+	printf("Bpp from %s is not 24: %u\n", bmpName, bpp);
+      return false;
+    }
+  
+  // seek past the rest of the bitmap header.
+  fseek(file, 24, SEEK_CUR);
+  
+  // read the data. 
+  pImage->data = (GLubyte *) malloc(size);
+  if (pImage->data == NULL) 
+    {
+      if (verbose>=1)
+	printf("Error allocating memory for color-corrected image data");
+      return false;	
+    }
+  
+  if ((i = fread(pImage->data, size, 1, file)) != 1) 
+    {
+      if (verbose>=1)
+	printf("Error reading image data from %s.\n", bmpName);
+      return false;
+    }
+  fclose(file);
+
+  // reverse all of the colors. (bgr -> rgb)
+  for (i=0;i<size;i+=3) 
+    { 
+      temp = pImage->data[i];
+      pImage->data[i] = pImage->data[i+2];
+      pImage->data[i+2] = temp;
+    }
+  loadTexToGL (pImage, texture);
+  
+  return true;
+
+  if (pImage)
+    {
+      if (pImage->data)
+	{
+	  free(pImage->data);
+	}
       
-      /* Generate The Texture */
-      glTexImage2D( GL_TEXTURE_2D, 0, 3, map->w,
-		    map->h, 0, GL_BGR,
-		    GL_UNSIGNED_BYTE, map->pixels );
+      free(pImage);
+    }
+
+}
+
+/**
+   \brief reads in a jpg-file
+   \param jpgName the Name of the Image to load
+   \param texture a reference to the Texture to write the image to
+*/
+bool Material::loadJPG (char* jpgName, GLuint* texture)
+{
+#ifdef HAVE_JPEGLIB_H
+  struct jpeg_decompress_struct cinfo;
+  Image *pImage = NULL;
+  FILE *pFile;
+  
+  // Open a file pointer to the jpeg file and check if it was found and opened 
+  if((pFile = fopen(jpgName, "rb")) == NULL) 
+    {
+      // Display an error message saying the file was not found, then return NULL
+      printf("Unable to load JPG File %s.\n", jpgName);
+      return false;
+    }
+  
+  // Create an error handler
+  jpeg_error_mgr jerr;
+  
+  // Have our compression info object point to the error handler address
+  cinfo.err = jpeg_std_error(&jerr);
+  
+  // Initialize the decompression object
+  jpeg_create_decompress(&cinfo);
+  
+  // Specify the data source (Our file pointer)	
+  jpeg_stdio_src(&cinfo, pFile);
+  
+  // Allocate the structure that will hold our eventual jpeg data (must free it!)
+  pImage = (Image*)malloc(sizeof(Image));
+  
+  // DECOFING
+  // Read in the header of the jpeg file
+  jpeg_read_header(&cinfo, TRUE);
+  
+  // Start to decompress the jpeg file with our compression info
+  jpeg_start_decompress(&cinfo);
+  
+  // Get the image dimensions and row span to read in the pixel data
+  pImage->rowSpan = cinfo.image_width * cinfo.num_components;
+  pImage->width   = cinfo.image_width;
+  pImage->height   = cinfo.image_height;
+  
+  // Allocate memory for the pixel buffer
+  pImage->data = new unsigned char[pImage->rowSpan * pImage->height];
+  
+  // Here we use the library's state variable cinfo.output_scanline as the
+  // loop counter, so that we don't have to keep track ourselves.
+  
+  // Create an array of row pointers
+  unsigned char** rowPtr = new unsigned char*[pImage->height];
+  for (int i = 0; i < pImage->height; i++)
+    rowPtr[i] = &(pImage->data[i*pImage->rowSpan]);
+  
+  // Now comes the juice of our work, here we extract all the pixel data
+  int rowsRead = 0;
+  while (cinfo.output_scanline < cinfo.output_height) 
+    {
+      // Read in the current row of pixels and increase the rowsRead count
+      rowsRead += jpeg_read_scanlines(&cinfo, &rowPtr[rowsRead], cinfo.output_height - rowsRead);
+    }
+  
+  // Delete the temporary row pointers
+  delete [] rowPtr;
+  
+  // Finish decompressing the data
+  jpeg_finish_decompress(&cinfo);//  decodeJPG(&cinfo, pImage);
+  
+  // This releases all the stored memory for reading and decoding the jpeg
+  jpeg_destroy_decompress(&cinfo);
+  
+  // Close the file pointer that opened the file
+  fclose(pFile);
+  
+
+  if(pImage == NULL)
+    exit(0);
+  
+  loadTexToGL (pImage, texture);
+  if (pImage)
+    {
+      if (pImage->data)
+	{
+	  free(pImage->data);
+	}
       
-      /* Linear Filtering */
-      glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
-      glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
-      if ( map )
-	SDL_FreeSurface( map );
-
-      return true;
+      free(pImage);
+    }
+  return true;
+#else /* HAVE_JPEGLIB_H */
+  if (verbose >=1)
+    printf ("sorry, but you did not compile with jpeg-support.\nEither install SDL_image or jpeglib, and recompile to see the image\n");
+  return false;
+#endif /* HAVE_JPEGLIB_H */
+
+}
+
+/**
+   \brief reads in a tga-file
+   \param tgaName the Name of the Image to load
+   \param texture a reference to the Texture to write the image to
+*/
+bool Material::loadTGA(const char * tgaName, GLuint* texture)
+{
+  typedef struct
+  {
+    GLubyte Header[12];
+  } TGAHeader;
+  TGAHeader tgaHeader;			
+  
+  GLubyte uTGAcompare[12] = {0,0,2, 0,0,0,0,0,0,0,0,0};	// Uncompressed TGA Header 
+  GLubyte cTGAcompare[12] = {0,0,10,0,0,0,0,0,0,0,0,0};	// Compressed TGA Header 
+  FILE * fTGA;
+  fTGA = fopen(tgaName, "rb");
+
+  if(fTGA == NULL)
+    {
+      printf("Error could not open texture file: %s\n", tgaName);
+      return false;
+    }
+  
+  if(fread(&tgaHeader, sizeof(TGAHeader), 1, fTGA) == 0)
+    {
+      printf("Error could not read file header of %s\n", tgaName);
+      if(fTGA != NULL)
+	{
+	  fclose(fTGA);
+	}
+      return false;
+    }
+  
+  if(memcmp(uTGAcompare, &tgaHeader, sizeof(TGAHeader)) == 0)
+    {
+      loadUncompressedTGA(tgaName, fTGA, texture);
+      if (fTGA)
+	fclose (fTGA);
+    }
+  else if(memcmp(cTGAcompare, &tgaHeader, sizeof(TGAHeader)) == 0)
+    {
+      loadCompressedTGA(tgaName, fTGA, texture);
+	if (fTGA)
+	  fclose (fTGA);
     }
   else
-    return false;
-}
-
-
-
-
-/**
-   \brief Search for a Material called mtlName
-   \param mtlName the Name of the Material to search for
-   \returns Material named mtlName if it is found. NULL otherwise.
-*/
-Material* Material::search (char* mtlName)
-{
-  if (verbose >=3)
-    printf ("Searching for material %s", mtlName);
-  Material* searcher = this;
-  while (searcher != NULL)
-    {
-      if (verbose >= 3)
-	printf (".");
-      if (!strcmp (searcher->getName(), mtlName))
-	{
-	  if (verbose >= 3)
-	    printf ("found.\n");
-	  return searcher;
-	}
-      searcher = searcher->nextMat;
-    }
-  if (verbose >=3)
-    printf ("not found\n");
-  return NULL;
-}
-
-/**
-   \brief sets the material with which the following Faces will be painted
-*/
-bool Material::select (void)
-{
-  // setting diffuse color
-  //  glColor3f (diffuse[0], diffuse[1], diffuse[2]);
-  glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuse);
-
-  // setting ambient color
-  glMaterialfv(GL_FRONT, GL_AMBIENT, ambient);
-
-  // setting up Sprecular
-  glMaterialfv(GL_FRONT, GL_SPECULAR, specular);
-
-  // setting up Shininess
-  glMaterialf(GL_FRONT, GL_SHININESS, shininess);
-  
-  // setting illumination Model 
-  if (illumModel == 1)
-    glShadeModel(GL_FLAT);
-  else if (illumModel >= 2)
-    glShadeModel(GL_SMOOTH);
-
-  if (diffuseTextureSet)
-    glBindTexture(GL_TEXTURE_2D, diffuseTexture);
-  
-}
+    {
+      printf("Error TGA file be type 2 or type 10\n");
+      if (fTGA)
+	fclose(fTGA);
+      return false;
+    }
+  return true;
+}
+
+/**
+   \brief reads in an uncompressed tga-file
+   \param filename the Name of the Image to load
+   \param fTGA a Pointer to a File, that should be read
+   \param texture a reference to the Texture to write the image to
+*/
+bool Material::loadUncompressedTGA(const char * filename, FILE * fTGA, GLuint* texture)
+{
+  GLubyte header[6];      // First 6 Useful Bytes From The Header 
+  GLuint  bytesPerPixel;  // Holds Number Of Bytes Per Pixel Used In The TGA File 
+  GLuint  imageSize;	  // Used To Store The Image Size When Setting Aside Ram 
+  GLuint  temp;		  // Temporary Variable
+  GLuint  type;
+  GLuint  Height;	  // Height of Image 
+  GLuint  Width;	  // Width of Image 
+  GLuint  Bpp;		  // Bits Per Pixel 
+
+  Image* pImage = new Image;
+  GLuint cswap;
+  if(fread(header, sizeof(header), 1, fTGA) == 0)
+    {
+      printf("Error could not read info header\n");
+      return false;
+    }
+  
+  Width = pImage->width  = header[1] * 256 + header[0];
+  Height =  pImage->height = header[3] * 256 + header[2];
+  Bpp = pImage->bpp = header[4];
+  // Make sure all information is valid
+  if((pImage->width <= 0) || (pImage->height <= 0) || ((pImage->bpp != 24) && (pImage->bpp !=32)))
+    {
+      printf("Error invalid texture information\n");
+      return false;
+    }
+  
+  if(pImage->bpp == 24)	
+    {
+      pImage->type = GL_RGB;
+    }
+  else
+    {
+      pImage->type = GL_RGBA;
+    }
+  
+  bytesPerPixel	= (Bpp / 8);
+  imageSize = (bytesPerPixel * Width * Height);
+  pImage->data = (GLubyte*) malloc(imageSize);
+  
+  if(pImage->data == NULL)
+    {
+      printf("Error could not allocate memory for image\n");
+      return false;
+    }
+  
+  if(fread(pImage->data, 1, imageSize, fTGA) != imageSize)
+    {
+      printf("Error could not read image data\n");
+      if(pImage->data != NULL)
+	{
+	  free(pImage->data);
+	}
+      return false;
+    }
+  
+  for(cswap = 0; cswap < (int)imageSize; cswap += bytesPerPixel)
+    {
+      pImage->data[cswap] ^= pImage->data[cswap+2] ^=
+	pImage->data[cswap] ^= pImage->data[cswap+2];
+    }
+  
+  loadTexToGL (pImage, texture);
+
+  return true;
+}
+
+/**
+   \brief reads in a compressed tga-file
+   \param filename the Name of the Image to load
+   \param fTGA a Pointer to a File, that should be read
+   \param texture a reference to the Texture to write the image to
+*/
+bool Material::loadCompressedTGA(const char * filename, FILE * fTGA, GLuint* texture)
+{
+  GLubyte header[6];      // First 6 Useful Bytes From The Header 
+  GLuint  bytesPerPixel;  // Holds Number Of Bytes Per Pixel Used In The TGA File 
+  GLuint  imageSize;	  // Used To Store The Image Size When Setting Aside Ram 
+  GLuint  temp;		  // Temporary Variable
+  GLuint  type;
+  GLuint  Height;	  // Height of Image 
+  GLuint  Width;	  // Width of Image 
+  GLuint  Bpp;		  // Bits Per Pixel 
+
+  Image* pImage = new Image;
+
+  
+  if(fread(header, sizeof(header), 1, fTGA) == 0)
+    {
+      printf("Error could not read info header\n");
+      return false;
+    }
+  
+  Width = pImage->width  = header[1] * 256 + header[0];
+  Height = pImage->height = header[3] * 256 + header[2];
+  Bpp = pImage->bpp	= header[4];
+
+  GLuint pixelcount	= Height * Width;
+  GLuint currentpixel	= 0;
+  GLuint currentbyte	= 0;
+  GLubyte * colorbuffer = (GLubyte *)malloc(bytesPerPixel);
+
+  //Make sure all pImage info is ok 
+  if((pImage->width <= 0) || (pImage->height <= 0) || ((pImage->bpp != 24) && (pImage->bpp !=32)))
+    {
+      printf("Error Invalid pImage information\n");
+      return false;
+    }
+  
+  bytesPerPixel	= (Bpp / 8);
+  imageSize		= (bytesPerPixel * Width * Height);
+  pImage->data	= (GLubyte*) malloc(imageSize);
+  
+  if(pImage->data == NULL)
+    {
+      printf("Error could not allocate memory for image\n");
+      return false;
+    }
+  
+  do
+    {
+      GLubyte chunkheader = 0;
+      
+      if(fread(&chunkheader, sizeof(GLubyte), 1, fTGA) == 0)
+	{
+	  printf("Error could not read RLE header\n");
+	  if(pImage->data != NULL)
+	    {
+	      free(pImage->data);
+	    }
+	  return false;
+	}
+      // If the ehader is < 128, it means the that is the number of RAW color packets minus 1 
+      if(chunkheader < 128)
+	{
+	  short counter;
+	  chunkheader++;
+	  // Read RAW color values
+	  for(counter = 0; counter < chunkheader; counter++)
+	    { 
+	      // Try to read 1 pixel 
+	      if(fread(colorbuffer, 1, bytesPerPixel, fTGA) != bytesPerPixel)
+		{
+		  printf("Error could not read image data\n");
+		  if(colorbuffer != NULL)
+		    {
+		      free(colorbuffer);
+		    }
+		  
+		  if(pImage->data != NULL)
+		    {
+		      free(pImage->data);
+		    }
+		  
+		  return false;	
+		}
+	      // write to memory 
+	      // Flip R and B vcolor values around in the process 
+	      pImage->data[currentbyte	  ] = colorbuffer[2];				    
+	      pImage->data[currentbyte + 1] = colorbuffer[1];
+	      pImage->data[currentbyte + 2] = colorbuffer[0];
+	      
+	      if(bytesPerPixel == 4) // if its a 32 bpp image 
+		{
+		  pImage->data[currentbyte + 3] = colorbuffer[3];// copy the 4th byte 
+		}
+	      
+	      currentbyte += bytesPerPixel;
+	      currentpixel++;
+
+	      // Make sure we haven't read too many pixels 
+	      if(currentpixel > pixelcount)	
+		{
+		  printf("Error too many pixels read\n");
+		  if(colorbuffer != NULL)
+		    {
+		      free(colorbuffer);
+		    }
+		  
+		  if(pImage->data != NULL)
+		    {
+		      free(pImage->data);
+		    }
+		  
+		  return false;
+		}
+	    }
+	}
+      // chunkheader > 128 RLE data, next color  reapeated chunkheader - 127 times
+      else
+	{
+	  short counter;
+	  chunkheader -= 127;	// Subteact 127 to get rid of the ID bit 
+	  if(fread(colorbuffer, 1, bytesPerPixel, fTGA) != bytesPerPixel) // Attempt to read following color values 
+	    {
+	      printf("Error could not read from file");
+	      if(colorbuffer != NULL)
+		{
+		  free(colorbuffer);
+		}
+	      
+	      if(pImage->data != NULL)
+		{
+		  free(pImage->data);
+		}
+	      
+	      return false;
+	    }
+	  
+	  for(counter = 0; counter < chunkheader; counter++) //copy the color into the image data as many times as dictated
+	    {							
+	      // switch R and B bytes areound while copying
+	      pImage->data[currentbyte	  ] = colorbuffer[2];
+	      pImage->data[currentbyte + 1] = colorbuffer[1];
+	      pImage->data[currentbyte + 2] = colorbuffer[0];
+	      
+	      if(bytesPerPixel == 4)
+		{
+		  pImage->data[currentbyte + 3] = colorbuffer[3];
+		}
+	      
+	      currentbyte += bytesPerPixel;
+	      currentpixel++;
+	      
+	      if(currentpixel > pixelcount)
+		{
+		  printf("Error too many pixels read\n");
+		  if(colorbuffer != NULL)
+		    {
+		      free(colorbuffer);
+		    }
+		  
+		  if(pImage->data != NULL)
+		    {
+		      free(pImage->data);
+		    }
+		  
+		  return false;
+		}
+	    }
+	}
+    }
+  
+  while(currentpixel < pixelcount);	// Loop while there are still pixels left
+
+  loadTexToGL (pImage, texture);
+
+  return true;
+}
+
+
+/*
+static int ST_is_power_of_two(unsigned int number)
+{
+  return (number & (number - 1)) == 0;
+}
+*/
+
+/**
+   \brief reads in a png-file
+   \param pngName the Name of the Image to load
+   \param texture a reference to the Texture to write the image to
+*/
+bool Material::loadPNG(const char* pngName, GLuint* texture)
+{
+#ifdef HAVE_PNG_H
+  Image* pImage = new Image;
+
+  FILE *PNG_file = fopen(pngName, "rb");
+  if (PNG_file == NULL)
+    {
+      return 0;
+    }
+  
+  GLubyte PNG_header[8];
+  
+  fread(PNG_header, 1, 8, PNG_file);
+  if (png_sig_cmp(PNG_header, 0, 8) != 0)
+    {
+      if (verbose >=2)
+	printf ("Not Recognized as a pngFile\n");
+      fclose (PNG_file);
+      return 0;
+    }
+  
+  png_structp PNG_reader = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+  if (PNG_reader == NULL)
+    {
+      fclose(PNG_file);
+      return 0;
+    }
+  
+  png_infop PNG_info = png_create_info_struct(PNG_reader);
+  if (PNG_info == NULL)
+    {
+      png_destroy_read_struct(&PNG_reader, NULL, NULL);
+      fclose(PNG_file);
+      return 0;
+    }
+  
+  png_infop PNG_end_info = png_create_info_struct(PNG_reader);
+  if (PNG_end_info == NULL)
+    {
+      png_destroy_read_struct(&PNG_reader, &PNG_info, NULL);
+      fclose(PNG_file);
+      return 0;
+    }
+  
+  if (setjmp(png_jmpbuf(PNG_reader)))
+    {
+      png_destroy_read_struct(&PNG_reader, &PNG_info, &PNG_end_info);
+      fclose(PNG_file);
+      return (0);
+    }
+  
+  png_init_io(PNG_reader, PNG_file);
+  png_set_sig_bytes(PNG_reader, 8);
+  
+  png_read_info(PNG_reader, PNG_info);
+  
+  pImage->width = png_get_image_width(PNG_reader, PNG_info);
+  pImage->height = png_get_image_height(PNG_reader, PNG_info);
+  
+  png_uint_32 bit_depth, color_type;
+  bit_depth = png_get_bit_depth(PNG_reader, PNG_info);
+  color_type = png_get_color_type(PNG_reader, PNG_info);
+  
+  if (color_type == PNG_COLOR_TYPE_PALETTE)
+    {
+      png_set_palette_to_rgb(PNG_reader);
+    }
+  
+  if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
+    {
+      png_set_gray_1_2_4_to_8(PNG_reader);
+    }
+  
+  if (color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
+    {
+      png_set_gray_to_rgb(PNG_reader);
+    }
+  
+  if (png_get_valid(PNG_reader, PNG_info, PNG_INFO_tRNS))
+    {
+      png_set_tRNS_to_alpha(PNG_reader);
+    }
+  else
+    {
+      png_set_filler(PNG_reader, 0xff, PNG_FILLER_AFTER);
+    }
+  
+  if (bit_depth == 16)
+    {
+      png_set_strip_16(PNG_reader);
+    }
+  
+  png_read_update_info(PNG_reader, PNG_info);
+  
+  pImage->data = (png_byte*)malloc(4 * pImage->width * pImage->height);
+  png_byte** PNG_rows = (png_byte**)malloc(pImage->height * sizeof(png_byte*));
+  
+  unsigned int row;
+  for (row = 0; row < pImage->height; ++row)
+    {
+      PNG_rows[pImage->height - 1 - row] = pImage->data + (row * 4 * pImage->width);
+    }
+  
+  png_read_image(PNG_reader, PNG_rows);
+  
+  free(PNG_rows);
+  
+  png_destroy_read_struct(&PNG_reader, &PNG_info, &PNG_end_info);
+  fclose(PNG_file);
+  
+  /*  if (!ST_is_power_of_two(pImage->width) || !ST_is_power_of_two(pImage->height))
+    {
+      free(pImage->data);
+      return 0;
+    }
+  */
+  loadTexToGL (pImage, texture);  
+  
+  free(pImage->data);
+  
+  return true;
+#else /* HAVE_PNG_H */
+  if (verbose >=1)
+    printf ("sorry, but you did not compile with png-support.\nEither install SDL_image or libpng, and recompile to see the image\n");
+  return false;
+#endif /* HAVE_PNG_H */
+
+}
+
+#endif /* HAVE_SDL_SDL_IMAGE_H */
Index: orxonox/trunk/importer/material.h
===================================================================
--- orxonox/trunk/importer/material.h	(revision 3099)
+++ orxonox/trunk/importer/material.h	(revision 3140)
@@ -12,6 +12,35 @@
 #include <GL/glu.h>
 #include <SDL/SDL.h>
-#include <stdlib.h>
-#include <fstream>
+
+#if HAVE_CONFIG_H 
+#include <config.h> 
+#endif /* HAVE_CONFIG_H */
+
+#ifdef HAVE_SDL_SDL_IMAGE_H
+#include <SDL/SDL_image.h>
+#else
+// IMAGE LIBS //
+#ifdef HAVE_JPEGLIB_H
+extern "C"{         // This has to be done, because not a c++ lib
+#include <jpeglib.h>
+}
+#endif /* HAVE_JPEGLIB_H */
+#ifdef HAVE_PNG_H
+#include <png.h>
+#endif /* HAVE_PNG_H */
+#endif /* HAVE_SDL_SDL_IMAGE_H */
+
+class PathList
+{
+ public:
+  PathList();
+  PathList(char* pName);
+
+  ~PathList();
+  void addPath (char* pName);
+  char* pathName;
+  PathList* next;
+};
+
 
 //! Class to handle Materials.
@@ -22,15 +51,9 @@
   Material (char* mtlName);
   Material* addMaterial(char* mtlName);
+  ~Material ();
+  void init(void);
 
-  void init(void);
-  ~Material ();
-
-  GLuint diffuseTexture;
-  GLuint ambientTexture;
-  GLuint specularTexture;
-  
-  bool diffuseTextureSet;
-  bool ambientTextureSet;
-  bool specularTextureSet;
+  Material* search (char* mtlName);
+  bool select (void);
 
   void setName (char* mtlName);
@@ -49,5 +72,9 @@
   void setTransparency (char* trans);
 
-  // MAPPING //
+
+ 
+  void addTexturePath(char* pathName);
+  char* searchTextureInPaths(char* texName) const;
+ // MAPPING //
   void setDiffuseMap(char* dMap);
   void setAmbientMap(char* aMap);
@@ -55,14 +82,16 @@
   void setBump(char* bump);
 
-  bool loadBMP (char* bmpName, GLuint* texture);
+ private:
+  struct Image
+  {
+    int rowSpan;
+    GLuint width;
+    GLuint height;
+    GLuint bpp;
+    GLuint type;
+    GLubyte *data;
+  };
 
 
-  Material* search (char* mtlName);
-
-  bool select (void);
-
-  Material* nextMat; //!< pointer to the Next Material of the List. NULL if no next exists.
-
- private:
   char* name;
   int illumModel;
@@ -73,4 +102,34 @@
   float transparency;
 
+  static PathList* pathList;
+  
+  GLuint diffuseTexture;
+  GLuint ambientTexture;
+  GLuint specularTexture;
+  
+  bool diffuseTextureSet;
+  bool ambientTextureSet;
+  bool specularTextureSet;
+
+  Material* nextMat; //!< pointer to the Next Material of the List. NULL if no next exists.
+
+  // TEXTURING
+  bool loadTexToGL (Image* pImage, GLuint* texture);
+
+  bool loadImage(char* imageName, GLuint* texture);
+#ifndef HAVE_SDL_SDL_IMAGE_H
+
+  bool loadBMP (char* bmpName, GLuint* texture);
+
+  bool loadJPG (char* jpgName, GLuint* texture);
+
+  /// TGA ///
+
+  bool loadTGA(const char * tgaName, GLuint* texture);
+  bool loadUncompressedTGA(const char * filename, FILE * fTGA, GLuint* texture);
+  bool loadCompressedTGA(const char * filename, FILE * fTGA, GLuint* texture);
+
+  bool loadPNG(const char* pngName, GLuint* texture);
+#endif
 };
 #endif
Index: orxonox/trunk/importer/object.cc
===================================================================
--- orxonox/trunk/importer/object.cc	(revision 3099)
+++ orxonox/trunk/importer/object.cc	(revision 3140)
@@ -15,4 +15,5 @@
 
 #include "object.h"
+using namespace std;
 
 /**
@@ -78,5 +79,17 @@
       walker = walker->next;
       delete delWalker;
-    } 
+    }
+
+  if (objPath)
+    delete []objPath;
+  if (objFileName)
+    delete []objFileName;
+  if (mtlFileName)
+    delete []mtlFileName;
+
+  if (verbose >=2)
+    printf("Deleting Materials.\n");
+  if (material)
+    delete material;
 }
 
@@ -184,5 +197,7 @@
   
   initGroup (firstGroup);
-  mtlFileName = "";
+  objPath = NULL;
+  objFileName = NULL;
+  mtlFileName = NULL;
   scaleFactor = 1;
   material = new Material();
@@ -244,7 +259,4 @@
     delete normals;
 
-  if (material != NULL)
-    delete material;
-
   cleanupGroup(firstGroup);
   return true; 
@@ -316,7 +328,38 @@
 {
   if (verbose >=3)
-    printf("preparing to read in file: %s\n", fileName);   
-  objFileName = fileName;
-  this->readFromObjFile (fileName);
+    printf("preparing to read in file: %s\n", fileName);
+
+
+#ifdef __WIN32__
+  // win32 path reading
+  char pathSplitter= '\\';
+#else /* __WIN32__ */
+  // unix path reading
+  char pathSplitter='/';
+#endif /* __WIN32__ */
+  char* tmpName = fileName;
+  if (tmpName[0] == pathSplitter)
+    tmpName++;
+  char* name = tmpName;
+  while (( tmpName = strchr (tmpName+1, pathSplitter)))
+    {
+      name = tmpName+1;
+    }
+  objPath = new char[name-fileName];
+  strncpy(objPath, fileName, name-fileName);
+  objPath[name-fileName] = '\0';
+  if (verbose >=2)
+    if (strlen(objPath)> 0)
+      {
+	printf("Resolved file %s to folder: %s.\n", name, objPath);
+      }
+    else
+      printf("Resolved file %s.\n", name);
+  
+  if (material)
+    material->addTexturePath(objPath);
+  objFileName = new char[strlen(name)+1];
+  strcpy (objFileName, name);
+  this->readFromObjFile ();
   return true;
 }
@@ -325,17 +368,24 @@
    \brief Reads in the .obj File and sets all the Values.
    This function does read the file, parses it for the occurence of things like vertices, faces and so on, and executes the specific tasks
-   \param fileName the File that will be parsed (.obj-file)
-*/
-bool Object::readFromObjFile (char* fileName)
-{
-  OBJ_FILE = new ifstream(fileName);
-  if (!OBJ_FILE->is_open())
+*/
+bool Object::readFromObjFile (void)
+{
+  char* fileName = new char [strlen(objPath)+strlen(objFileName)+1];
+  if (objFileName != NULL && !strcmp(objFileName, ""))
+    return false;
+  strcpy(fileName, objPath);
+  strcat(fileName, objFileName);
+
+  ifstream* OBJ_FILE = new ifstream(fileName);
+  if (OBJ_FILE->fail())
     {
       if (verbose >=1)
 	printf ("unable to open .OBJ file: %s\n Loading Box Object instead.\n", fileName);
       BoxObject();
+      delete []fileName;
       return false;
     }
-  objFileName = fileName;
+  if (verbose >=2)
+    printf ("Reading from opened file %s\n", fileName);
   char Buffer[10000];
   while(!OBJ_FILE->eof())
@@ -391,4 +441,5 @@
     }
   OBJ_FILE->close();
+  delete []fileName;
   return true;
 
@@ -403,10 +454,6 @@
 bool Object::readGroup (char* groupString)
 {
-  // setting the group name if not default.
-  if (strcmp(currentGroup->name, "default"))
-    {
-      currentGroup->name = new char [strlen(groupString)];
-      strcpy(currentGroup->name, groupString);
-    }
+  if (verbose >=3)
+    printf ("Read Group: %s.\n", groupString);
   if (groupCount != 0 && currentGroup->faceCount>0)
     {
@@ -415,5 +462,10 @@
       initGroup(currentGroup);
     }
-
+  // setting the group name if not default.
+  if (strcmp(groupString, "default"))
+    {
+      currentGroup->name = new char [strlen(groupString)+1];
+      strcpy(currentGroup->name, groupString);
+    }
   ++groupCount;
 
@@ -541,14 +593,22 @@
 bool Object::readMtlLib (char* mtlFile)
 {
-  MTL_FILE = new ifstream (mtlFile);
-  if (!MTL_FILE->is_open())
+  mtlFileName = new char [strlen(mtlFile)+1];
+  strcpy(mtlFileName, mtlFile);
+  char* fileName = new char [strlen(objPath) + strlen(mtlFileName)+1];
+  strcpy(fileName, objPath);
+  strcat(fileName, mtlFileName);
+  
+
+  if (verbose >=2)
+    printf ("Opening mtlFile: %s\n", fileName);
+
+  ifstream* MTL_FILE = new ifstream (fileName);
+  if (MTL_FILE->fail())
     {
       if (verbose >= 1)
-	printf ("unable to open file: %s\n", mtlFile);
+	printf ("unable to open file: %s\n", fileName);
+      delete []fileName;
       return false;
     }
-  mtlFileName = mtlFile;
-  if (verbose >=2)
-    printf ("Opening mtlFile: %s\n", mtlFileName);
   char Buffer[500];
   Material* tmpMat = material;
@@ -621,4 +681,5 @@
 
     }
+  delete []fileName;
   return true;
 }
@@ -630,5 +691,5 @@
 bool Object::readUseMtl (char* matString)
 {
-  if (!strcmp (mtlFileName, ""))
+  if (!mtlFileName)
     {
       if (verbose >= 1)
@@ -641,5 +702,5 @@
   initFace (currentGroup->currentFace);
   
-  currentGroup->currentFace->materialString = new char[strlen(matString)];
+  currentGroup->currentFace->materialString = new char[strlen(matString)+1];
   strcpy (currentGroup->currentFace->materialString, matString);
   
Index: orxonox/trunk/importer/object.h
===================================================================
--- orxonox/trunk/importer/object.h	(revision 3099)
+++ orxonox/trunk/importer/object.h	(revision 3140)
@@ -87,6 +87,4 @@
   char* objFileName;
   char* mtlFileName;
-  ifstream* OBJ_FILE;
-  ifstream* MTL_FILE;
 
   bool initialize (void);
@@ -100,5 +98,5 @@
   ///// readin ///
   bool importFile (char* fileName);
-  bool readFromObjFile (char* fileName);
+  bool readFromObjFile (void);
   
   bool readGroup (char* groupString);
Index: orxonox/trunk/importer/windowHandler.cc
===================================================================
--- orxonox/trunk/importer/windowHandler.cc	(revision 3099)
+++ orxonox/trunk/importer/windowHandler.cc	(revision 3140)
@@ -1,3 +1,16 @@
+/* 
+   orxonox - the future of 3D-vertical-scrollers
 
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+*/
 
 #include "windowHandler.h"
