Index: orxonox/trunk/src/lib/graphics/importer/texture.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/texture.cc	(revision 3658)
+++ orxonox/trunk/src/lib/graphics/importer/texture.cc	(revision 3660)
@@ -23,99 +23,4 @@
 
 #include "graphics_engine.h"
-
-// headers only for PathList
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdlib.h>
-#include <fstream>
-
-/**
-   \brief creates a ned PathList.
-   
-   It is a good idea to use this as an initial List,
-   because if you give on a name the Path will not be checked for its existence.
-*/
-PathList::PathList()
-{
-  this->pathName = NULL;
-  this->next = NULL;
-}
-
-/**
-   \brief Creates a new PathList with a Name.
-   \param pName the Name of The Path.
-
-   This function just adds the Path without checking if it exists.
-*/
-PathList::PathList(char* pName)
-{
-  this->pathName = new char [strlen(pName)+1];
-  strcpy (this->pathName, pName);
-  this->next = NULL;
-}
-
-/**
-   \brief destroys a PathList
-
-   It does this by deleting the Name and then delete its preceding PathList.
-*/
-PathList::~PathList()
-{
-  if (this->pathName)
-    delete []this->pathName;
-  if (this->next)
-    delete this->next;
-}
-
-PathList* PathList::firstPath = NULL;
-
-/**
-   \returns A Pointer to the first Path of the Pathlist
-*/
-PathList* PathList::getInstance(void)
-{
-  if (firstPath)
-    return firstPath;
-  firstPath = new PathList();
-}
-/**
-   \brief Adds a new Pathlist Element.
-   \param pName
-   
-   Adding a Path automatically checks if the Path exists,
-   and if it does not it will not add it to the List.
-*/
-void PathList::addPath (char* pName)
-{
-  if (pName[0] == '\0')
-    {
-      PRINTF(2)("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';
-  if (access (tmpPName, F_OK) == 0)
-    {
-      struct stat status;
-      stat(tmpPName, &status);
-      if (status.st_mode & S_IFDIR)
-	{
-	  PRINTF(4)("Adding Path %s to the PathList.\n", pName);
-	  PathList* tmpPathList = this;
-	  while (tmpPathList->next)
-	    tmpPathList = tmpPathList->next;
-	  tmpPathList->next = new PathList(pName);
-	}
-      else
-	PRINTF(2)("You tried to add non-folder %s to a PathList.\n", tmpPName);
-    }
-  else
-      PRINTF(2)("You tried to add non-existing folder %s to a PathList.\n", tmpPName);
-  delete []tmpPName;
-}
-
-
 
 /**
@@ -154,37 +59,4 @@
   if (this->texture)
     glDeleteTextures(1, &this->texture);
-}
-
-/**
-   \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* Texture::searchTextureInPaths(const char* texName) const
-{
-  char* tmpName = NULL;
-  PathList* pList = PathList::getInstance();
-  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);
-      if (access (tmpName, F_OK) == 0)
-	return tmpName;
-      
-      if (tmpName)
-	delete []tmpName;
-      tmpName = NULL;
-      pList = pList->next;
-    }
-  return NULL;
 }
 
@@ -231,8 +103,7 @@
   if (GraphicsEngine::texturesEnabled)
     {
-      char* imgNameWithPath = searchTextureInPaths(imageName);
-      if (imgNameWithPath)
-	{
-	  this->map=IMG_Load(imgNameWithPath);
+      if (imageName)
+	{
+	  this->map=IMG_Load(imageName);
 	  if(!map)
 	    {
@@ -249,5 +120,5 @@
 	    pImage->format = GL_RGBA;
 	  
-	  if( !IMG_isPNG(SDL_RWFromFile(imgNameWithPath, "rb")) && !IMG_isJPG(SDL_RWFromFile(imgNameWithPath, "rb")))
+	  if( !IMG_isPNG(SDL_RWFromFile(imageName, "rb")) && !IMG_isJPG(SDL_RWFromFile(imageName, "rb")))
 	    for (int i=0;i<map->h * map->w *3;i+=3)
 	      { 
@@ -268,5 +139,5 @@
       else
 	{
-	  PRINTF(2)("Image not Found: %s\n", imgNameWithPath);
+	  PRINTF(2)("Image not Found: %s\n", imageName);
 	  return false;
 	}
@@ -285,31 +156,30 @@
   if (GraphicsEngine::texturesEnabled)
     {
-      char* imgNameWithPath = searchTextureInPaths(imageName);
-      if (imgNameWithPath)
-	{
-	  if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".bmp", 4))
+      if (imageName)
+	{
+	  if (!strncmp(imageName+strlen(imageName)-4, ".bmp", 4))
 	    {
 	      PRINTF(4)("Requested bmp-image. Trying to Import.\n");
-	      return this->loadBMP(imgNameWithPath);
+	      return this->loadBMP(imageName);
 	    }
 	  
-	  else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".jpg", 4) || !strncmp(imgNameWithPath+strlen(imgNameWithPath)-5, ".jpg", 5))
+	  else if (!strncmp(imageName+strlen(imageName)-4, ".jpg", 4) || !strncmp(imageName+strlen(imageName)-5, ".jpg", 5))
 	    {
 	      PRINTF(4)("Requested jpeg-image. Trying to Import\n");
-	      return this->loadJPG(imgNameWithPath);
-	    }
-	  else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".tga", 4))
+	      return this->loadJPG(imageName);
+	    }
+	  else if (!strncmp(imageName+strlen(imageName)-4, ".tga", 4))
 	    {
 	      PRINTF(4)("Requested tga-image. Trying to Import\n");
-	      return this->loadTGA(imgNameWithPath);
-	    }
-	  else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".png", 4))
+	      return this->loadTGA(imageName);
+	    }
+	  else if (!strncmp(imageName+strlen(imageName)-4, ".png", 4))
 	    {
 	      PRINTF(4)("Requested png-image. Trying to Import\n");
-	      return this->loadPNG(imgNameWithPath);
+	      return this->loadPNG(imageName);
 	    }
 	  else
 	    {
-	      PRINTF(2)("Requested Image was not recognized in its type. (Maybe a type-Cast-error.)\n FileName: %s", imgNameWithPath);
+	      PRINTF(2)("Requested Image was not recognized in its type. (Maybe a type-Cast-error.)\n FileName: %s", imageName);
 	      return false;
 	    }
@@ -317,5 +187,5 @@
       else
 	{
-	  PRINTF(2)("Image not Found: %s\n", imgNameWithPath);
+	  PRINTF(2)("Image not Found: %s\n", imageName);
 	  return false;
 	}
Index: orxonox/trunk/src/lib/graphics/importer/texture.h
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/texture.h	(revision 3658)
+++ orxonox/trunk/src/lib/graphics/importer/texture.h	(revision 3660)
@@ -27,28 +27,4 @@
 #endif /* HAVE_PNG_H */
 #endif /* HAVE_SDL_SDL_IMAGE_H */
-
-
-
-//! Class to handle lists of paths.
-/**
-   \todo Ability to return Paths by itself.
-
-   It is simple to use, and good, for all PathList you want.
-   just create a new Pathlist, and add Paths.
-*/
-class PathList
-{
- private:
-  PathList();
-  static PathList* firstPath; //!< A static Pointer to the first PathList in the List.
- public:
-  PathList(char* pName);
-  ~PathList();
-  static PathList* getInstance(void);
-  
-  void addPath (char* pName);
-  char* pathName;              //!< The Name of the current Path.
-  PathList* next;              //!< Pointer to the next Pathlist.
-};
 
 //! A Class, that reads in Textures from different fileformats.
