Index: code/branches/objecthierarchy/bin/def_keybindings.ini
===================================================================
--- code/branches/objecthierarchy/bin/def_keybindings.ini	(revision 2100)
+++ code/branches/objecthierarchy/bin/def_keybindings.ini	(revision 2101)
@@ -25,5 +25,5 @@
 KeyEscape="exit"
 KeyF="scale -1 moveUpDown"
-KeyF1="OverlayGroup toggleVisibility Debug"
+KeyF1=
 KeyF10=
 KeyF11=
@@ -41,5 +41,5 @@
 KeyF9=
 KeyG=greet
-KeyGrave="openConsole"
+KeyGrave=
 KeyH=
 KeyHome=
Index: code/branches/objecthierarchy/bin/def_masterKeybindings.ini
===================================================================
--- code/branches/objecthierarchy/bin/def_masterKeybindings.ini	(revision 2101)
+++ code/branches/objecthierarchy/bin/def_masterKeybindings.ini	(revision 2101)
@@ -0,0 +1,260 @@
+[Keys]
+KeyA=
+KeyABNT_C1=
+KeyABNT_C2=
+KeyAT=
+KeyAX=
+KeyApostrophe=
+KeyApps=
+KeyB=
+KeyBack=
+KeyBackslash=
+KeyC=
+KeyCalculator=
+KeyCapsLock=
+KeyColon=
+KeyComma=
+KeyConvert=
+KeyD=
+KeyDelete=
+KeyDivide=
+KeyDown=
+KeyE=
+KeyEnd=
+KeyEquals=
+KeyEscape=
+KeyF=
+KeyF1="OverlayGroup toggleVisibility Debug"
+KeyF10=
+KeyF11=
+KeyF12=
+KeyF13=
+KeyF14=
+KeyF15=
+KeyF2=
+KeyF3=
+KeyF4=
+KeyF5=
+KeyF6=
+KeyF7=
+KeyF8=
+KeyF9=
+KeyG=
+KeyGrave="openConsole"
+KeyH=
+KeyHome=
+KeyI=
+KeyInsert=
+KeyJ=
+KeyK=
+KeyKana=
+KeyKanji=
+KeyL=
+KeyLeft=
+KeyLeftAlt=
+KeyLeftBracket=
+KeyLeftControl=
+KeyLeftShift=
+KeyLeftWindows=
+KeyLessThan=
+KeyM=
+KeyMail=
+KeyMediaSelect=
+KeyMediaStop=
+KeyMinus=
+KeyMultiply=
+KeyMute=
+KeyMyComputer=
+KeyN=
+KeyNextTrack=
+KeyNoConvert=
+KeyNumLock=
+KeyNumRow0=
+KeyNumRow1=
+KeyNumRow2=
+KeyNumRow3=
+KeyNumRow4=
+KeyNumRow5=
+KeyNumRow6=
+KeyNumRow7=
+KeyNumRow8=
+KeyNumRow9=
+KeyNumpad0=
+KeyNumpad1=
+KeyNumpad2=
+KeyNumpad3=
+KeyNumpad4=
+KeyNumpad5=
+KeyNumpad6=
+KeyNumpad7=
+KeyNumpad8=
+KeyNumpad9=
+KeyNumpadAdd=
+KeyNumpadComma=
+KeyNumpadEnter=
+KeyNumpadEquals=
+KeyNumpadPeriod=
+KeyNumpadSubtract=
+KeyO=
+KeyP=
+KeyPageDown=
+KeyPageUp=
+KeyPause=
+KeyPeriod=
+KeyPlayPause=
+KeyPower=
+KeyPreviousTrack=
+KeyQ=
+KeyR=
+KeyReturn=
+KeyRight=
+KeyRightAlt=
+KeyRightBracket=
+KeyRightControl=
+KeyRightShift=
+KeyRightWindows=
+KeyS=
+KeyScrollLock=
+KeySemicolon=
+KeySlash=
+KeySleep=
+KeySpace=
+KeyStop=
+KeySystemRequest=
+KeyT=
+KeyTab=
+KeyU=
+KeyUP=
+KeyUnassigned=
+KeyUnderline=
+KeyUnlabeled=
+KeyV=
+KeyVolumeDown=
+KeyVolumeUp=
+KeyW=
+KeyWake=
+KeyWebBack=
+KeyWebFavorites=
+KeyWebForward=
+KeyWebHome=
+KeyWebRefresh=
+KeyWebSearch=
+KeyWebStop=
+KeyX=
+KeyY=
+KeyYen=
+KeyZ=
+Key_084=
+Key_085=
+Key_089=
+Key_090=
+Key_091=
+Key_092=
+Key_093=
+Key_094=
+Key_095=
+Key_096=
+Key_097=
+Key_098=
+Key_099=
+Key_103=
+Key_104=
+Key_105=
+Key_106=
+Key_107=
+Key_108=
+Key_109=
+Key_110=
+Key_111=
+Key_112=
+Key_114=
+Key_115=
+Key_117=
+Key_118=
+Key_119=
+Key_120=
+Key_121=
+Key_123=
+Key_125=
+Key_128=
+Key_129=
+Key_130=
+Key_131=
+Key_132=
+Key_133=
+Key_134=
+Key_135=
+Key_136=
+Key_137=
+Key_138=
+Key_139=
+Key_140=
+Key_141=
+Key_143=
+Key_144=
+Key_154=
+Key_155=
+Key_158=
+Key_159=
+Key_163=
+Key_165=
+Key_166=
+Key_167=
+Key_168=
+Key_169=
+Key_170=
+Key_171=
+Key_172=
+Key_173=
+Key_175=
+Key_177=
+Key_180=
+Key_182=
+Key_185=
+Key_186=
+Key_187=
+Key_188=
+Key_189=
+Key_190=
+Key_191=
+Key_192=
+Key_193=
+Key_194=
+Key_195=
+Key_196=
+Key_198=
+Key_202=
+Key_204=
+Key_206=
+Key_212=
+Key_213=
+Key_214=
+Key_215=
+Key_216=
+Key_217=
+Key_218=
+Key_224=
+Key_225=
+Key_226=
+Key_228=
+
+[MouseButtons]
+MouseButton3=
+MouseButton4=
+MouseButton5=
+MouseButton6=
+MouseButton7=
+MouseLeft=
+MouseMiddle=
+MouseRight=
+MouseWheel1Down=
+MouseWheel1Up=
+MouseWheel2Down=
+MouseWheel2Up=
+
+[MouseAxes]
+MouseXNeg=
+MouseXPos=
+MouseYNeg=
+MouseYPos=
+
Index: code/branches/objecthierarchy/init/common/def_keybindings.ini
===================================================================
--- code/branches/objecthierarchy/init/common/def_keybindings.ini	(revision 2100)
+++ code/branches/objecthierarchy/init/common/def_keybindings.ini	(revision 2101)
@@ -10,5 +10,5 @@
 KeyBack=
 KeyBackslash=
-KeyC=
+KeyC=switchCamera
 KeyCalculator=
 KeyCapsLock=
@@ -25,5 +25,5 @@
 KeyEscape="exit"
 KeyF="scale -1 moveUpDown"
-KeyF1="OverlayGroup toggleVisibility Debug"
+KeyF1=
 KeyF10=
 KeyF11=
@@ -41,5 +41,5 @@
 KeyF9=
 KeyG=greet
-KeyGrave="openConsole"
+KeyGrave=
 KeyH=
 KeyHome=
Index: code/branches/objecthierarchy/init/common/def_masterKeybindings.ini
===================================================================
--- code/branches/objecthierarchy/init/common/def_masterKeybindings.ini	(revision 2101)
+++ code/branches/objecthierarchy/init/common/def_masterKeybindings.ini	(revision 2101)
@@ -0,0 +1,260 @@
+[Keys]
+KeyA=
+KeyABNT_C1=
+KeyABNT_C2=
+KeyAT=
+KeyAX=
+KeyApostrophe=
+KeyApps=
+KeyB=
+KeyBack=
+KeyBackslash=
+KeyC=
+KeyCalculator=
+KeyCapsLock=
+KeyColon=
+KeyComma=
+KeyConvert=
+KeyD=
+KeyDelete=
+KeyDivide=
+KeyDown=
+KeyE=
+KeyEnd=
+KeyEquals=
+KeyEscape=
+KeyF=
+KeyF1="OverlayGroup toggleVisibility Debug"
+KeyF10=
+KeyF11=
+KeyF12=
+KeyF13=
+KeyF14=
+KeyF15=
+KeyF2=
+KeyF3=
+KeyF4=
+KeyF5=
+KeyF6=
+KeyF7=
+KeyF8=
+KeyF9=
+KeyG=
+KeyGrave="openConsole"
+KeyH=
+KeyHome=
+KeyI=
+KeyInsert=
+KeyJ=
+KeyK=
+KeyKana=
+KeyKanji=
+KeyL=
+KeyLeft=
+KeyLeftAlt=
+KeyLeftBracket=
+KeyLeftControl=
+KeyLeftShift=
+KeyLeftWindows=
+KeyLessThan=
+KeyM=
+KeyMail=
+KeyMediaSelect=
+KeyMediaStop=
+KeyMinus=
+KeyMultiply=
+KeyMute=
+KeyMyComputer=
+KeyN=
+KeyNextTrack=
+KeyNoConvert=
+KeyNumLock=
+KeyNumRow0=
+KeyNumRow1=
+KeyNumRow2=
+KeyNumRow3=
+KeyNumRow4=
+KeyNumRow5=
+KeyNumRow6=
+KeyNumRow7=
+KeyNumRow8=
+KeyNumRow9=
+KeyNumpad0=
+KeyNumpad1=
+KeyNumpad2=
+KeyNumpad3=
+KeyNumpad4=
+KeyNumpad5=
+KeyNumpad6=
+KeyNumpad7=
+KeyNumpad8=
+KeyNumpad9=
+KeyNumpadAdd=
+KeyNumpadComma=
+KeyNumpadEnter=
+KeyNumpadEquals=
+KeyNumpadPeriod=
+KeyNumpadSubtract=
+KeyO=
+KeyP=
+KeyPageDown=
+KeyPageUp=
+KeyPause=
+KeyPeriod=
+KeyPlayPause=
+KeyPower=
+KeyPreviousTrack=
+KeyQ=
+KeyR=
+KeyReturn=
+KeyRight=
+KeyRightAlt=
+KeyRightBracket=
+KeyRightControl=
+KeyRightShift=
+KeyRightWindows=
+KeyS=
+KeyScrollLock=
+KeySemicolon=
+KeySlash=
+KeySleep=
+KeySpace=
+KeyStop=
+KeySystemRequest=
+KeyT=
+KeyTab=
+KeyU=
+KeyUP=
+KeyUnassigned=
+KeyUnderline=
+KeyUnlabeled=
+KeyV=
+KeyVolumeDown=
+KeyVolumeUp=
+KeyW=
+KeyWake=
+KeyWebBack=
+KeyWebFavorites=
+KeyWebForward=
+KeyWebHome=
+KeyWebRefresh=
+KeyWebSearch=
+KeyWebStop=
+KeyX=
+KeyY=
+KeyYen=
+KeyZ=
+Key_084=
+Key_085=
+Key_089=
+Key_090=
+Key_091=
+Key_092=
+Key_093=
+Key_094=
+Key_095=
+Key_096=
+Key_097=
+Key_098=
+Key_099=
+Key_103=
+Key_104=
+Key_105=
+Key_106=
+Key_107=
+Key_108=
+Key_109=
+Key_110=
+Key_111=
+Key_112=
+Key_114=
+Key_115=
+Key_117=
+Key_118=
+Key_119=
+Key_120=
+Key_121=
+Key_123=
+Key_125=
+Key_128=
+Key_129=
+Key_130=
+Key_131=
+Key_132=
+Key_133=
+Key_134=
+Key_135=
+Key_136=
+Key_137=
+Key_138=
+Key_139=
+Key_140=
+Key_141=
+Key_143=
+Key_144=
+Key_154=
+Key_155=
+Key_158=
+Key_159=
+Key_163=
+Key_165=
+Key_166=
+Key_167=
+Key_168=
+Key_169=
+Key_170=
+Key_171=
+Key_172=
+Key_173=
+Key_175=
+Key_177=
+Key_180=
+Key_182=
+Key_185=
+Key_186=
+Key_187=
+Key_188=
+Key_189=
+Key_190=
+Key_191=
+Key_192=
+Key_193=
+Key_194=
+Key_195=
+Key_196=
+Key_198=
+Key_202=
+Key_204=
+Key_206=
+Key_212=
+Key_213=
+Key_214=
+Key_215=
+Key_216=
+Key_217=
+Key_218=
+Key_224=
+Key_225=
+Key_226=
+Key_228=
+
+[MouseButtons]
+MouseButton3=
+MouseButton4=
+MouseButton5=
+MouseButton6=
+MouseButton7=
+MouseLeft=
+MouseMiddle=
+MouseRight=
+MouseWheel1Down=
+MouseWheel1Up=
+MouseWheel2Down=
+MouseWheel2Up=
+
+[MouseAxes]
+MouseXNeg=
+MouseXPos=
+MouseYNeg=
+MouseYPos=
+
Index: code/branches/objecthierarchy/src/audio/AudioBuffer.cc
===================================================================
--- code/branches/objecthierarchy/src/audio/AudioBuffer.cc	(revision 2100)
+++ code/branches/objecthierarchy/src/audio/AudioBuffer.cc	(revision 2101)
@@ -31,5 +31,5 @@
 namespace audio
 {
-    AudioBuffer::AudioBuffer(std::string fileName)
+    AudioBuffer::AudioBuffer(std::string filename)
     {
         // Load wav data into buffers.
@@ -40,5 +40,5 @@
 
         //FIXME deprecated; seems unneeded
-//        alutLoadWAVFile((ALbyte*)fileName.c_str(), &format, &data, &size, &freq, &loop);
+//        alutLoadWAVFile((ALbyte*)filename.c_str(), &format, &data, &size, &freq, &loop);
         alBufferData(buffer, format, data, size, freq);
         //FIXME deprecated; seems unneeded
Index: code/branches/objecthierarchy/src/audio/AudioBuffer.h
===================================================================
--- code/branches/objecthierarchy/src/audio/AudioBuffer.h	(revision 2100)
+++ code/branches/objecthierarchy/src/audio/AudioBuffer.h	(revision 2101)
@@ -40,5 +40,5 @@
     {
     public:
-        AudioBuffer(std::string fileName);
+        AudioBuffer(std::string filename);
         ~AudioBuffer();
 
Index: code/branches/objecthierarchy/src/core/CommandLine.cc
===================================================================
--- code/branches/objecthierarchy/src/core/CommandLine.cc	(revision 2100)
+++ code/branches/objecthierarchy/src/core/CommandLine.cc	(revision 2101)
@@ -30,7 +30,10 @@
 
 #include "util/String.h"
+#include "util/SubString.h"
 
 namespace orxonox
 {
+    SetCommandLineArgument(optionsFile, "start.ini").shortcut("o");
+
     /**
     @brief
@@ -274,3 +277,56 @@
         }
     }
+
+    /**
+    @brief
+        Parses both command line and start.ini for CommandLineArguments.
+    */
+    void CommandLine::_parseAll(int argc, char** argv)
+    {
+        // parse command line first
+        std::vector<std::string> args;
+        for (int i = 1; i < argc; ++i)
+            args.push_back(argv[i]);
+        this->_parse(args);
+
+        // look for additional arguments in given file or start.ini as default
+        // They will not overwrite the arguments given directly
+        std::ifstream file;
+        std::string filename = CommandLine::getValue("optionsFile").getString();
+        file.open(filename.c_str());
+        args.clear();
+        if (file)
+        {
+            while (!file.eof())
+            {
+                std::string line;
+                std::getline(file, line);
+                line = removeTrailingWhitespaces(line);
+                //if (!(line[0] == '#' || line[0] == '%'))
+                //{
+                SubString tokens(line, " ", " ", false, 92, false, 34, false, 40, 41, false, '#');
+                for (unsigned i = 0; i < tokens.size(); ++i)
+                    if (tokens[i][0] != '#')
+                        args.push_back(tokens[i]);
+                //args.insert(args.end(), tokens.getAllStrings().begin(), tokens.getAllStrings().end());
+                //}
+            }
+            file.close();
+        }
+        else
+        {
+            COUT(2) << "Warning: Could not find " << filename
+                    << " to get additional command line arguments." << std::endl;
+        }
+
+        try
+        {
+            _parse(args);
+        }
+        catch (orxonox::ArgumentException& ex)
+        {
+            COUT(1) << "An Exception occured while parsing " << filename << std::endl;
+            throw(ex);
+        }
+    }
 }
Index: code/branches/objecthierarchy/src/core/CommandLine.h
===================================================================
--- code/branches/objecthierarchy/src/core/CommandLine.h	(revision 2100)
+++ code/branches/objecthierarchy/src/core/CommandLine.h	(revision 2101)
@@ -38,8 +38,8 @@
 
 #define SetCommandLineArgument(name, defaultValue) \
-    CommandLineArgument& CmdArgumentDummyBoolVar##name \
+    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
     = orxonox::CommandLine::addArgument(#name, defaultValue)
 #define SetCommandLineSwitch(name) \
-    CommandLineArgument& CmdArgumentDummyBoolVar##name \
+    orxonox::CommandLineArgument& CmdArgumentDummyBoolVar##name \
     = orxonox::CommandLine::addArgument(#name, false)
 
@@ -135,5 +135,5 @@
 
         //! Parse redirection to internal member method.
-        static void parse(const std::vector<std::string>& arguments) { _getInstance()._parse(arguments); }
+        static void parseAll(int argc, char** argv) { _getInstance()._parseAll(argc, argv); }
 
         static std::string getUsageInformation();
@@ -165,4 +165,5 @@
         static CommandLine& _getInstance();
 
+        void _parseAll(int argc, char** argv);
         void _parse(const std::vector<std::string>& arguments);
         void checkFullArgument(const std::string& name, const std::string& value);
Index: code/branches/objecthierarchy/src/core/ConfigFileManager.cc
===================================================================
--- code/branches/objecthierarchy/src/core/ConfigFileManager.cc	(revision 2100)
+++ code/branches/objecthierarchy/src/core/ConfigFileManager.cc	(revision 2101)
@@ -28,10 +28,10 @@
 
 #include "ConfigFileManager.h"
-#include "ConfigValueContainer.h"
-#include "ConsoleCommand.h"
-#include "Identifier.h"
+
+#include <cassert>
 #include "util/Convert.h"
 #include "util/String.h"
-
+#include "ConsoleCommand.h"
+#include "ConfigValueContainer.h"
 
 namespace orxonox
@@ -39,4 +39,6 @@
     const int CONFIG_FILE_MAX_LINELENGHT  = 1024;
     const char* const DEFAULT_CONFIG_FILE = "default.ini";
+
+    ConfigFileManager* ConfigFileManager::singletonRef_s = 0;
 
     SetConsoleCommandShortcutExtern(config).argumentCompleter(0, autocompletion::configvalueclasses()).argumentCompleter(1, autocompletion::configvalues()).argumentCompleter(2, autocompletion::configvalue());
@@ -45,5 +47,4 @@
     SetConsoleCommandShortcutExtern(cleanConfig);
     SetConsoleCommandShortcutExtern(loadSettings).argumentCompleter(0, autocompletion::files());
-    SetConsoleCommandShortcutExtern(loadKeybindings).argumentCompleter(0, autocompletion::files());
 
     bool config(const std::string& classname, const std::string& varname, const std::string& value)
@@ -83,12 +84,6 @@
     void loadSettings(const std::string& filename)
     {
-        ConfigFileManager::getInstance().setFile(CFT_Settings, filename, false);
-    }
-
-    void loadKeybindings(const std::string& filename)
-    {
-        ConfigFileManager::getInstance().setFile(CFT_Keybindings, filename);
-    }
-
+        ConfigFileManager::getInstance().setFilename(ConfigFileType::Settings, filename);
+    }
 
     //////////////////////////
@@ -121,7 +116,7 @@
 
 
-    ///////////////////////////////
+    ////////////////////////////////
     // ConfigFileEntryVectorValue //
-    ///////////////////////////////
+    ////////////////////////////////
     std::string ConfigFileEntryVectorValue::getFileEntry() const
     {
@@ -217,17 +212,16 @@
     ConfigFile::~ConfigFile()
     {
-        for (std::list<ConfigFileSection*>::iterator it = this->sections_.begin(); it != this->sections_.end(); )
-            delete (*(it++));
+        this->clear();
     }
 
     void ConfigFile::load(bool bCreateIfNotExisting)
     {
-        if (bCreateIfNotExisting)
-        {
-            // This creates the default config file if it's not existing
-            std::ofstream createFile;
-            createFile.open(this->filename_.c_str(), std::fstream::app);
-            createFile.close();
-        }
+        // Be sure we start from new
+        this->clear();
+
+        // This creates the config file if it's not existing
+        std::ofstream createFile;
+        createFile.open(this->filename_.c_str(), std::fstream::app);
+        createFile.close();
 
         // Open the file
@@ -329,8 +323,11 @@
         file.close();
 
-        COUT(0) << "Loaded config file \"" << this->filename_ << "\"." << std::endl;
+        COUT(3) << "Loaded config file \"" << this->filename_ << "\"." << std::endl;
 
         // Save the file in case something changed (like stripped whitespaces)
         this->save();
+
+        // Update all ConfigValueContainers
+        this->updateConfigValues();
     }
 
@@ -366,5 +363,5 @@
     }
 
-    void ConfigFile::save(const std::string& filename)
+    void ConfigFile::saveAs(const std::string& filename)
     {
         std::string temp = this->filename_;
@@ -415,4 +412,11 @@
     }
 
+    void ConfigFile::clear()
+    {
+        for (std::list<ConfigFileSection*>::iterator it = this->sections_.begin(); it != this->sections_.end(); )
+            delete (*(it++));
+        this->sections_.clear();
+    }
+
     ConfigFileSection* ConfigFile::getSection(const std::string& section)
     {
@@ -446,11 +450,31 @@
     }
 
+    void ConfigFile::updateConfigValues()
+    {
+        if (this->type_ == ConfigFileType::Settings)
+        {
+            for (std::map<std::string, Identifier*>::const_iterator it = Identifier::getIdentifierMapBegin(); it != Identifier::getIdentifierMapEnd(); ++it)
+            {
+                if (it->second->hasConfigValues())
+                {
+                    for (std::map<std::string, ConfigValueContainer*>::const_iterator it2 = (*it).second->getConfigValueMapBegin(); it2 != (*it).second->getConfigValueMapEnd(); ++it2)
+                        it2->second->update();
+
+                    it->second->updateConfigValues();
+                }
+            }
+        }
+    }
+
 
     ///////////////////////
     // ConfigFileManager //
     ///////////////////////
+
     ConfigFileManager::ConfigFileManager()
-    {
-        this->setFile(CFT_Settings, DEFAULT_CONFIG_FILE);
+         : mininmalFreeType_(ConfigFileType::numberOfReservedTypes)
+    {
+        assert(singletonRef_s == 0);
+        singletonRef_s = this;
     }
 
@@ -458,30 +482,26 @@
     {
         for(std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); )
-            delete (*(it++)).second;
-    }
-
-    ConfigFileManager& ConfigFileManager::getInstance()
-    {
-        static ConfigFileManager instance;
-        return instance;
-    }
-
-    void ConfigFileManager::setFile(ConfigFileType type, const std::string& filename, bool bCreateIfNotExisting)
+            delete (it++)->second;
+
+        assert(singletonRef_s != 0);
+        singletonRef_s = 0;
+    }
+
+    void ConfigFileManager::setFilename(ConfigFileType type, const std::string& filename)
     {
         std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.find(type);
         if (it != this->configFiles_.end())
-            if ((*it).second != 0)
-                delete (*it).second;
-
-        this->configFiles_[type] = new ConfigFile(this->getFilePath(filename));
-        this->load(type, bCreateIfNotExisting);
-    }
-
-    void ConfigFileManager::load(bool bCreateIfNotExisting)
+        {
+            assert(it->second);
+            delete it->second;
+        }
+        this->configFiles_[type] = new ConfigFile(filename, type);
+        this->load(type);
+    }
+
+    void ConfigFileManager::load()
     {
         for(std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)
-            (*it).second->load(bCreateIfNotExisting);
-
-        this->updateConfigValues();
+            it->second->load();
     }
 
@@ -489,5 +509,5 @@
     {
         for(std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)
-            (*it).second->save();
+            it->second->save();
     }
 
@@ -495,11 +515,10 @@
     {
         for(std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)
-            this->clean((*it).first, bCleanComments);
-    }
-
-    void ConfigFileManager::load(ConfigFileType type, bool bCreateIfNotExisting)
-    {
-        this->getFile(type)->load(bCreateIfNotExisting);
-        this->updateConfigValues(type);
+            this->clean(it->first, bCleanComments);
+    }
+
+    void ConfigFileManager::load(ConfigFileType type)
+    {
+        this->getFile(type)->load();
     }
 
@@ -509,7 +528,7 @@
     }
 
-    void ConfigFileManager::save(ConfigFileType type, const std::string& filename)
-    {
-        this->getFile(type)->save(filename);
+    void ConfigFileManager::saveAs(ConfigFileType type, const std::string& saveFilename)
+    {
+        this->getFile(type)->saveAs(saveFilename);
     }
 
@@ -519,46 +538,36 @@
     }
 
-    void ConfigFileManager::updateConfigValues() const
+    void ConfigFileManager::updateConfigValues()
     {
         for(std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)
-            this->updateConfigValues((*it).first);
-    }
-
-    void ConfigFileManager::updateConfigValues(ConfigFileType type) const
-    {
-        if (type == CFT_Settings)
-        {
-            for (std::map<std::string, Identifier*>::const_iterator it = Identifier::getIdentifierMapBegin(); it != Identifier::getIdentifierMapEnd(); ++it)
-            {
-                if ((*it).second->hasConfigValues() /* && (*it).second != ClassIdentifier<KeyBinder>::getIdentifier()*/)
-                {
-                    for (std::map<std::string, ConfigValueContainer*>::const_iterator it2 = (*it).second->getConfigValueMapBegin(); it2 != (*it).second->getConfigValueMapEnd(); ++it2)
-                        (*it2).second->update();
-
-                    (*it).second->updateConfigValues();
-                }
-            }
-        }
-        else if (type == CFT_Keybindings)
-        {
-            // todo
-        }
+            it->second->updateConfigValues();
+    }
+
+    void ConfigFileManager::updateConfigValues(ConfigFileType type)
+    {
+        this->getFile(type)->updateConfigValues();
+    }
+
+    const std::string& ConfigFileManager::getFilename(ConfigFileType type)
+    {
+        std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.find(type);
+        if (it != this->configFiles_.end())
+            return it->second->getFilename();
+        else
+            return BLANKSTRING;
     }
 
     ConfigFile* ConfigFileManager::getFile(ConfigFileType type)
     {
-        std::map<ConfigFileType, ConfigFile*>::iterator it = this->configFiles_.find(type);
+        std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.find(type);
         if (it != this->configFiles_.end())
-            return (*it).second;
-
-        if (type == CFT_Settings)
-            return this->configFiles_[type] = new ConfigFile(DEFAULT_CONFIG_FILE);
-        else
-            return this->configFiles_[type] = new ConfigFile("");
-    }
-
-    std::string ConfigFileManager::getFilePath(const std::string& name) const
-    {
-        return name;
+            return it->second;
+        else
+        {
+            COUT(1) << "ConfigFileManager: Can't find a config file for type with ID " << (int)type << std::endl;
+            COUT(1) << "Using " << DEFAULT_CONFIG_FILE << " file." << std::endl;
+            this->setFilename(type, DEFAULT_CONFIG_FILE);
+            return getFile(type);
+        }
     }
 }
Index: code/branches/objecthierarchy/src/core/ConfigFileManager.h
===================================================================
--- code/branches/objecthierarchy/src/core/ConfigFileManager.h	(revision 2100)
+++ code/branches/objecthierarchy/src/core/ConfigFileManager.h	(revision 2101)
@@ -41,11 +41,26 @@
 namespace orxonox
 {
-    enum _CoreExport ConfigFileType
-    {
-        CFT_Settings,
-        CFT_Keybindings,
-        CFT_JoyStickCalibration
-    };
-
+    // Use unsigned int as config file type to have an arbitrary number of files
+    class ConfigFileType
+    {
+    public:
+        ConfigFileType() { }
+        ConfigFileType(unsigned int type)              { type_ = type; }
+        ConfigFileType(const ConfigFileType& instance) { type_ = instance.type_; }
+
+        operator unsigned int() { return type_; }
+        ConfigFileType& operator =(unsigned int type) { type_ = type; return *this; }
+        bool operator <(const ConfigFileType& right) const   { return (type_ < right.type_); }
+
+        /* *** Put the different config file types here *** */
+        static const unsigned int NoType              = 0;
+        static const unsigned int Settings            = 1;
+        static const unsigned int JoyStickCalibration = 2;
+
+        static const unsigned int numberOfReservedTypes = 1024;
+
+    private:
+        unsigned int type_;
+    };
 
     bool config(const std::string& classname, const std::string& varname, const std::string& value);
@@ -55,5 +70,4 @@
     void cleanConfig();
     void loadSettings(const std::string& filename);
-    void loadKeybindings(const std::string& filename);
 
 
@@ -218,11 +232,18 @@
     {
         public:
-            inline ConfigFile(const std::string& filename) : filename_(filename), bUpdated_(false) {}
+            inline ConfigFile(const std::string& filename, ConfigFileType type)
+                : filename_(filename)
+                , type_(type)
+                , bUpdated_(false)
+            { }
             ~ConfigFile();
 
             void load(bool bCreateIfNotExisting = true);
             void save() const;
-            void save(const std::string& filename);
+            void saveAs(const std::string& filename);
             void clean(bool bCleanComments = false);
+            void clear();
+
+            const std::string& getFilename() { return this->filename_; }
 
             inline void setValue(const std::string& section, const std::string& name, const std::string& value, bool bString)
@@ -241,4 +262,6 @@
                 { return this->getSection(section)->getVectorSize(name); }
 
+            void updateConfigValues();
+
         private:
             ConfigFileSection* getSection(const std::string& section);
@@ -246,4 +269,5 @@
 
             std::string filename_;
+            ConfigFileType type_;
             std::list<ConfigFileSection*> sections_;
             bool bUpdated_;
@@ -257,15 +281,19 @@
     {
         public:
-            static ConfigFileManager& getInstance();
-
-            void setFile(ConfigFileType type, const std::string& filename, bool bCreateIfNotExisting = true);
-
-            void load(bool bCreateIfNotExisting = true);
+            ConfigFileManager();
+            ~ConfigFileManager();
+
+            void load();
             void save();
             void clean(bool bCleanComments = false);
 
-            void load(ConfigFileType type, bool bCreateIfNotExisting = true);
+            void setFilename(ConfigFileType type, const std::string& filename);
+            const std::string& getFilename(ConfigFileType type);
+
+            ConfigFileType getNewConfigFileType() { return mininmalFreeType_++; }
+
+            void load(ConfigFileType type);
             void save(ConfigFileType type);
-            void save(ConfigFileType type, const std::string& filename);
+            void saveAs(ConfigFileType type, const std::string& saveFilename);
             void clean(ConfigFileType type, bool bCleanComments = false);
 
@@ -285,17 +313,18 @@
                 { return this->getFile(type)->getVectorSize(section, name); }
 
-            void updateConfigValues() const;
-            void updateConfigValues(ConfigFileType type) const;
-
-        private:
-            ConfigFileManager();
-            ConfigFileManager(const ConfigFileManager& other);
-            ~ConfigFileManager();
+            void updateConfigValues();
+            void updateConfigValues(ConfigFileType type);
+
+            static ConfigFileManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
+
+        private:
+            ConfigFileManager(const ConfigFileManager&);
 
             ConfigFile* getFile(ConfigFileType type);
 
-            std::string getFilePath(const std::string& name) const;
-
             std::map<ConfigFileType, ConfigFile*> configFiles_;
+            unsigned int mininmalFreeType_;
+
+            static ConfigFileManager* singletonRef_s;
     };
 }
Index: code/branches/objecthierarchy/src/core/ConfigValueIncludes.h
===================================================================
--- code/branches/objecthierarchy/src/core/ConfigValueIncludes.h	(revision 2100)
+++ code/branches/objecthierarchy/src/core/ConfigValueIncludes.h	(revision 2101)
@@ -52,11 +52,10 @@
     if (!container##varname) \
     { \
-        container##varname = new orxonox::ConfigValueContainer(CFT_Settings, identifier##varname, identifier##varname->getName(), #varname, defvalue, varname); \
+        container##varname = new orxonox::ConfigValueContainer(ConfigFileType::Settings, identifier##varname, identifier##varname->getName(), #varname, defvalue, varname); \
         identifier##varname->addConfigValueContainer(#varname, container##varname); \
     } \
     container##varname->getValue(&varname, this)
 
-#define SetConfigValue(varname, defvalue) SetConfigValueGeneric(CFT_Settings, varname, defvalue)
-#define SetKeybindingValue(varname, defvalue) SetConfigValueGeneric(CFT_Keybindings, varname, defvalue)
+#define SetConfigValue(varname, defvalue) SetConfigValueGeneric(ConfigFileType::Settings, varname, defvalue)
 
 
@@ -71,11 +70,10 @@
     if (!container##varname) \
     { \
-        container##varname = new orxonox::ConfigValueContainer(CFT_Settings, identifier##varname, identifier##varname->getName(), #varname, defvalue); \
+        container##varname = new orxonox::ConfigValueContainer(ConfigFileType::Settings, identifier##varname, identifier##varname->getName(), #varname, defvalue); \
         identifier##varname->addConfigValueContainer(#varname, container##varname); \
     } \
     container##varname->getValue(&varname, this)
 
-#define SetConfigValueVector(varname, defvalue) SetConfigValueVectorGeneric(CFT_Settings, varname, defvalue)
-#define SetKeybindingValueVector(varname, defvalue) SetConfigValueVectorGeneric(CFT_Keybindings, varname, defvalue)
+#define SetConfigValueVector(varname, defvalue) SetConfigValueVectorGeneric(ConfigFileType::Settings, varname, defvalue)
 
 
Index: code/branches/objecthierarchy/src/core/CoreIncludes.h
===================================================================
--- code/branches/objecthierarchy/src/core/CoreIncludes.h	(revision 2100)
+++ code/branches/objecthierarchy/src/core/CoreIncludes.h	(revision 2101)
@@ -135,5 +135,5 @@
 #define RegisterConstructionCallback(ThisClassName, TargetClassName, FunctionName) \
     orxonox::ClassIdentifier<TargetClassName>::getIdentifier()->addConstructionCallback( \
-        createFunctor(&ThisClassName::FunctionName)->setObject(this))
+        orxonox::createFunctor(&ThisClassName::FunctionName)->setObject(this))
 
 #endif /* _CoreIncludes_H__ */
Index: code/branches/objecthierarchy/src/core/Identifier.h
===================================================================
--- code/branches/objecthierarchy/src/core/Identifier.h	(revision 2100)
+++ code/branches/objecthierarchy/src/core/Identifier.h	(revision 2101)
@@ -485,5 +485,5 @@
         You can only assign an Identifier that belongs to a class T (or derived) to a SubclassIdentifier<T>.
         If you assign something else, the program aborts.
-        Because we know the minimal type, a dynamic_cast is done, which makes it easier to create a new object.
+        Because we know the minimum type, a dynamic_cast is done, which makes it easier to create a new object.
     */
     template <class T>
Index: code/branches/objecthierarchy/src/core/Language.cc
===================================================================
--- code/branches/objecthierarchy/src/core/Language.cc	(revision 2100)
+++ code/branches/objecthierarchy/src/core/Language.cc	(revision 2101)
@@ -137,5 +137,5 @@
         }
 
-        COUT(2) << "Warning: Language entry " << label << " is duplicate in " << getFileName(this->defaultLanguage_) << "!" << std::endl;
+        COUT(2) << "Warning: Language entry " << label << " is duplicate in " << getFilename(this->defaultLanguage_) << "!" << std::endl;
         return it->second;
     }
@@ -194,5 +194,5 @@
         @return The filename
     */
-    const std::string Language::getFileName(const std::string& language)
+    const std::string Language::getFilename(const std::string& language)
     {
         return std::string("translation_" + language + ".lang");
@@ -208,15 +208,15 @@
         // This creates the file if it's not existing
         std::ofstream createFile;
-        createFile.open(getFileName(this->defaultLanguage_).c_str(), std::fstream::app);
+        createFile.open(getFilename(this->defaultLanguage_).c_str(), std::fstream::app);
         createFile.close();
 
         // Open the file
         std::ifstream file;
-        file.open(getFileName(this->defaultLanguage_).c_str(), std::fstream::in);
+        file.open(getFilename(this->defaultLanguage_).c_str(), std::fstream::in);
 
         if (!file.is_open())
         {
             COUT(1) << "An error occurred in Language.cc:" << std::endl;
-            COUT(1) << "Error: Couldn't open file " << getFileName(this->defaultLanguage_) << " to read the default language entries!" << std::endl;
+            COUT(1) << "Error: Couldn't open file " << getFilename(this->defaultLanguage_) << " to read the default language entries!" << std::endl;
             return;
         }
@@ -240,5 +240,5 @@
                 else
                 {
-                    COUT(2) << "Warning: Invalid language entry \"" << lineString << "\" in " << getFileName(this->defaultLanguage_) << std::endl;
+                    COUT(2) << "Warning: Invalid language entry \"" << lineString << "\" in " << getFilename(this->defaultLanguage_) << std::endl;
                 }
             }
@@ -257,10 +257,10 @@
         // Open the file
         std::ifstream file;
-        file.open(getFileName(Core::getLanguage()).c_str(), std::fstream::in);
+        file.open(getFilename(Core::getLanguage()).c_str(), std::fstream::in);
 
         if (!file.is_open())
         {
             COUT(1) << "An error occurred in Language.cc:" << std::endl;
-            COUT(1) << "Error: Couldn't open file " << getFileName(Core::getLanguage()) << " to read the translated language entries!" << std::endl;
+            COUT(1) << "Error: Couldn't open file " << getFilename(Core::getLanguage()) << " to read the translated language entries!" << std::endl;
             Core::resetLanguage();
             COUT(3) << "Info: Reset language to " << this->defaultLanguage_ << "." << std::endl;
@@ -294,5 +294,5 @@
                 else
                 {
-                    COUT(2) << "Warning: Invalid language entry \"" << lineString << "\" in " << getFileName(Core::getLanguage()) << std::endl;
+                    COUT(2) << "Warning: Invalid language entry \"" << lineString << "\" in " << getFilename(Core::getLanguage()) << std::endl;
                 }
             }
@@ -311,10 +311,10 @@
         // Open the file
         std::ofstream file;
-        file.open(getFileName(this->defaultLanguage_).c_str(), std::fstream::out);
+        file.open(getFilename(this->defaultLanguage_).c_str(), std::fstream::out);
 
         if (!file.is_open())
         {
             COUT(1) << "An error occurred in Language.cc:" << std::endl;
-            COUT(1) << "Error: Couldn't open file " << getFileName(this->defaultLanguage_) << " to write the default language entries!" << std::endl;
+            COUT(1) << "Error: Couldn't open file " << getFilename(this->defaultLanguage_) << " to write the default language entries!" << std::endl;
             return;
         }
Index: code/branches/objecthierarchy/src/core/Language.h
===================================================================
--- code/branches/objecthierarchy/src/core/Language.h	(revision 2100)
+++ code/branches/objecthierarchy/src/core/Language.h	(revision 2101)
@@ -128,5 +128,5 @@
             void readTranslatedLanguageFile();
             void writeDefaultLanguageFile() const;
-            static const std::string getFileName(const std::string& language);
+            static const std::string getFilename(const std::string& language);
             LanguageEntry* createEntry(const LanguageEntryLabel& label, const std::string& entry);
 
Index: code/branches/objecthierarchy/src/core/RootGameState.cc
===================================================================
--- code/branches/objecthierarchy/src/core/RootGameState.cc	(revision 2100)
+++ code/branches/objecthierarchy/src/core/RootGameState.cc	(revision 2101)
@@ -29,6 +29,4 @@
 #include "RootGameState.h"
 
-#include "util/String.h"
-#include "util/SubString.h"
 #include "util/Debug.h"
 #include "util/Exception.h"
@@ -130,5 +128,5 @@
         State to start with (usually main menu or specified by command line)
     */
-    void RootGameState::start(int argc, char** argv)
+    void RootGameState::start()
     {
 #ifdef NDEBUG
@@ -141,6 +139,4 @@
             // create the Core settings to configure the output level
             Core::getInstance();
-
-            parseArguments(argc, argv);
 
             this->activate();
@@ -168,5 +164,4 @@
             COUT(1) << ex.what() << std::endl;
             COUT(1) << "Program aborted." << std::endl;
-            abort();
         }
         // anything that doesn't inherit from std::exception
@@ -174,63 +169,6 @@
         {
             COUT(1) << "An unidentifiable exception has occured. Program aborted." << std::endl;
-            abort();
         }
 #endif
     }
-
-    /**
-    @brief
-        Parses both command line and start.ini for CommandLineArguments.
-    */
-    void RootGameState::parseArguments(int argc, char** argv)
-    {
-        // parse command line first
-        std::vector<std::string> args;
-        for (int i = 1; i < argc; ++i)
-            args.push_back(argv[i]);
-
-        try
-        {
-            orxonox::CommandLine::parse(args);
-        }
-        catch (orxonox::ArgumentException& ex)
-        {
-            COUT(1) << ex.what() << std::endl;
-            COUT(0) << "Usage:" << std::endl << "orxonox " << CommandLine::getUsageInformation() << std::endl;
-        }
-
-        // look for additional arguments in start.ini
-        std::ifstream file;
-        file.open("start.ini");
-        args.clear();
-        if (file)
-        {
-            while (!file.eof())
-            {
-                std::string line;
-                std::getline(file, line);
-                line = removeTrailingWhitespaces(line);
-                //if (!(line[0] == '#' || line[0] == '%'))
-                //{
-                SubString tokens(line, " ", " ", false, 92, false, 34, false, 40, 41, false, '#');
-                for (unsigned i = 0; i < tokens.size(); ++i)
-                    if (tokens[i][0] != '#')
-                        args.push_back(tokens[i]);
-                //args.insert(args.end(), tokens.getAllStrings().begin(), tokens.getAllStrings().end());
-                //}
-            }
-            file.close();
-        }
-
-        try
-        {
-            orxonox::CommandLine::parse(args);
-        }
-        catch (orxonox::ArgumentException& ex)
-        {
-            COUT(1) << "An Exception occured while parsing start.ini" << std::endl;
-            COUT(1) << ex.what() << std::endl;
-            COUT(0) << "Usage:" << std::endl << "orxonox " << CommandLine::getUsageInformation() << std::endl;
-        }
-    }
 }
Index: code/branches/objecthierarchy/src/core/RootGameState.h
===================================================================
--- code/branches/objecthierarchy/src/core/RootGameState.h	(revision 2100)
+++ code/branches/objecthierarchy/src/core/RootGameState.h	(revision 2101)
@@ -42,11 +42,9 @@
 
         void requestState(const std::string& name);
-        void start(int argc, char** argv);
+        void start();
 
     private:
         void makeTransition(GameStateBase* source, GameStateBase* destination);
         void gotoState(const std::string& name);
-
-        void parseArguments(int argc, char** argv);
 
         std::string           stateRequest_;
Index: code/branches/objecthierarchy/src/core/input/Button.cc
===================================================================
--- code/branches/objecthierarchy/src/core/input/Button.cc	(revision 2100)
+++ code/branches/objecthierarchy/src/core/input/Button.cc	(revision 2101)
@@ -82,10 +82,10 @@
     }
 
-    void Button::readConfigValue()
+    void Button::readConfigValue(ConfigFileType configFile)
     {
         // create/get ConfigValueContainer
         if (!configContainer_)
         {
-            configContainer_ = new ConfigValueContainer(CFT_Keybindings, 0, groupName_, name_, "", name_);
+            configContainer_ = new ConfigValueContainer(configFile, 0, groupName_, name_, "", name_);
             configContainer_->callback(this, &Button::parse);
         }
Index: code/branches/objecthierarchy/src/core/input/Button.h
===================================================================
--- code/branches/objecthierarchy/src/core/input/Button.h	(revision 2100)
+++ code/branches/objecthierarchy/src/core/input/Button.h	(revision 2101)
@@ -41,4 +41,5 @@
 #include <vector>
 #include "InputCommands.h"
+#include "core/ConfigFileManager.h"
 
 namespace orxonox
@@ -52,5 +53,5 @@
         virtual bool addParamCommand(ParamCommand* command) { return false; }
         void parse();
-        void readConfigValue();
+        void readConfigValue(ConfigFileType configFile);
         bool execute(KeybindMode::Enum mode, float abs = 1.0f, float rel = 1.0f);
 
Index: code/branches/objecthierarchy/src/core/input/InputManager.cc
===================================================================
--- code/branches/objecthierarchy/src/core/input/InputManager.cc	(revision 2100)
+++ code/branches/objecthierarchy/src/core/input/InputManager.cc	(revision 2101)
@@ -395,5 +395,5 @@
             if (!cont)
             {
-                cont = new ConfigValueContainer(CFT_Settings, getIdentifier(), getIdentifier()->getName(), "CoeffPos", coeffPos);
+                cont = new ConfigValueContainer(ConfigFileType::Settings, getIdentifier(), getIdentifier()->getName(), "CoeffPos", coeffPos);
                 getIdentifier()->addConfigValueContainer("CoeffPos", cont);
             }
@@ -403,5 +403,5 @@
             if (!cont)
             {
-                cont = new ConfigValueContainer(CFT_Settings, getIdentifier(), getIdentifier()->getName(), "CoeffNeg", coeffNeg);
+                cont = new ConfigValueContainer(ConfigFileType::Settings, getIdentifier(), getIdentifier()->getName(), "CoeffNeg", coeffNeg);
                 getIdentifier()->addConfigValueContainer("CoeffNeg", cont);
             }
@@ -411,5 +411,5 @@
             if (!cont)
             {
-                cont = new ConfigValueContainer(CFT_Settings, getIdentifier(), getIdentifier()->getName(), "Zero", zero);
+                cont = new ConfigValueContainer(ConfigFileType::Settings, getIdentifier(), getIdentifier()->getName(), "Zero", zero);
                 getIdentifier()->addConfigValueContainer("Zero", cont);
             }
Index: code/branches/objecthierarchy/src/core/input/KeyBinder.cc
===================================================================
--- code/branches/objecthierarchy/src/core/input/KeyBinder.cc	(revision 2100)
+++ code/branches/objecthierarchy/src/core/input/KeyBinder.cc	(revision 2101)
@@ -106,4 +106,7 @@
         }
 
+        // Get a new ConfigFileType from the ConfigFileManager
+        this->configFile_ = ConfigFileManager::getInstance().getNewConfigFileType();
+
         // initialise joy sticks separatly to allow for reloading
         numberOfJoySticks_ = InputManager::getInstance().numberOfJoySticks();
@@ -133,6 +136,4 @@
     void KeyBinder::setConfigValues()
     {
-        SetConfigValue(defaultKeybindings_, "def_keybindings.ini")
-            .description("Filename of default keybindings.");
         SetConfigValue(analogThreshold_, 0.05f)
             .description("Threshold for analog axes until which the state is 0.");
@@ -173,12 +174,12 @@
 
         // load the bindings if required
-        if (!configFile_.empty())
+        if (configFile_ != ConfigFileType::NoType)
         {
             for (unsigned int iDev = oldValue; iDev < numberOfJoySticks_; ++iDev)
             {
                 for (unsigned int i = 0; i < JoyStickButtonCode::numberOfButtons; ++i)
-                    joyStickButtons_[iDev][i].readConfigValue();
+                    joyStickButtons_[iDev][i].readConfigValue(this->configFile_);
                 for (unsigned int i = 0; i < JoyStickAxisCode::numberOfAxes * 2; ++i)
-                    joyStickAxes_[iDev][i].readConfigValue();
+                    joyStickAxes_[iDev][i].readConfigValue(this->configFile_);
             }
         }
@@ -250,28 +251,27 @@
         True if loading succeeded.
     */
-    void KeyBinder::loadBindings(const std::string& filename)
+    void KeyBinder::loadBindings(const std::string& filename, const std::string& defaultFilename)
     {
         COUT(3) << "KeyBinder: Loading key bindings..." << std::endl;
 
-        configFile_ = filename;
-        if (configFile_.empty())
+        if (filename.empty())
             return;
 
         // get bindings from default file if filename doesn't exist.
         std::ifstream infile;
-        infile.open(configFile_.c_str());
+        infile.open(filename.c_str());
         if (!infile)
         {
-            ConfigFileManager::getInstance().setFile(CFT_Keybindings, defaultKeybindings_);
-            ConfigFileManager::getInstance().save(CFT_Keybindings, configFile_);
+            ConfigFileManager::getInstance().setFilename(this->configFile_, defaultFilename);
+            ConfigFileManager::getInstance().saveAs(this->configFile_, filename);
         }
         else
             infile.close();
-        ConfigFileManager::getInstance().setFile(CFT_Keybindings, configFile_);
+        ConfigFileManager::getInstance().setFilename(this->configFile_, filename);
 
         // Parse bindings and create the ConfigValueContainers if necessary
         clearBindings();
         for (std::map<std::string, Button*>::const_iterator it = allButtons_.begin(); it != allButtons_.end(); ++it)
-            it->second->readConfigValue();
+            it->second->readConfigValue(this->configFile_);
 
         COUT(3) << "KeyBinder: Loading key bindings done." << std::endl;
Index: code/branches/objecthierarchy/src/core/input/KeyBinder.h
===================================================================
--- code/branches/objecthierarchy/src/core/input/KeyBinder.h	(revision 2100)
+++ code/branches/objecthierarchy/src/core/input/KeyBinder.h	(revision 2101)
@@ -44,4 +44,5 @@
 #include "InputCommands.h"
 #include "JoyStickDeviceNumberListener.h"
+#include "core/ConfigFileManager.h"
 
 namespace orxonox
@@ -59,5 +60,5 @@
         virtual ~KeyBinder();
 
-        void loadBindings(const std::string& filename);
+        void loadBindings(const std::string& filename, const std::string& defaultFilename);
         void clearBindings();
         bool setBinding(const std::string& binding, const std::string& name, bool bTemporary = false);
@@ -142,11 +143,9 @@
         float deriveTime_;
 
-        //! Config file used. "" in case of KeyDetector. Also indicates whether we've already loaded.
-        std::string configFile_;
+        //! Config file used. ConfigFileType::NoType in case of KeyDetector. Also indicates whether we've already loaded.
+        ConfigFileType configFile_;
 
     private:
         //##### ConfigValues #####
-        //! Filename of default keybindings.
-        std::string defaultKeybindings_;
         //! Whether to filter small value analog input
         bool bFilterAnalogNoise_;
Index: code/branches/objecthierarchy/src/orxonox/Main.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/Main.cc	(revision 2100)
+++ code/branches/objecthierarchy/src/orxonox/Main.cc	(revision 2101)
@@ -42,4 +42,5 @@
 #include "util/SignalHandler.h"
 #include "core/ConfigFileManager.h"
+#include "core/CommandLine.h"
 
 #include "gamestates/GSRoot.h"
@@ -51,6 +52,4 @@
 #include "gamestates/GSGUI.h"
 #include "gamestates/GSIOConsole.h"
-
-using namespace orxonox;
 
 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_APPLE
@@ -86,12 +85,28 @@
 //#endif
 
+SetCommandLineArgument(settingsFile, "orxonox.ini");
+
 int main(int argc, char** argv)
 {
+    using namespace orxonox;
+
     // create a signal handler (only works for linux)
     SignalHandler::getInstance()->doCatch(argv[0], "orxonox.log");
 
-    // Specifiy config file before creating the GameStates in order to have
+    // Parse command line arguments
+    try
+    {
+        CommandLine::parseAll(argc, argv);
+    }
+    catch (ArgumentException& ex)
+    {
+        COUT(1) << ex.what() << std::endl;
+        COUT(0) << "Usage:" << std::endl << "orxonox " << CommandLine::getUsageInformation() << std::endl;
+    }
+
+    // Create the ConfigFileManager before creating the GameStates in order to have
     // setConfigValues() in the constructor (required).
-    ConfigFileManager::getInstance().setFile(CFT_Settings, "orxonox.ini");
+    ConfigFileManager* configFileManager = new ConfigFileManager();
+    configFileManager->setFilename(ConfigFileType::Settings, CommandLine::getValue("settingsFile").getString());
 
     // create the gamestates
@@ -115,5 +130,8 @@
 
     // Here happens the game
-    root.start(argc, argv);
+    root.start();
+
+    // Destroy ConfigFileManager again.
+    delete configFileManager;
 
     return 0;
Index: code/branches/objecthierarchy/src/orxonox/gamestates/GSGraphics.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/gamestates/GSGraphics.cc	(revision 2100)
+++ code/branches/objecthierarchy/src/orxonox/gamestates/GSGraphics.cc	(revision 2101)
@@ -93,14 +93,22 @@
     void GSGraphics::setConfigValues()
     {
-        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");
-        SetConfigValue(statisticsRefreshCycle_, 200000).description("Sets the time in microseconds interval at \
-                                                                    which average fps, etc. get updated.");
+        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");
+        SetConfigValue(statisticsRefreshCycle_, 200000)
+            .description("Sets the time in microseconds interval at which average fps, etc. get updated.");
+        SetConfigValue(defaultMasterKeybindings_, "def_masterKeybindings.ini")
+            .description("Filename of default master keybindings.");
     }
 
@@ -136,7 +144,7 @@
         inputManager_->initialise(windowHnd, renderWindow_->getWidth(), renderWindow_->getHeight(), true);
         // Configure master input state with a KeyBinder
-        //masterKeyBinder_ = new KeyBinder();
-        //masterKeyBinder_->loadBindings("master_keybindings.ini");
-        //inputManager_->getMasterInputState()->addKeyHandler(masterKeyBinder_);
+        masterKeyBinder_ = new KeyBinder();
+        masterKeyBinder_->loadBindings("masterKeybindings.ini", defaultMasterKeybindings_);
+        inputManager_->getMasterInputState()->addKeyHandler(masterKeyBinder_);
 
         // Load the InGameConsole
@@ -172,5 +180,5 @@
 
         //inputManager_->getMasterInputState()->removeKeyHandler(this->masterKeyBinder_);
-        //delete this->masterKeyBinder_;
+        delete this->masterKeyBinder_;
         delete this->inputManager_;
 
Index: code/branches/objecthierarchy/src/orxonox/gamestates/GSGraphics.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/gamestates/GSGraphics.h	(revision 2100)
+++ code/branches/objecthierarchy/src/orxonox/gamestates/GSGraphics.h	(revision 2101)
@@ -103,12 +103,13 @@
 
         // config values
-        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
-        unsigned int          detailLevelParticle_;   //!< Detail level of particle effects (0: off, 1: low, 2: normal, 3: high)
+        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
+        unsigned int          detailLevelParticle_;      //!< Detail level of particle effects (0: off, 1: low, 2: normal, 3: high)
+        std::string           defaultMasterKeybindings_; //!< Filename of default master keybindings.
     };
 }
Index: code/branches/objecthierarchy/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/gamestates/GSLevel.cc	(revision 2100)
+++ code/branches/objecthierarchy/src/orxonox/gamestates/GSLevel.cc	(revision 2101)
@@ -71,4 +71,6 @@
     {
         SetConfigValue(keyDetectorCallbackCode_, "KeybindBindingStringKeyName=");
+        SetConfigValue(defaultKeybindings_, "def_keybindings.ini")
+            .description("Filename of default keybindings.");
     }
 
@@ -79,5 +81,5 @@
             inputState_ = InputManager::getInstance().createInputState<SimpleInputState>("game", 20);
             keyBinder_ = new KeyBinder();
-            keyBinder_->loadBindings("keybindings.ini");
+            keyBinder_->loadBindings("keybindings.ini", defaultKeybindings_);
             inputState_->setHandler(keyBinder_);
 
Index: code/branches/objecthierarchy/src/orxonox/gamestates/GSLevel.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/gamestates/GSLevel.h	(revision 2100)
+++ code/branches/objecthierarchy/src/orxonox/gamestates/GSLevel.h	(revision 2101)
@@ -71,6 +71,8 @@
         LevelManager*         levelManager_;
 
-        // config values
+        //##### ConfigValues #####
         std::string           keyDetectorCallbackCode_;
+        //! Filename of default keybindings.
+        std::string           defaultKeybindings_;
 
     private:
Index: code/branches/objecthierarchy/src/util/Exception.cc
===================================================================
--- code/branches/objecthierarchy/src/util/Exception.cc	(revision 2100)
+++ code/branches/objecthierarchy/src/util/Exception.cc	(revision 2101)
@@ -38,9 +38,9 @@
 {
     Exception::Exception(const std::string& description, int lineNumber,
-                         const char* fileName, const char* functionName)
+                         const char* filename, const char* functionName)
         : description_(description)
         , lineNumber_(lineNumber)
         , functionName_(functionName)
-        , fileName_(fileName)
+        , filename_(filename)
     { }
 
@@ -49,5 +49,5 @@
         , lineNumber_(0)
         , functionName_("")
-        , fileName_("")
+        , filename_("")
     { }
 
@@ -60,7 +60,7 @@
             fullDesc << this->getTypeName() << "_EXCEPTION";
 
-            if (this->fileName_ != "")
+            if (this->filename_ != "")
             {
-                fullDesc << " in " << this->fileName_;
+                fullDesc << " in " << this->filename_;
                 if (this->lineNumber_)
                     fullDesc << "(" << this->lineNumber_ << ")";
Index: code/branches/objecthierarchy/src/util/Exception.h
===================================================================
--- code/branches/objecthierarchy/src/util/Exception.h	(revision 2100)
+++ code/branches/objecthierarchy/src/util/Exception.h	(revision 2101)
@@ -67,5 +67,5 @@
 
         Exception(const std::string& description, int lineNumber,
-                  const char* fileName, const char* functionName);
+                  const char* filename, const char* functionName);
         Exception(const std::string& description);
 
@@ -87,5 +87,5 @@
         int lineNumber_;
         std::string functionName_;
-        std::string fileName_;
+        std::string filename_;
         // mutable because "what()" is a const method
         mutable std::string fullDescription_;
@@ -98,6 +98,6 @@
     public:
         SpecificException(const std::string& description, int lineNumber,
-                  const char* fileName, const char* functionName)
-                  : Exception(description, lineNumber, fileName, functionName)
+                  const char* filename, const char* functionName)
+                  : Exception(description, lineNumber, filename, functionName)
         {
             // let the catcher decide whether to display the message below level 4
Index: code/branches/objecthierarchy/src/util/SignalHandler.cc
===================================================================
--- code/branches/objecthierarchy/src/util/SignalHandler.cc	(revision 2100)
+++ code/branches/objecthierarchy/src/util/SignalHandler.cc	(revision 2101)
@@ -58,10 +58,10 @@
  * register signal handlers for SIGSEGV and SIGABRT
  * @param appName path to executable eg argv[0]
- * @param fileName filename to append backtrace to
- */
-void SignalHandler::doCatch( const std::string & appName, const std::string & fileName )
+ * @param filename filename to append backtrace to
+ */
+void SignalHandler::doCatch( const std::string & appName, const std::string & filename )
 {
   this->appName = appName;
-  this->fileName = fileName;
+  this->filename = filename;
 
   // prepare for restoring XAutoKeyRepeat
@@ -326,9 +326,9 @@
   bt.insert(0, timeString);
 
-  FILE * f = fopen( getInstance()->fileName.c_str(), "a" );
+  FILE * f = fopen( getInstance()->filename.c_str(), "a" );
 
   if ( !f )
   {
-    perror( ( std::string( "could not append to " ) + getInstance()->fileName ).c_str() );
+    perror( ( std::string( "could not append to " ) + getInstance()->filename ).c_str() );
     exit(EXIT_FAILURE);
   }
@@ -336,5 +336,5 @@
   if ( fwrite( bt.c_str(), 1, bt.length(), f ) != bt.length() )
   {
-    COUT(0) << "could not write " << bt.length() << " byte to " << getInstance()->fileName << std::endl;
+    COUT(0) << "could not write " << bt.length() << " byte to " << getInstance()->filename << std::endl;
     exit(EXIT_FAILURE);
   }
Index: code/branches/objecthierarchy/src/util/SignalHandler.h
===================================================================
--- code/branches/objecthierarchy/src/util/SignalHandler.h	(revision 2100)
+++ code/branches/objecthierarchy/src/util/SignalHandler.h	(revision 2101)
@@ -71,5 +71,5 @@
     void registerCallback( SignalCallback cb, void * someData );
 
-    void doCatch( const std::string & appName, const std::string & fileName );
+    void doCatch( const std::string & appName, const std::string & filename );
     void dontCatch();
 
@@ -85,5 +85,5 @@
 
     std::string appName;
-    std::string fileName;
+    std::string filename;
 
     // used to turn on KeyAutoRepeat if OIS crashes
@@ -97,5 +97,5 @@
   public:
     inline static SignalHandler* getInstance() { if (!SignalHandler::singletonRef) SignalHandler::singletonRef = new SignalHandler(); return SignalHandler::singletonRef; };
-    void doCatch( const std::string & appName, const std::string & fileName ) {};
+    void doCatch( const std::string & appName, const std::string & filename ) {};
     void dontCatch() {};
     void registerCallback( SignalCallback cb, void * someData ) {};
