Index: orxonox/trunk/src/lib/graphics/importer/material.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/material.cc	(revision 3669)
+++ orxonox/trunk/src/lib/graphics/importer/material.cc	(revision 3672)
@@ -62,5 +62,5 @@
     delete []this->name;
   if (this->diffuseTexture)
-    ResourceManager::unload(this->diffuseTexture);
+    ResourceManager::getInstance()->unload(this->diffuseTexture);
   if (this->nextMat)
     delete this->nextMat;
@@ -339,5 +339,5 @@
   //! \todo check if RESOURCE MANAGER is availiable
   //! \todo Textures from .mtl-file need special care.
-  this->diffuseTextureSet = this->diffuseTexture = (Texture*)ResourceManager::load(dMap, IMAGE);
+  this->diffuseTextureSet = this->diffuseTexture = (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE);
 }
 
Index: orxonox/trunk/src/lib/util/resource_manager.cc
===================================================================
--- orxonox/trunk/src/lib/util/resource_manager.cc	(revision 3669)
+++ orxonox/trunk/src/lib/util/resource_manager.cc	(revision 3672)
@@ -11,5 +11,5 @@
    ### File Specific:
    main-programmer: Benjamin Grauer
-   co-programmer: ...
+   co-programmer: Patrick Boenzli
 */
 
@@ -38,7 +38,7 @@
 {
    this->setClassName ("ResourceManager");
-   dataDir = NULL;
-   imageDirs = new tList<char>();
-   resourceList = new tList<Resource>();
+   this->dataDir = "./";
+   this->imageDirs = new tList<char>();
+   this->resourceList = new tList<Resource>();
 }
 
@@ -55,10 +55,4 @@
 //! Singleton Reference to the ResourceManager
 ResourceManager* ResourceManager::singletonRef = NULL;
-//! The List of Resources, that has already been loaded.
-tList<Resource>* ResourceManager::resourceList = NULL;
-//! The Data Directory, where all relevant Data is stored.
-char* ResourceManager::dataDir = NULL;
-//! A list of directories in which images are stored.
-tList<char>* ResourceManager::imageDirs = NULL;
 
 /**
@@ -68,17 +62,18 @@
 {
   // deleting the Resources-List
-  unloadAllByPriority(RP_GAME);
-  delete resourceList;
-  resourceList = NULL;
+  this->unloadAllByPriority(RP_GAME);
+  delete this->resourceList;
   // deleting the Directorie Lists
-  char* tmpDir = imageDirs->enumerate();
+  tIterator<char>* tmpIt = imageDirs->getIterator();
+  char* tmpDir = tmpIt->nextElement();
   while(tmpDir)
     {
       delete []tmpDir;
-      tmpDir = imageDirs->nextElement();
-    }
-
-  delete imageDirs;
-  imageDirs = NULL;
+      tmpDir = tmpIt->nextElement();
+    }
+  delete tmpIt;
+
+  delete this->imageDirs;
+
   ResourceManager::singletonRef = NULL;
 }
@@ -92,6 +87,6 @@
   if (isDir(dataDir))
     {
-      ResourceManager::dataDir = new char[strlen(dataDir)+1];
-      strcpy(ResourceManager::dataDir, dataDir);
+      this->dataDir = new char[strlen(dataDir)+1];
+      strcpy(this->dataDir, dataDir);
     }
   else
@@ -113,5 +108,6 @@
     {
       // check if the Directory has been added before
-      char* tmpDir = imageDirs->enumerate();
+      tIterator<char>* tmpImageDirs = imageDirs->getIterator();
+      char* tmpDir = tmpImageDirs->nextElement();
       while(tmpDir)
 	{
@@ -119,12 +115,15 @@
 	    {
 	      PRINTF(4)("Path %s already loaded\n", imageDir);
+	      delete tmpImageDirs;
 	      return true;
 	    }
-	  tmpDir = imageDirs->nextElement();
-	}
+	  tmpDir = tmpImageDirs->nextElement();
+	}
+      delete tmpImageDirs;
+
       // adding the directory to the List
       tmpDir  = new char[strlen(imageDir)+1];
       strcpy(tmpDir, imageDir);
-      imageDirs->add(tmpDir);
+      this->imageDirs->add(tmpDir);
       return true;
     }
@@ -162,5 +161,5 @@
     tmpType = IMAGE;
 
-  return ResourceManager::load(fileName, tmpType, prio);
+  return this->load(fileName, tmpType, prio);
 }
 
@@ -175,5 +174,5 @@
 {
   // searching if the resource was loaded before.
-  Resource* tmpResource = ResourceManager::locateResourceByName(fileName);
+  Resource* tmpResource = this->locateResourceByName(fileName);
   if (!tmpResource) // if the resource was not loaded before.
     {
@@ -189,5 +188,5 @@
       // creating the full name. (directoryName + FileName)
       char* fullName = new char[strlen(dataDir)+strlen(fileName)+1];
-      sprintf(fullName, "%s%s", dataDir, fileName);
+      sprintf(fullName, "%s%s", this->dataDir, fileName);
       
       // Checking for the type of resource \see ResourceType
@@ -251,5 +250,5 @@
 	  tmpResource->pointer = NULL;
 	}
-      resourceList->add(tmpResource);
+      this->resourceList->add(tmpResource);
       delete []fullName;
     }
@@ -274,5 +273,5 @@
 {
   // if pointer is existent. and only one resource of this type exists.
-  Resource* tmpResource =ResourceManager::locateResourceByPointer(pointer);
+  Resource* tmpResource = this->locateResourceByPointer(pointer);
   if (!tmpResource)
     {
@@ -310,5 +309,5 @@
 	  PRINTF(4)("Resource %s safely removed.\n", resource->name);
 	  delete []resource->name;
-	  resourceList->remove(resource);
+	  this->resourceList->remove(resource);
 	}
       else
@@ -327,5 +326,4 @@
 bool ResourceManager::unloadAllByPriority(ResourcePriority prio)
 {
-
   tIterator<Resource>* iterator = resourceList->getIterator();
   Resource* enumRes = iterator->nextElement();
Index: orxonox/trunk/src/lib/util/resource_manager.h
===================================================================
--- orxonox/trunk/src/lib/util/resource_manager.h	(revision 3669)
+++ orxonox/trunk/src/lib/util/resource_manager.h	(revision 3672)
@@ -56,11 +56,11 @@
   virtual ~ResourceManager();
 
-  static bool setDataDir(char* dataDir);
-  static bool addImageDir(char* imageDir);
-  static void* load(const char* fileName, ResourcePriority prio = RP_NO);
-  static void* load(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO);
-  static bool unload(void* pointer, ResourcePriority prio = RP_NO);
-  static bool unload(Resource* resource, ResourcePriority = RP_NO);
-  static bool unloadAllByPriority(ResourcePriority prio);
+  bool setDataDir(char* dataDir);
+  bool addImageDir(char* imageDir);
+  void* load(const char* fileName, ResourcePriority prio = RP_NO);
+  void* load(const char* fileName, ResourceType type, ResourcePriority prio = RP_NO);
+  bool unload(void* pointer, ResourcePriority prio = RP_NO);
+  bool unload(Resource* resource, ResourcePriority = RP_NO);
+  bool unloadAllByPriority(ResourcePriority prio);
 
  private:
@@ -68,13 +68,14 @@
   static ResourceManager* singletonRef;
 
-  static tList<Resource>* resourceList;
-  static char* dataDir;
-  static tList<char>* imageDirs;
+  tList<Resource>* resourceList;       //!< The List of Resources, that has already been loaded.
+  char* dataDir;                       //!< The Data Directory, where all relevant Data is stored.
+  tList<char>* imageDirs;              //!< A list of directories in which images are stored.
 
-  static Resource* locateResourceByName(const char* fileName);
-  static Resource* locateResourceByPointer(const void* pointer);
+
+  Resource* locateResourceByName(const char* fileName);
+  Resource* locateResourceByPointer(const void* pointer);
   
-  static bool isDir(const char* directory);
-  static bool isFile(const char* directory);  
+  bool isDir(const char* directory);
+  bool isFile(const char* directory);  
 };
 
