Index: orxonox/trunk/src/lib/graphics/importer/objModel.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/objModel.cc	(revision 4112)
+++ orxonox/trunk/src/lib/graphics/importer/objModel.cc	(revision 4117)
@@ -34,5 +34,6 @@
 OBJModel::OBJModel(const char* fileName, float scaling) : Model(fileName)
 {
-  this->initializeOBJ();
+  this->objPath = "./";
+
   this->scaleFactor = scaling;
 
@@ -52,18 +53,4 @@
   if (this->objPath)
     delete []this->objPath;
-  if (this->objFileName)
-    delete []this->objFileName;
-  if (this->mtlFileName)
-    delete []this->mtlFileName;
-}
-
-/**
-   \brief Initializes an obj-model
-*/
-void OBJModel::initializeOBJ(void)
-{
-  this->objPath = NULL;
-  this->objFileName = NULL;
-  this->mtlFileName = NULL;
 }
 
@@ -71,39 +58,24 @@
    \brief Imports a obj file and handles the the relative location
    \param fileName The file to import
+
+   Splits the FileName from the DirectoryName
 */
 bool OBJModel::importFile (const char* fileName)
 {
   PRINTF(4)("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;
-  strcpy(tmpName, fileName);
-  if (tmpName[0] == pathSplitter)
-    tmpName++;
-  char* name = tmpName;
-  while (( tmpName = strchr (tmpName+1, pathSplitter)))
-    {
-      name = tmpName+1;
-    }
-  this->objPath = new char[name-fileName+1];
-  strncpy(this->objPath, fileName, name-fileName);
-  this->objPath[name-fileName] = '\0';
-  if (strlen(objPath)> 0)
-    PRINTF(5)("Resolved file %s to folder: %s.\n", name, objPath);
-  else
-    PRINTF(5)("Resolved file %s.\n", name);
-  
-  this->setName(name);
-
-  this->objFileName = new char[strlen(name)+1];
-  strcpy (this->objFileName, name);
-  this->readFromObjFile ();
+  // splitting the 
+  char* split = NULL;
+
+  if (!(split = strrchr(fileName, '/')))
+    split = strrchr(fileName, '\\'); // windows Case
+  if (split)
+    {
+      int len = split - fileName+1;
+      this->objPath = new char[len +2];
+      strncpy(this->objPath, fileName, len);
+      this->objPath[len+1] = '\0';
+      PRINTF(4)("Resolved file %s to Path %s\n", fileName, this->objPath);
+    }
+  this->readFromObjFile (fileName);
   return true;
 }
@@ -113,16 +85,10 @@
    This function does read the file, parses it for the occurence of things like vertices, faces and so on, and executes the specific tasks
 */
-bool OBJModel::readFromObjFile (void)
-{
-  char* fileName = new char [strlen(objPath)+strlen(objFileName)+1];
-  if (this->objFileName != NULL && !strcmp(this->objFileName, ""))
-    return false;
-  strcpy(fileName, this->objPath);
-  strcat(fileName, this->objFileName);
-
+bool OBJModel::readFromObjFile(const char* fileName)
+{
   FILE* stream;
   if( (stream = fopen (fileName, "r")) == NULL)
     {
-      printf("IniParser could not open %s\n", fileName);
+      printf("Object File Could not be Opened %s\n", fileName);
       return false;
     }
@@ -179,5 +145,4 @@
     }
   fclose (stream);
-  delete []fileName;
   return true;
 }
@@ -194,14 +159,12 @@
 bool OBJModel::readMtlLib (const char* mtlFile)
 {
-  this->mtlFileName = new char [strlen(mtlFile)+1];
-  strcpy(this->mtlFileName, mtlFile);
-  char* fileName = new char [strlen(this->objPath) + strlen(this->mtlFileName)+1];
-  sprintf(fileName, "%s%s", this->objPath, this->mtlFileName);
-  
+  char* fileName = new char [strlen(this->objPath) + strlen(mtlFile)+1];
+  sprintf(fileName, "%s%s", this->objPath, mtlFile);
 
   FILE* stream;
   if( (stream = fopen (fileName, "r")) == NULL)
     {
-      printf("IniParser could not open %s\n", fileName);
+      PRINTF(2)("MaterialLibrary could not be opened %s\n", fileName);
+      delete []fileName;
       return false;
     }
Index: orxonox/trunk/src/lib/graphics/importer/objModel.h
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/objModel.h	(revision 4112)
+++ orxonox/trunk/src/lib/graphics/importer/objModel.h	(revision 4117)
@@ -15,15 +15,12 @@
   OBJModel(const char* fileName, float scaling = 1.0);
   virtual ~OBJModel();
-  void initializeOBJ(void);
 
  private:
   // Variables
   char* objPath;        //!< The Path where the obj and mtl-file are located.
-  char* objFileName;    //!< The Name of the obj-file.
-  char* mtlFileName;    //!< The Name of the mtl-file (parsed out of the obj-file)
 
   ///// readin /////
   bool importFile (const char* fileName);
-  bool readFromObjFile (void);
+  bool readFromObjFile (const char* fileName);
   bool readMtlLib (const char* matFile);
 };
Index: orxonox/trunk/src/lib/util/ini_parser.cc
===================================================================
--- orxonox/trunk/src/lib/util/ini_parser.cc	(revision 4112)
+++ orxonox/trunk/src/lib/util/ini_parser.cc	(revision 4117)
@@ -28,5 +28,5 @@
   stream = NULL;
   bInSection = false;
-  openFile(filename);
+  this->openFile(filename);
 }
 
