Index: code/branches/input/bin/media.cfg
===================================================================
--- code/branches/input/bin/media.cfg	(revision 1528)
+++ 	(revision )
@@ -1,16 +1,0 @@
-Mesh=ogrehead.mesh
-Mesh=geosphere4500.mesh
-Mesh=razor.mesh
-Mesh=knot.mesh
-Mesh=RZR-002.mesh
-Mesh=geosphere8000.mesh
-Mesh=sphere.mesh
-
-CubeMap=cubescene.jpg
-CubeMap=early_morning.jpg
-CubeMap=cubemap.jpg
-CubeMap=morning.jpg
-CubeMap=cloudy_noon.jpg
-CubeMap=evening.jpg
-CubeMap=stormy.jpg
-CubeMap=stevecube.jpg
Index: code/branches/input/bin/quake3settings.cfg
===================================================================
--- code/branches/input/bin/quake3settings.cfg	(revision 1528)
+++ 	(revision )
@@ -1,3 +1,0 @@
-Pak0Location: f:\quake3levels\chiropteraDM.pk3
-Map: maps/chiropteradm.bsp
-
Index: code/branches/input/src/core/Core.h
===================================================================
--- code/branches/input/src/core/Core.h	(revision 1528)
+++ code/branches/input/src/core/Core.h	(revision 1531)
@@ -35,6 +35,6 @@
 */
 
-#ifndef _CoreSettings_H__
-#define _CoreSettings_H__
+#ifndef _Core_H__
+#define _Core_H__
 
 #include "CorePrereqs.h"
@@ -75,3 +75,3 @@
 }
 
-#endif /* _CoreSettings_H__ */
+#endif /* _Core_H__ */
Index: code/branches/input/src/core/input/InputBuffer.cc
===================================================================
--- code/branches/input/src/core/input/InputBuffer.cc	(revision 1528)
+++ code/branches/input/src/core/input/InputBuffer.cc	(revision 1531)
@@ -39,5 +39,5 @@
     InputBuffer::InputBuffer()
     {
-        RegisterObject(InputBuffer);
+        RegisterRootObject(InputBuffer);
 
         this->buffer_ = "";
@@ -59,5 +59,5 @@
     InputBuffer::InputBuffer(const std::string allowedChars)
     {
-        RegisterObject(InputBuffer);
+        RegisterRootObject(InputBuffer);
 
         this->allowedChars_ = allowedChars;
Index: code/branches/input/src/core/input/InputManager.cc
===================================================================
--- code/branches/input/src/core/input/InputManager.cc	(revision 1528)
+++ code/branches/input/src/core/input/InputManager.cc	(revision 1531)
@@ -69,5 +69,5 @@
       keyboardModifiers_(0)
   {
-    RegisterObject(InputManager);
+    RegisterRootObject(InputManager);
   }
 
Index: code/branches/input/src/core/input/KeyBinder.cc
===================================================================
--- code/branches/input/src/core/input/KeyBinder.cc	(revision 1528)
+++ code/branches/input/src/core/input/KeyBinder.cc	(revision 1531)
@@ -53,5 +53,5 @@
     mousePosition_[1] = 0;
 
-    RegisterObject(KeyBinder);
+    RegisterRootObject(KeyBinder);
 
     // keys
Index: code/branches/input/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/input/src/orxonox/CMakeLists.txt	(revision 1528)
+++ code/branches/input/src/orxonox/CMakeLists.txt	(revision 1531)
@@ -3,4 +3,5 @@
   Main.cc
   Orxonox.cc
+  Settings.cc
 
   console/InGameConsole.cc
Index: code/branches/input/src/orxonox/GraphicsEngine.cc
===================================================================
--- code/branches/input/src/orxonox/GraphicsEngine.cc	(revision 1528)
+++ code/branches/input/src/orxonox/GraphicsEngine.cc	(revision 1531)
@@ -21,7 +21,7 @@
  *
  *   Author:
- *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
+ *      Reto Grieder
  *   Co-authors:
- *      Reto Grieder
+ *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007, Felix Schulthess
  *
  */
@@ -35,21 +35,22 @@
 #include "GraphicsEngine.h"
 
+#include <OgreConfigFile.h>
+#include <OgreException.h>
+#include <OgreLogManager.h>
 #include <OgreRoot.h>
-#include <OgreException.h>
-#include <OgreConfigFile.h>
-#include <OgreLogManager.h>
+#include <OgreSceneManager.h>
 #include <OgreTextureManager.h>
-#include "core/input/InputManager.h"
+#include <OgreViewport.h>
+
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
 #include "core/Debug.h"
 #include "core/CommandExecutor.h"
-#include "core/TclBind.h"
+#include "core/ConsoleCommand.h"
+#include "core/input/InputManager.h"
+
 #include "console/InGameConsole.h"
-
-#include "core/ConsoleCommand.h"
-#include <OgreSceneManager.h>
-#include <OgreCompositorManager.h>
-#include <OgreViewport.h>
+#include "Settings.h"
+
 
 namespace orxonox {
@@ -70,8 +71,5 @@
     root_(0),
     scene_(0),
-    renderWindow_(0),
-    //configPath_(""),
-    dataPath_(""),
-    ogreLogfile_("")
+    renderWindow_(0)
   {
     RegisterObject(GraphicsEngine);
@@ -83,11 +81,12 @@
   void GraphicsEngine::setConfigValues()
   {
-    SetConfigValue(dataPath_, "../../Media/").description("relative path to media data");
-    SetConfigValue(ogreLogfile_, "ogre.log").description("Logfile for messages from Ogre. Use \"\" to suppress log file creation.");
+    SetConfigValue(resourceFile_,    "resources.cfg").description("Location of the resources file in the data path.");
+    SetConfigValue(ogreConfigFile_,  "ogre.cfg").description("Location of the Ogre config file");
+    SetConfigValue(ogrePluginsFile_, "plugins.cfg").description("Location of the Ogre plugins file");
+    SetConfigValue(ogreLogFile_,     "ogre.log").description("Logfile for messages from Ogre. \
+                                                             Use \"\" to suppress log file creation.");
     SetConfigValue(ogreLogLevelTrivial_ , 5).description("Corresponding orxonox debug level for ogre Trivial");
     SetConfigValue(ogreLogLevelNormal_  , 4).description("Corresponding orxonox debug level for ogre Normal");
     SetConfigValue(ogreLogLevelCritical_, 2).description("Corresponding orxonox debug level for ogre Critical");
-
-    TclBind::getInstance().setDataPath(this->dataPath_);
   }
 
@@ -126,21 +125,8 @@
     @brief Creates the Ogre Root object and sets up the ogre log.
   */
-  bool GraphicsEngine::setup(std::string& dataPath)
+  bool GraphicsEngine::setup()
   {
     CCOUT(3) << "Setting up..." << std::endl;
     // temporary overwrite of dataPath, change ini file for permanent change
-    if (dataPath != "")
-      dataPath_ = dataPath;
-    if (dataPath_ == "")
-      return false;
-    if (dataPath_[dataPath_.size() - 1] != '/')
-      dataPath_ += "/";
-
-    //TODO: Check if file exists (maybe not here)
-#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC && defined(_DEBUG)
-    std::string plugin_filename = "plugins_d.cfg";
-#else
-    std::string plugin_filename = "plugins.cfg";
-#endif
 
 // TODO: LogManager doesn't work on specific systems. The why is unknown yet.
@@ -154,8 +140,8 @@
     // create our own log that we can listen to
     Ogre::Log *myLog;
-    if (this->ogreLogfile_ == "")
+    if (this->ogreLogFile_ == "")
       myLog = logger->createLog("ogre.log", true, false, true);
     else
-      myLog = logger->createLog(this->ogreLogfile_, true, false, false);
+      myLog = logger->createLog(this->ogreLogFile_, true, false, false);
     CCOUT(4) << "Ogre Log created" << std::endl;
 
@@ -167,5 +153,36 @@
     CCOUT(4) << "Creating Ogre Root..." << std::endl;
 
-    root_ = new Ogre::Root(plugin_filename, "ogre.cfg", this->ogreLogfile_);
+    if (ogrePluginsFile_ == "")
+    {
+      COUT(1) << "Error: Ogre plugins file set to \"\". Cannot load." << std::endl;
+      return false;
+    }
+    if (ogreConfigFile_ == "")
+    {
+      COUT(1) << "Error: Ogre config file set to \"\". Cannot load." << std::endl;
+      return false;
+    }
+    if (ogreLogFile_ == "")
+    {
+      COUT(1) << "Error: Ogre log file set to \"\". Cannot load." << std::endl;
+      return false;
+    }
+
+    try
+    {
+      root_ = new Ogre::Root(ogrePluginsFile_, ogreConfigFile_, ogreLogFile_);
+    }
+    catch (Ogre::Exception ex)
+    {
+      COUT(2) << "Error: There was an exception when creating Ogre Root." << std::endl;
+      return false;
+    }
+
+    if (!root_->getInstalledPlugins().size())
+    {
+      COUT(1) << "Error: No plugins declared. Cannot load Ogre." << std::endl;
+      COUT(0) << "Is the plugins file correctly declared?" << std::endl;
+      return false;
+    }
 
 #if 0
@@ -180,5 +197,6 @@
 
     // specify where Ogre has to look for resources. This call doesn't parse anything yet!
-    declareRessourceLocations();
+    if (!declareRessourceLocations())
+      return false;
 
     CCOUT(3) << "Set up done." << std::endl;
@@ -186,12 +204,28 @@
   }
 
-  void GraphicsEngine::declareRessourceLocations()
+  bool GraphicsEngine::declareRessourceLocations()
   {
     CCOUT(4) << "Declaring Resources" << std::endl;
     //TODO: Specify layout of data file and maybe use xml-loader
     //TODO: Work with ressource groups (should be generated by a special loader)
+
+    if (resourceFile_ == "")
+    {
+      COUT(1) << "Error: Resource file set to \"\". Cannot load." << std::endl;
+      return false;
+    }
+
     // Load resource paths from data file using configfile ressource type
     Ogre::ConfigFile cf;
-    cf.load(dataPath_ + "resources.cfg");
+    try
+    {
+      cf.load(Settings::getDataPath() + resourceFile_);
+    }
+    catch (Ogre::Exception ex)
+    {
+      COUT(1) << "Error: Could not load resources.cfg in path " << Settings::getDataPath() << std::endl;
+      COUT(0) << "Have you forgotten to set the data path in orxnox.ini?" << std::endl;
+      return false;
+    }
 
     // Go through all sections & settings in the file
@@ -201,17 +235,24 @@
     while (seci.hasMoreElements())
     {
-      secName = seci.peekNextKey();
-      Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
-      Ogre::ConfigFile::SettingsMultiMap::iterator i;
-      for (i = settings->begin(); i != settings->end(); ++i)
+      try
       {
-        typeName = i->first; // for instance "FileSystem" or "Zip"
-        archName = i->second; // name (and location) of archive
-
-        Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
-                                           std::string(dataPath_ + archName),
-                                           typeName, secName);
+        secName = seci.peekNextKey();
+        Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
+        Ogre::ConfigFile::SettingsMultiMap::iterator i;
+        for (i = settings->begin(); i != settings->end(); ++i)
+        {
+          typeName = i->first; // for instance "FileSystem" or "Zip"
+          archName = i->second; // name (and location) of archive
+
+          Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
+              std::string(Settings::getDataPath() + archName), typeName, secName);
+        }
       }
-    }
+      catch (Ogre::Exception ex)
+      {
+        COUT(2) << "Exception while reading resources.cfg. Proceeding.." << ex.getDescription() << std::endl;
+      }
+    }
+    return true;
   }
 
@@ -223,8 +264,17 @@
 
     CCOUT(4) << "Creating render window" << std::endl;
-    this->renderWindow_ = root_->initialise(true, "OrxonoxV2");
+    try
+    {
+      this->renderWindow_ = root_->initialise(true, "OrxonoxV2");
+    }
+    catch (Ogre::Exception ex)
+    {
+      COUT(2) << "Error: There was an exception when initialising Ogre Root." << std::endl;
+      return false;
+    }
+
     if (!root_->isInitialised())
     {
-      CCOUT(2) << "Error: Creating Ogre root object failed" << std::endl;
+      CCOUT(2) << "Error: Initialising Ogre root object failed." << std::endl;
       return false;
     }
Index: code/branches/input/src/orxonox/GraphicsEngine.h
===================================================================
--- code/branches/input/src/orxonox/GraphicsEngine.h	(revision 1528)
+++ code/branches/input/src/orxonox/GraphicsEngine.h	(revision 1531)
@@ -21,7 +21,7 @@
  *
  *   Author:
- *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
+ *      Reto Grieder
  *   Co-authors:
- *      Reto Grieder
+ *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007, Felix Schulthess
  *
  */
@@ -56,6 +56,6 @@
         public:
             void setConfigValues();
-            bool setup(std::string& dataPath);
-            void declareRessourceLocations();
+            bool setup();
+            bool declareRessourceLocations();
             bool loadRenderer();
             bool initialiseResources();
@@ -65,5 +65,4 @@
 
             Ogre::SceneManager* getSceneManager() { return scene_; }
-            std::string& getDataPath() { return dataPath_; }
 
             // several window properties
@@ -101,14 +100,14 @@
                              bool, const std::string&);
 
-            Ogre::Root*         root_;        //!< Ogre's root
-            Ogre::SceneManager* scene_;       //!< scene manager of the game
-            Ogre::RenderWindow* renderWindow_;//!< the current render window
-            //bool               bOverwritePath_; //!< overwrites path
-            //std::string         configPath_;  //!< path to config file
-            std::string         dataPath_;    //!< path to data file
-            std::string         ogreLogfile_; //!< log file name for Ogre log messages
-            int ogreLogLevelTrivial_;         //!< Corresponding Orxonx debug level for LL_TRIVIAL
-            int ogreLogLevelNormal_;          //!< Corresponding Orxonx debug level for LL_NORMAL
-            int ogreLogLevelCritical_;        //!< Corresponding Orxonx debug level for LL_CRITICAL
+            Ogre::Root*         root_;              //!< Ogre's root
+            Ogre::SceneManager* scene_;             //!< scene manager of the game
+            Ogre::RenderWindow* renderWindow_;      //!< the current render window
+            std::string         resourceFile_;      //!< resources file name
+            std::string         ogreConfigFile_;    //!< ogre config file name
+            std::string         ogrePluginsFile_;   //!< ogre plugins file name
+            std::string         ogreLogFile_;       //!< log file name for Ogre log messages
+            int ogreLogLevelTrivial_;               //!< Corresponding Orxonx debug level for LL_TRIVIAL
+            int ogreLogLevelNormal_;                //!< Corresponding Orxonx debug level for LL_NORMAL
+            int ogreLogLevelCritical_;              //!< Corresponding Orxonx debug level for LL_CRITICAL
     };
 }
Index: code/branches/input/src/orxonox/Main.cc
===================================================================
--- code/branches/input/src/orxonox/Main.cc	(revision 1528)
+++ code/branches/input/src/orxonox/Main.cc	(revision 1531)
@@ -82,5 +82,5 @@
     res = orx->init(argc, argv, macBundlePath());
 #else
-    res = orx->init(argc, argv, "");
+    res = orx->init(argc, argv);
 #endif
 
Index: code/branches/input/src/orxonox/Orxonox.cc
===================================================================
--- code/branches/input/src/orxonox/Orxonox.cc	(revision 1528)
+++ code/branches/input/src/orxonox/Orxonox.cc	(revision 1531)
@@ -21,7 +21,7 @@
  *
  *   Author:
+ *      Reto Grieder
+ *   Co-authors:
  *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
- *   Co-authors:
- *      ...
  *
  */
@@ -73,4 +73,5 @@
 
 #include "GraphicsEngine.h"
+#include "Settings.h"
 
 // FIXME: is this really file scope?
@@ -166,19 +167,29 @@
    * @param path path to config (in home dir or something)
    */
-  bool Orxonox::init(int argc, char **argv, std::string path)
-  {
-    //TODO: find config file (assuming executable directory)
-    //TODO: read config file
-    //TODO: give config file to Ogre
+  bool Orxonox::init(int argc, char **argv)
+  {
+#ifdef _DEBUG
+    ConfigFileManager::getSingleton()->setFile(CFT_Settings, "orxonox_d.ini");
+#else
+    ConfigFileManager::getSingleton()->setFile(CFT_Settings, "orxonox.ini");
+#endif
+    Factory::createClassHierarchy();
+
     std::string mode;
-    std::string dataPath;
+    std::string tempDataPath;
 
     ArgReader ar(argc, argv);
-    ar.checkArgument("mode", mode, false);
-    ar.checkArgument("data", dataPath, false);
-    ar.checkArgument("ip", serverIp_, false);
-    ar.checkArgument("port", serverPort_, false);
+    ar.checkArgument("mode", &mode, false);
+    ar.checkArgument("data", &tempDataPath, false);
+    ar.checkArgument("ip",   &serverIp_, false);
+    ar.checkArgument("port", &serverPort_, false);
     if(ar.errorHandling())
+    {
+      COUT(1) << "Error while parsing command line arguments" << std::endl;
+      COUT(1) << ar.getErrorString();
+      COUT(0) << "Usage:" << std::endl << "orxonox [mode client|server|dedicated|standalone] "
+        << "[--data PATH] [--ip IP] [--port PORT]" << std::endl;
       return false;
+    }
 
     if (mode == "client")
@@ -190,8 +201,25 @@
     else
     {
-      mode = "standalone";
+      if (mode == "")
+        mode = "standalone";
+      if (mode != "standalone")
+      {
+        COUT(2) << "Warning: mode \"" << mode << "\" doesn't exist. "
+          << "Defaulting to standalone" << std::endl;
+        mode = "standalone";
+      }
       mode_ = STANDALONE;
     }
     COUT(3) << "Orxonox: Mode is " << mode << "." << std::endl;
+
+    if (tempDataPath != "")
+    {
+      if (tempDataPath[tempDataPath.size() - 1] != '/')
+        tempDataPath += "/";
+      Settings::tsetDataPath(tempDataPath);
+    }
+
+    // initialise TCL
+    TclBind::getInstance().setDataPath(Settings::getDataPath());
 
     //if (mode_ == DEDICATED)
@@ -202,9 +230,6 @@
     // procedure until the GUI is identical
 
-    ConfigFileManager::getSingleton()->setFile(CFT_Settings, "orxonox.ini");
-    Factory::createClassHierarchy();
-
     ogre_ = &GraphicsEngine::getSingleton();
-    if (!ogre_->setup(path))       // creates ogre root and other essentials
+    if (!ogre_->setup())       // creates ogre root and other essentials
       return false;
 
Index: code/branches/input/src/orxonox/Orxonox.h
===================================================================
--- code/branches/input/src/orxonox/Orxonox.h	(revision 1528)
+++ code/branches/input/src/orxonox/Orxonox.h	(revision 1531)
@@ -21,7 +21,7 @@
  *
  *   Author:
- *      ...
+ *      Reto Grieder
  *   Co-authors:
- *      ...
+ *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
  *
  */
@@ -58,5 +58,5 @@
   {
     public:
-      bool init(int argc, char **argv, std::string path);
+      bool init(int argc, char **argv);
       bool start();
 
Index: code/branches/input/src/orxonox/Settings.cc
===================================================================
--- code/branches/input/src/orxonox/Settings.cc	(revision 1531)
+++ code/branches/input/src/orxonox/Settings.cc	(revision 1531)
@@ -0,0 +1,105 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of the Settings class.
+*/
+
+#include "OrxonoxStableHeaders.h"
+#include "Settings.h"
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+
+namespace orxonox
+{
+  /**
+    @brief Constructor: Registers the object and sets the config-values.
+  */
+  Settings::Settings()
+  {
+    RegisterRootObject(Settings);
+    setConfigValues();
+  }
+
+  Settings::~Settings()
+  {
+  }
+
+  /**
+    @brief Returns a unique instance of Core.
+    @return The instance
+  */
+  Settings& Settings::getSingleton()
+  {
+    static Settings instance;
+    return instance;
+  }
+
+  /**
+    @brief Function to collect the SetConfigValue-macro calls.
+  */
+  void Settings::setConfigValues()
+  {
+    SetConfigValue(dataPath_, "../../Media/").description("Relative path to the game data.");
+    if (dataPath_ != "" && dataPath_[dataPath_.size() - 1] != '/')
+    {
+      ModifyConfigValue(dataPath_, set, dataPath_ + "/");
+    }
+
+    if (dataPath_ == "")
+    {
+      ModifyConfigValue(dataPath_, set, "/");
+      COUT(2) << "Warning: Data path set to \"/\", is that really correct?" << std::endl;
+    }
+  }
+
+  /**
+    @brief Temporary sets the data path
+    @param path The new data path
+  */
+  void Settings::_tsetDataPath(const std::string& path)
+  {
+    ModifyConfigValue(dataPath_, tset, path);
+  }
+
+  /*static*/ void Settings::tsetDataPath(const std::string& path)
+  {
+    getSingleton()._tsetDataPath(path);
+  }
+
+  /**
+    @brief Returns the relative path to the game data.
+    @return The path to the game data
+  */
+  /*static*/ const std::string& Settings::getDataPath()
+  {
+    return getSingleton().dataPath_;
+  }
+}
Index: code/branches/input/src/orxonox/Settings.h
===================================================================
--- code/branches/input/src/orxonox/Settings.h	(revision 1531)
+++ code/branches/input/src/orxonox/Settings.h	(revision 1531)
@@ -0,0 +1,65 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   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
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file Core.h
+    @brief Definition of the Settings class.
+
+    The static Settings class is only used to configure some variables
+    through the config-file.
+*/
+
+#ifndef _Settings_H__
+#define _Settings_H__
+
+#include "OrxonoxPrereqs.h"
+
+namespace orxonox
+{
+  class _OrxonoxExport Settings : public OrxonoxClass
+  {
+    public:
+      void setConfigValues();
+
+      static const std::string& getDataPath();
+
+      static void tsetDataPath(const std::string& path);
+
+    private:
+      Settings();
+      Settings(const Settings& instance);
+      ~Settings();
+      static Settings& getSingleton();
+
+      void _tsetDataPath(const std::string& path);
+
+      std::string dataPath_;               //!< Path to the game data
+  };
+}
+
+#endif /* _Settings_H__ */
Index: code/branches/input/src/util/ArgReader.cc
===================================================================
--- code/branches/input/src/util/ArgReader.cc	(revision 1528)
+++ code/branches/input/src/util/ArgReader.cc	(revision 1531)
@@ -21,7 +21,7 @@
  *
  *   Author:
- *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
+ *      Reto Grieder
  *   Co-authors:
- *      ...
+ *      Benjamin Knecht <beni_at_orxonox.net>
  *
  */
@@ -33,78 +33,62 @@
 
 #include "ArgReader.h"
+#include "SubString.h"
 
-#include <iostream>
+ArgReader::ArgReader(int argc, char **argv)
+{
+  failure_ = false;
+  errorString_ = "";
+  CmdLineArg arg;
 
-ArgReader::ArgReader(int argc, char** argv)
-{
-  counter_ = argc;
-  arguments_ = argv;
-  fail_ = false;
-  errorStr_ = "";
-}
+  int i = 1;
+  while (i < argc)
+  {
+    if (argv[i][0] == '-' && argv[i][1] == '-') // name
+    {
+      if (argv[i][2] == '\0')
+      {
+        failure_ = true;
+        errorString_ += "Expected word after \"--\".\n";
+      }
+      arg.bChecked_ = false;
+      arg.name_ = argv[i] + 2;
+      arg.value_ = "";
+      arguments_.push_back(arg);
+    }
+    else // value
+    {
+      if (arguments_.size() == 0)
+      {
+        failure_ = true;
+        errorString_ += "Expected \"--\" in command line arguments.\n";
+        arg.bChecked_ = false;
+        arg.name_ = "";
+        arg.value_ = "";
+        arguments_.push_back(arg);
+      }
 
-void ArgReader::checkArgument(std::string option, std::string &string, bool must)
-{
-  int argpos = checkOption(option) + 1;
-  if(argpos != 0)
-  {
-    string = arguments_[argpos];
+      if (arguments_.back().value_ != "")
+        arguments_.back().value_ += " " + std::string(argv[i]);
+      else
+        arguments_.back().value_ = argv[i];
+    }
+    ++i;
   }
-  else
-  {
-    if(must) {
-      errorStr_ = errorStr_ + "Cannot find mandatory argument \"" + option + "\"\n";
-      fail_ = true;
-    }
-  }
-
-}
-
-void ArgReader::checkArgument(std::string option, int &integer, bool must)
-{
-  int argpos = checkOption(option) + 1;
-  if(argpos != 0)
-  {
-    integer = atoi(arguments_[argpos]);
-  }
-  else
-  {
-    if(must) {
-      errorStr_ = errorStr_ + "Cannot find mandatory argument \"" + option + "\"\n";
-      fail_ = true;
-    }
-  }
-}
-
-void ArgReader::checkArgument(std::string option, float &floating, bool must)
-{
-  int argpos = checkOption(option) + 1;
-  if(argpos != 0)
-  {
-    floating = (float)atof(arguments_[argpos]);
-  }
-  else
-  {
-    if(must) {
-      errorStr_ = errorStr_ + "Cannot find mandatory argument \"" + option + "\"\n";
-      fail_ = true;
-    }
-  }
-}
-
-int ArgReader::checkOption(std::string option)
-{
-  for(int i = 1; i < counter_; i++)
-  {
-    if(arguments_[i] == "--" + option)
-        return i;
-  }
-  return -1;
 }
 
 bool ArgReader::errorHandling()
 {
-  if(fail_)
-    std::cout << errorStr_;
-  return fail_;
+  bool argumentsChecked = true;
+  for (unsigned int i = 1; i < arguments_.size(); ++i)
+    argumentsChecked &= arguments_[i].bChecked_;
+
+  if (!argumentsChecked)
+    errorString_ += "Not all arguments could be matched.\n";
+
+  return !argumentsChecked || failure_;
 }
+
+const std::string& ArgReader::getErrorString()
+{
+  return errorString_;
+}
Index: code/branches/input/src/util/ArgReader.h
===================================================================
--- code/branches/input/src/util/ArgReader.h	(revision 1528)
+++ code/branches/input/src/util/ArgReader.h	(revision 1531)
@@ -21,7 +21,7 @@
  *
  *   Author:
+ *      Reto Grieder
+ *   Co-authors:
  *      Benjamin Knecht <beni_at_orxonox.net>
- *   Co-authors:
- *      ...
  *
  */
@@ -39,4 +39,13 @@
 
 #include <string>
+#include <vector>
+#include "Convert.h"
+
+struct _UtilExport CmdLineArg
+{
+  std::string name_;
+  std::string value_;
+  bool bChecked_;
+};
 
 class _UtilExport ArgReader
@@ -44,17 +53,64 @@
   public:
     ArgReader(int argc, char **argv);
-    void checkArgument(std::string option, std::string& string, bool must=false);
-    void checkArgument(std::string option, int& integer, bool must=false);
-    void checkArgument(std::string option, float& floating, bool must=false);
+    template <class T>
+    void checkArgument(std::string option, T* value, bool must = false);
     bool errorHandling();
-  private:
-    int checkOption(std::string option);
+    const std::string& getErrorString();
 
   private:
-    int counter_;
-    char **arguments_;
-    bool fail_;
-    std::string errorStr_;
+    std::vector<CmdLineArg> arguments_;
+    bool failure_;
+    std::string errorString_;
 };
 
+template <class T>
+void ArgReader::checkArgument(std::string option, T* value, bool must)
+{
+  unsigned int iArg = 0;
+  while (iArg < arguments_.size())
+  {
+    if (arguments_[iArg].name_ == option)
+      break;
+    ++iArg;
+  }
+  if (iArg == arguments_.size())
+  {
+    if (must)
+    {
+      failure_ = true;
+      errorString_ += "Cannot find mandatory argument \"" + option + "\"\n";
+      return;
+    }
+    else
+      return;
+  }
+
+  arguments_[iArg].bChecked_ = true;
+
+  if (!convertValue(value, arguments_[iArg].value_))
+  {
+    failure_ = true;
+    errorString_ += "Cannot convert argument value for option \"" + option + "\"\n";
+  }
+}
+
+template <>
+void ArgReader::checkArgument(std::string option, bool* value, bool must)
+{
+  // for type bool, only check whether the option was set or not
+  unsigned int iArg = 0;
+  while (iArg < arguments_.size())
+  {
+    if (arguments_[iArg].name_ == option)
+    {
+      arguments_[iArg].bChecked_ = true;
+      *value = true;
+      break;
+    }
+    ++iArg;
+  }
+  if (iArg == arguments_.size())
+    *value = false;
+}
+
 #endif /* _ArgReader_H__ */
Index: code/branches/input/visual_studio/vc8/orxonox.vcproj
===================================================================
--- code/branches/input/visual_studio/vc8/orxonox.vcproj	(revision 1528)
+++ code/branches/input/visual_studio/vc8/orxonox.vcproj	(revision 1531)
@@ -184,4 +184,8 @@
 				</FileConfiguration>
 			</File>
+			<File
+				RelativePath="..\..\src\orxonox\Settings.cc"
+				>
+			</File>
 			<Filter
 				Name="hud"
@@ -468,4 +472,8 @@
 			<File
 				RelativePath="..\..\src\orxonox\OrxonoxStableHeaders.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\orxonox\Settings.h"
 				>
 			</File>
