Index: code/branches/core7/src/libraries/core/Core.cc
===================================================================
--- code/branches/core7/src/libraries/core/Core.cc	(revision 10464)
+++ code/branches/core7/src/libraries/core/Core.cc	(revision 10479)
@@ -62,6 +62,4 @@
 #include "commandline/CommandLineIncludes.h"
 #include "config/ConfigFileManager.h"
-#include "config/ConfigValueIncludes.h"
-#include "CoreIncludes.h"
 #include "DynLibManager.h"
 #include "GameMode.h"
@@ -95,7 +93,4 @@
 #endif
 
-    // register Core as an abstract class to avoid problems if the class hierarchy is created within Core-constructor
-    RegisterAbstractClass(Core).inheritsFrom<Configurable>();
-
     Core::Core(const std::string& cmdLine)
         : pathConfig_(NULL)
@@ -114,8 +109,5 @@
         , graphicsScope_(NULL)
         , bGraphicsLoaded_(false)
-        , bStartIOConsole_(true)
-        , lastLevelTimestamp_(0)
-        , ogreConfigTimestamp_(0)
-        , bDevMode_(false)
+        , config_(NULL)
         , destructionHelper_(this)
     {
@@ -188,7 +180,7 @@
         // Do this soon after the ConfigFileManager has been created to open up the
         // possibility to configure everything below here
-        RegisterObject(Core);
         orxout(internal_info) << "configuring Core" << endl;
-        this->setConfigValues();
+        this->config_ = new CoreConfig();
+        this->config_->setConfigValues(); // TODO: move this into CoreConfig constructor (but resolve dependency to Language)
 
         // Set the correct log path and rewrite the log file with the correct log levels
@@ -197,9 +189,5 @@
 #if !defined(ORXONOX_PLATFORM_APPLE) && !defined(ORXONOX_USE_WINMAIN)
         // Create persistent IO console
-        if (CommandLineParser::getValue("noIOConsole").get<bool>())
-        {
-            ModifyConfigValue(bStartIOConsole_, tset, false);
-        }
-        if (this->bStartIOConsole_)
+        if (CommandLineParser::getValue("noIOConsole").get<bool>() == false && this->config_->getStartIOConsole())
         {
             orxout(internal_info) << "creating IO console" << endl;
@@ -248,7 +236,4 @@
     {
         orxout(internal_status) << "destroying Core object..." << endl;
-
-        // Remove us from the object lists again to avoid problems when destroying them
-        this->unregisterObject();
 
         safeObjectDelete(&graphicsScope_);
@@ -261,4 +246,5 @@
         safeObjectDelete(&ioConsole_);
         safeObjectDelete(&loaderInstance_);
+        safeObjectDelete(&config_);
         safeObjectDelete(&languageInstance_);
         safeObjectDelete(&configFileManager_);
@@ -271,83 +257,4 @@
 
         orxout(internal_status) << "finished destroying Core object" << endl;
-    }
-
-    //! Function to collect the SetConfigValue-macro calls.
-    void Core::setConfigValues()
-    {
-        SetConfigValueExternal(OutputManager::getInstance().getLogWriter()->configurableMaxLevel_,
-                               OutputManager::getInstance().getLogWriter()->getConfigurableSectionName(),
-                               OutputManager::getInstance().getLogWriter()->getConfigurableMaxLevelName(),
-                               OutputManager::getInstance().getLogWriter()->configurableMaxLevel_)
-            .description("The maximum level of output shown in the log file")
-            .callback(static_cast<BaseWriter*>(OutputManager::getInstance().getLogWriter()), &BaseWriter::changedConfigurableLevel);
-        SetConfigValueExternal(OutputManager::getInstance().getLogWriter()->configurableAdditionalContextsMaxLevel_,
-                               OutputManager::getInstance().getLogWriter()->getConfigurableSectionName(),
-                               OutputManager::getInstance().getLogWriter()->getConfigurableAdditionalContextsMaxLevelName(),
-                               OutputManager::getInstance().getLogWriter()->configurableAdditionalContextsMaxLevel_)
-            .description("The maximum level of output shown in the log file for additional contexts")
-            .callback(static_cast<BaseWriter*>(OutputManager::getInstance().getLogWriter()), &BaseWriter::changedConfigurableAdditionalContextsLevel);
-        SetConfigValueExternal(OutputManager::getInstance().getLogWriter()->configurableAdditionalContexts_,
-                               OutputManager::getInstance().getLogWriter()->getConfigurableSectionName(),
-                               OutputManager::getInstance().getLogWriter()->getConfigurableAdditionalContextsName(),
-                               OutputManager::getInstance().getLogWriter()->configurableAdditionalContexts_)
-            .description("Additional output contexts shown in the log file")
-            .callback(static_cast<BaseWriter*>(OutputManager::getInstance().getLogWriter()), &BaseWriter::changedConfigurableAdditionalContexts);
-
-        SetConfigValue(bDevMode_, PathConfig::buildDirectoryRun())
-            .description("Developer mode. If not set, hides some things from the user to not confuse him.")
-            .callback(this, &Core::devModeChanged);
-        SetConfigValue(language_, Language::getInstance().defaultLanguage_)
-            .description("The language of the in game text")
-            .callback(this, &Core::languageChanged);
-        SetConfigValue(bInitRandomNumberGenerator_, true)
-            .description("If true, all random actions are different each time you start the game")
-            .callback(this, &Core::initRandomNumberGenerator);
-        SetConfigValue(bStartIOConsole_, true)
-            .description("Set to false if you don't want to use the IOConsole (for Lua debugging for instance)");
-        SetConfigValue(lastLevelTimestamp_, 0)
-            .description("Timestamp when the last level was started.");
-        SetConfigValue(ogreConfigTimestamp_, 0)
-            .description("Timestamp when the ogre config file was changed.");
-    }
-
-    /** Callback function for changes in the dev mode that affect debug levels.
-        The function behaves according to these rules:
-        - 'normal' mode is defined based on where the program was launched: if
-          the launch path was the build directory, development mode \c on is
-          normal, otherwise normal means development mode \c off.
-        - Debug levels should not be hard configured (\c config instead of
-          \c tconfig) in non 'normal' mode to avoid strange behaviour.
-        - Changing the development mode from 'normal' to the other state will
-          immediately change the debug levels to predefined values which can be
-          reconfigured with \c tconfig.
-    @note
-        The debug levels for the IOConsole and the InGameConsole can be found
-        in the Shell class. The same rules apply.
-    */
-    void Core::devModeChanged()
-    {
-        // Inform listeners
-        ObjectList<DevModeListener>::iterator it = ObjectList<DevModeListener>::begin();
-        for (; it != ObjectList<DevModeListener>::end(); ++it)
-            it->devModeChanged(bDevMode_);
-    }
-
-    //! Callback function if the language has changed.
-    void Core::languageChanged()
-    {
-        // Read the translation file after the language was configured
-        Language::getInstance().readTranslatedLanguageFile();
-    }
-
-    void Core::initRandomNumberGenerator()
-    {
-        static bool bInitialized = false;
-        if (!bInitialized && this->bInitRandomNumberGenerator_)
-        {
-            srand(static_cast<unsigned int>(time(0)));
-            rand();
-            bInitialized = true;
-        }
     }
 
@@ -429,10 +336,4 @@
     }
 
-    //! Sets the language in the config-file back to the default.
-    void Core::resetLanguage()
-    {
-        ResetConfigValue(language_);
-    }
-
     /**
     @note
@@ -511,21 +412,3 @@
         }
     }
-
-    void Core::updateLastLevelTimestamp()
-    {
-        ModifyConfigValue(lastLevelTimestamp_, set, static_cast<long long>(time(NULL)));
-    }
-
-    void Core::updateOgreConfigTimestamp()
-    {
-        ModifyConfigValue(ogreConfigTimestamp_, set, static_cast<long long>(time(NULL)));
-    }
-
-
-    RegisterAbstractClass(DevModeListener).inheritsFrom<Listable>();
-
-    DevModeListener::DevModeListener()
-    {
-        RegisterObject(DevModeListener);
-    }
 }
