Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 12, 2009, 11:58:01 PM (15 years ago)
Author:
rgrieder
Message:

Merged most of the core4 revisions back to the trunk except for:

  • orxonox_cast
  • all the radical changes in the input library
Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/core/Core.cc

    r3214 r3280  
    7777namespace orxonox
    7878{
    79     //! Path to the parent directory of the ones above if program was installed with relativ pahts
    80     static boost::filesystem::path rootPath_g;
    81     static boost::filesystem::path executablePath_g;            //!< Path to the executable
    82     static boost::filesystem::path mediaPath_g;                 //!< Path to the media file folder
    83     static boost::filesystem::path configPath_g;                //!< Path to the config file folder
    84     static boost::filesystem::path logPath_g;                   //!< Path to the log file folder
    85 
    8679    //! Static pointer to the singleton
    8780    Core* Core::singletonRef_s  = 0;
    8881
    89     SetCommandLineArgument(mediaPath, "").information("PATH");
    90     SetCommandLineArgument(writingPathSuffix, "").information("DIR");
    91     SetCommandLineArgument(settingsFile, "orxonox.ini");
    92     SetCommandLineArgument(limitToCPU, 0).information("0: off | #cpu");
    93 
    94     Core::Core()
    95     {
    96         RegisterRootObject(Core);
    97 
    98         assert(Core::singletonRef_s == 0);
     82    SetCommandLineArgument(mediaPath, "").information("Path to the media/data files");
     83    SetCommandLineOnlyArgument(writingPathSuffix, "").information("Additional subfolder for config and log files");
     84    SetCommandLineArgument(settingsFile, "orxonox.ini").information("THE configuration file");
     85#ifdef ORXONOX_PLATFORM_WINDOWS
     86    SetCommandLineArgument(limitToCPU, 0).information("Limits the program to one cpu/core (1, 2, 3, etc.). 0 turns it off (default)");
     87#endif
     88
     89    /**
     90    @brief
     91        Helper class for the Core singleton: we cannot derive
     92        Core from OrxonoxClass because we need to handle the Identifier
     93        destruction in the Core destructor.
     94    */
     95    class CoreConfiguration : public OrxonoxClass
     96    {
     97    public:
     98        CoreConfiguration()
     99        {
     100        }
     101
     102        void initialise()
     103        {
     104            RegisterRootObject(CoreConfiguration);
     105            this->setConfigValues();
     106
     107            // Possible media path override by the command line
     108            if (!CommandLine::getArgument("mediaPath")->hasDefaultValue())
     109                tsetMediaPath(CommandLine::getValue("mediaPath"));
     110        }
     111
     112        /**
     113            @brief Function to collect the SetConfigValue-macro calls.
     114        */
     115        void setConfigValues()
     116        {
     117#ifdef NDEBUG
     118            const unsigned int defaultLevelConsole = 1;
     119            const unsigned int defaultLevelLogfile = 3;
     120            const unsigned int defaultLevelShell   = 1;
     121#else
     122            const unsigned int defaultLevelConsole = 3;
     123            const unsigned int defaultLevelLogfile = 4;
     124            const unsigned int defaultLevelShell   = 3;
     125#endif
     126            SetConfigValue(softDebugLevelConsole_, defaultLevelConsole)
     127                .description("The maximal level of debug output shown in the console")
     128                .callback(this, &CoreConfiguration::debugLevelChanged);
     129            SetConfigValue(softDebugLevelLogfile_, defaultLevelLogfile)
     130                .description("The maximal level of debug output shown in the logfile")
     131                .callback(this, &CoreConfiguration::debugLevelChanged);
     132            SetConfigValue(softDebugLevelShell_, defaultLevelShell)
     133                .description("The maximal level of debug output shown in the ingame shell")
     134                .callback(this, &CoreConfiguration::debugLevelChanged);
     135
     136            SetConfigValue(language_, Language::getLanguage().defaultLanguage_)
     137                .description("The language of the ingame text")
     138                .callback(this, &CoreConfiguration::languageChanged);
     139            SetConfigValue(bInitializeRandomNumberGenerator_, true)
     140                .description("If true, all random actions are different each time you start the game")
     141                .callback(this, &CoreConfiguration::initializeRandomNumberGenerator);
     142
     143            SetConfigValue(mediaPathString_, mediaPath_.string())
     144                .description("Relative path to the game data.")
     145                .callback(this, &CoreConfiguration::mediaPathChanged);
     146        }
     147
     148        /**
     149            @brief Callback function if the debug level has changed.
     150        */
     151        void debugLevelChanged()
     152        {
     153            // softDebugLevel_ is the maximum of the 3 variables
     154            this->softDebugLevel_ = this->softDebugLevelConsole_;
     155            if (this->softDebugLevelLogfile_ > this->softDebugLevel_)
     156                this->softDebugLevel_ = this->softDebugLevelLogfile_;
     157            if (this->softDebugLevelShell_ > this->softDebugLevel_)
     158                this->softDebugLevel_ = this->softDebugLevelShell_;
     159
     160            OutputHandler::setSoftDebugLevel(OutputHandler::LD_All,     this->softDebugLevel_);
     161            OutputHandler::setSoftDebugLevel(OutputHandler::LD_Console, this->softDebugLevelConsole_);
     162            OutputHandler::setSoftDebugLevel(OutputHandler::LD_Logfile, this->softDebugLevelLogfile_);
     163            OutputHandler::setSoftDebugLevel(OutputHandler::LD_Shell,   this->softDebugLevelShell_);
     164        }
     165
     166        /**
     167            @brief Callback function if the language has changed.
     168        */
     169        void languageChanged()
     170        {
     171            // Read the translation file after the language was configured
     172            Language::getLanguage().readTranslatedLanguageFile();
     173        }
     174
     175        /**
     176        @brief
     177            Callback function if the media path has changed.
     178        */
     179        void mediaPathChanged()
     180        {
     181            mediaPath_ = boost::filesystem::path(this->mediaPathString_);
     182        }
     183
     184        /**
     185            @brief Sets the language in the config-file back to the default.
     186        */
     187        void resetLanguage()
     188        {
     189            ResetConfigValue(language_);
     190        }
     191
     192        /**
     193        @brief
     194            Temporary sets the media path
     195        @param path
     196            The new media path
     197        */
     198        void tsetMediaPath(const std::string& path)
     199        {
     200            ModifyConfigValue(mediaPathString_, tset, path);
     201        }
     202
     203        void initializeRandomNumberGenerator()
     204        {
     205            static bool bInitialized = false;
     206            if (!bInitialized && this->bInitializeRandomNumberGenerator_)
     207            {
     208                srand(static_cast<unsigned int>(time(0)));
     209                rand();
     210                bInitialized = true;
     211            }
     212        }
     213
     214        int softDebugLevel_;                            //!< The debug level
     215        int softDebugLevelConsole_;                     //!< The debug level for the console
     216        int softDebugLevelLogfile_;                     //!< The debug level for the logfile
     217        int softDebugLevelShell_;                       //!< The debug level for the ingame shell
     218        std::string language_;                          //!< The language
     219        bool bInitializeRandomNumberGenerator_;         //!< If true, srand(time(0)) is called
     220        std::string mediaPathString_;                   //!< Path to the data/media file folder as string
     221
     222        //! Path to the parent directory of the ones above if program was installed with relativ pahts
     223        boost::filesystem::path rootPath_;
     224        boost::filesystem::path executablePath_;        //!< Path to the executable
     225        boost::filesystem::path mediaPath_;             //!< Path to the media file folder
     226        boost::filesystem::path configPath_;            //!< Path to the config file folder
     227        boost::filesystem::path logPath_;               //!< Path to the log file folder
     228    };
     229
     230
     231    Core::Core(int argc, char** argv)
     232    {
     233        if (singletonRef_s != 0)
     234        {
     235            COUT(0) << "Error: The Core singleton cannot be recreated! Shutting down." << std::endl;
     236            abort();
     237        }
    99238        Core::singletonRef_s = this;
    100     }
    101 
    102     void Core::initialise(int argc, char** argv)
    103     {
    104         // Parse command line arguments fist
    105         try
    106         {
    107             CommandLine::parseAll(argc, argv);
    108         }
    109         catch (ArgumentException& ex)
    110         {
    111             COUT(1) << ex.what() << std::endl;
    112             COUT(0) << "Usage:" << std::endl << "orxonox " << CommandLine::getUsageInformation() << std::endl;
    113         }
    114 
     239
     240        // We need the variables very soon. But don't configure them yet!
     241        this->configuration_ = new CoreConfiguration();
     242
     243        // Parse command line arguments first
     244        CommandLine::parseCommandLine(argc, argv);
     245
     246        // Determine and set the location of the executable
     247        setExecutablePath();
     248
     249        // Determine whether we have an installed or a binary dir run
     250        // The latter occurs when simply running from the build directory
     251        checkDevBuild();
     252
     253        // Make sure the directories we write in exist or else make them
     254        createDirectories();
     255
     256        // create a signal handler (only active for linux)
     257        // This call is placed as soon as possible, but after the directories are set
     258        this->signalHandler_ = new SignalHandler();
     259        this->signalHandler_->doCatch(configuration_->executablePath_.string(), Core::getLogPathString() + "orxonox_crash.log");
     260
     261        // Set the correct log path. Before this call, /tmp (Unix) or %TEMP% was used
     262        OutputHandler::getOutStream().setLogPath(Core::getLogPathString());
     263
     264        // Parse additional options file now that we know its path
     265        CommandLine::parseFile();
     266
     267#ifdef ORXONOX_PLATFORM_WINDOWS
    115268        // limit the main thread to the first core so that QueryPerformanceCounter doesn't jump
    116269        // do this after ogre has initialised. Somehow Ogre changes the settings again (not through
     
    118271        int limitToCPU = CommandLine::getValue("limitToCPU");
    119272        if (limitToCPU > 0)
    120             setThreadAffinity((unsigned int)limitToCPU);
    121 
    122         // Determine and set the location of the executable
    123         setExecutablePath();
    124 
    125         // Determine whether we have an installed or a binary dir run
    126         // The latter occurs when simply running from the build directory
    127         checkDevBuild();
    128 
    129         // Make sure the directories we write in exist or else make them
    130         createDirectories();
    131 
    132         // create a signal handler (only active for linux)
    133         // This call is placed as soon as possible, but after the directories are set
    134         this->signalHandler_ = new SignalHandler();
    135         this->signalHandler_->doCatch(executablePath_g.string(), Core::getLogPathString() + "orxonox_crash.log");
    136 
    137         // Set the correct log path. Before this call, /tmp (Unix) or %TEMP% was used
    138         OutputHandler::getOutStream().setLogPath(Core::getLogPathString());
     273            setThreadAffinity(static_cast<unsigned int>(limitToCPU));
     274#endif
    139275
    140276        // Manage ini files and set the default settings file (usually orxonox.ini)
     
    143279            CommandLine::getValue("settingsFile").getString());
    144280
     281        // Required as well for the config values
    145282        this->languageInstance_ = new Language();
    146283
    147284        // Do this soon after the ConfigFileManager has been created to open up the
    148285        // possibility to configure everything below here
    149         this->setConfigValues();
    150 
    151         // Possible media path override by the command line
    152         if (!CommandLine::getArgument("mediaPath")->hasDefaultValue())
    153         {
    154             //std::string mediaPath = CommandLine::getValue("mediaPath");
    155             Core::tsetMediaPath(CommandLine::getValue("mediaPath"));
    156         }
     286        this->configuration_->initialise();
    157287
    158288        // Create the lua interface
     
    168298        // creates the class hierarchy for all classes with factories
    169299        Factory::createClassHierarchy();
    170        
    171         this->loaded_ = true;
    172300    }
    173301
     
    177305    Core::~Core()
    178306    {
    179         this->loaded_ = false;
    180 
    181307        delete this->shell_;
    182308        delete this->tclThreadManager_;
    183309        delete this->tclBind_;
    184310        delete this->luaBind_;
     311        delete this->configuration_;
    185312        delete this->languageInstance_;
    186313        delete this->configFileManager_;
     
    190317        // Also delete external console command that don't belong to an Identifier
    191318        CommandExecutor::destroyExternalCommands();
    192 
    193         assert(Core::singletonRef_s);
    194         Core::singletonRef_s = 0;
     319        // Clean up class hierarchy stuff (identifiers, XMLPort, configValues, consoleCommand)
     320        Identifier::destroyAllIdentifiers();
     321
    195322        delete this->signalHandler_;
    196     }
    197 
    198     /**
    199         @brief Function to collect the SetConfigValue-macro calls.
    200     */
    201     void Core::setConfigValues()
    202     {
    203 #ifdef NDEBUG
    204         const unsigned int defaultLevelConsole = 1;
    205         const unsigned int defaultLevelLogfile = 3;
    206         const unsigned int defaultLevelShell   = 1;
    207 #else
    208         const unsigned int defaultLevelConsole = 3;
    209         const unsigned int defaultLevelLogfile = 4;
    210         const unsigned int defaultLevelShell   = 3;
    211 #endif
    212         SetConfigValue(softDebugLevelConsole_, defaultLevelConsole)
    213             .description("The maximal level of debug output shown in the console").callback(this, &Core::debugLevelChanged);
    214         SetConfigValue(softDebugLevelLogfile_, defaultLevelLogfile)
    215             .description("The maximal level of debug output shown in the logfile").callback(this, &Core::debugLevelChanged);
    216         SetConfigValue(softDebugLevelShell_, defaultLevelShell)
    217             .description("The maximal level of debug output shown in the ingame shell").callback(this, &Core::debugLevelChanged);
    218 
    219         SetConfigValue(language_, Language::getLanguage().defaultLanguage_).description("The language of the ingame text").callback(this, &Core::languageChanged);
    220         SetConfigValue(bInitializeRandomNumberGenerator_, true).description("If true, all random actions are different each time you start the game").callback(this, &Core::initializeRandomNumberGenerator);
    221 
    222         SetConfigValue(mediaPathString_, mediaPath_g.string())
    223             .description("Relative path to the game data.").callback(this, &Core::mediaPathChanged);
    224     }
    225 
    226     /**
    227         @brief Callback function if the debug level has changed.
    228     */
    229     void Core::debugLevelChanged()
    230     {
    231         // softDebugLevel_ is the maximum of the 3 variables
    232         this->softDebugLevel_ = this->softDebugLevelConsole_;
    233         if (this->softDebugLevelLogfile_ > this->softDebugLevel_)
    234             this->softDebugLevel_ = this->softDebugLevelLogfile_;
    235         if (this->softDebugLevelShell_ > this->softDebugLevel_)
    236             this->softDebugLevel_ = this->softDebugLevelShell_;
    237 
    238         OutputHandler::setSoftDebugLevel(OutputHandler::LD_All,     this->softDebugLevel_);
    239         OutputHandler::setSoftDebugLevel(OutputHandler::LD_Console, this->softDebugLevelConsole_);
    240         OutputHandler::setSoftDebugLevel(OutputHandler::LD_Logfile, this->softDebugLevelLogfile_);
    241         OutputHandler::setSoftDebugLevel(OutputHandler::LD_Shell,   this->softDebugLevelShell_);
    242     }
    243 
    244     /**
    245         @brief Callback function if the language has changed.
    246     */
    247     void Core::languageChanged()
    248     {
    249         // Read the translation file after the language was configured
    250         Language::getLanguage().readTranslatedLanguageFile();
    251     }
    252 
    253     /**
    254     @brief
    255         Callback function if the media path has changed.
    256     */
    257     void Core::mediaPathChanged()
    258     {
    259         mediaPath_g = boost::filesystem::path(this->mediaPathString_);
    260     }
    261 
    262     /**
    263         @brief Returns the softDebugLevel for the given device (returns a default-value if the class ist right about to be created).
     323
     324        // Don't assign singletonRef_s with NULL! Recreation is not supported
     325    }
     326
     327    /**
     328        @brief Returns the softDebugLevel for the given device (returns a default-value if the class is right about to be created).
    264329        @param device The device
    265330        @return The softDebugLevel
    266331    */
    267     int Core::getSoftDebugLevel(OutputHandler::OutputDevice device)
     332    /*static*/ int Core::getSoftDebugLevel(OutputHandler::OutputDevice device)
    268333    {
    269334        switch (device)
    270335        {
    271336        case OutputHandler::LD_All:
    272             return Core::getInstance().softDebugLevel_;
     337            return Core::getInstance().configuration_->softDebugLevel_;
    273338        case OutputHandler::LD_Console:
    274             return Core::getInstance().softDebugLevelConsole_;
     339            return Core::getInstance().configuration_->softDebugLevelConsole_;
    275340        case OutputHandler::LD_Logfile:
    276             return Core::getInstance().softDebugLevelLogfile_;
     341            return Core::getInstance().configuration_->softDebugLevelLogfile_;
    277342        case OutputHandler::LD_Shell:
    278             return Core::getInstance().softDebugLevelShell_;
     343            return Core::getInstance().configuration_->softDebugLevelShell_;
    279344        default:
    280345            assert(0);
     
    288353        @param level The level
    289354    */
    290     void Core::setSoftDebugLevel(OutputHandler::OutputDevice device, int level)
    291      {
     355    /*static*/ void Core::setSoftDebugLevel(OutputHandler::OutputDevice device, int level)
     356    {
    292357        if (device == OutputHandler::LD_All)
    293             Core::getInstance().softDebugLevel_ = level;
     358            Core::getInstance().configuration_->softDebugLevel_ = level;
    294359        else if (device == OutputHandler::LD_Console)
    295             Core::getInstance().softDebugLevelConsole_ = level;
     360            Core::getInstance().configuration_->softDebugLevelConsole_ = level;
    296361        else if (device == OutputHandler::LD_Logfile)
    297             Core::getInstance().softDebugLevelLogfile_ = level;
     362            Core::getInstance().configuration_->softDebugLevelLogfile_ = level;
    298363        else if (device == OutputHandler::LD_Shell)
    299             Core::getInstance().softDebugLevelShell_ = level;
     364            Core::getInstance().configuration_->softDebugLevelShell_ = level;
    300365
    301366        OutputHandler::setSoftDebugLevel(device, level);
    302      }
     367    }
    303368
    304369    /**
    305370        @brief Returns the configured language.
    306371    */
    307     const std::string& Core::getLanguage()
    308     {
    309         return Core::getInstance().language_;
     372    /*static*/ const std::string& Core::getLanguage()
     373    {
     374        return Core::getInstance().configuration_->language_;
    310375    }
    311376
     
    313378        @brief Sets the language in the config-file back to the default.
    314379    */
    315     void Core::resetLanguage()
    316     {
    317         Core::getInstance().resetLanguageIntern();
    318     }
    319 
    320     /**
    321         @brief Sets the language in the config-file back to the default.
    322     */
    323     void Core::resetLanguageIntern()
    324     {
    325         ResetConfigValue(language_);
    326     }
    327 
    328     /**
    329     @brief
    330         Temporary sets the media path
    331     @param path
    332         The new media path
    333     */
    334     void Core::_tsetMediaPath(const std::string& path)
    335     {
    336         ModifyConfigValue(mediaPathString_, tset, path);
     380    /*static*/ void Core::resetLanguage()
     381    {
     382        Core::getInstance().configuration_->resetLanguage();
     383    }
     384
     385    /*static*/ void Core::tsetMediaPath(const std::string& path)
     386    {
     387        getInstance().configuration_->tsetMediaPath(path);
    337388    }
    338389
    339390    /*static*/ const boost::filesystem::path& Core::getMediaPath()
    340391    {
    341         return mediaPath_g;
     392        return getInstance().configuration_->mediaPath_;
    342393    }
    343394    /*static*/ std::string Core::getMediaPathString()
    344395    {
    345         return mediaPath_g.string() + '/';
     396        return getInstance().configuration_->mediaPath_.string() + '/';
    346397    }
    347398
    348399    /*static*/ const boost::filesystem::path& Core::getConfigPath()
    349400    {
    350         return configPath_g;
     401        return getInstance().configuration_->configPath_;
    351402    }
    352403    /*static*/ std::string Core::getConfigPathString()
    353404    {
    354         return configPath_g.string() + '/';
     405        return getInstance().configuration_->configPath_.string() + '/';
    355406    }
    356407
    357408    /*static*/ const boost::filesystem::path& Core::getLogPath()
    358409    {
    359         return logPath_g;
     410        return getInstance().configuration_->logPath_;
    360411    }
    361412    /*static*/ std::string Core::getLogPathString()
    362413    {
    363         return logPath_g.string() + '/';
    364     }
    365 
    366     void Core::initializeRandomNumberGenerator()
    367     {
    368         static bool bInitialized = false;
    369         if (!bInitialized && this->bInitializeRandomNumberGenerator_)
    370         {
    371             srand(static_cast<unsigned int>(time(0)));
    372             rand();
    373             bInitialized = true;
    374         }
    375     }
    376 
     414        return getInstance().configuration_->logPath_.string() + '/';
     415    }
    377416
    378417    /**
     
    388427    void Core::setThreadAffinity(int limitToCPU)
    389428    {
     429#ifdef ORXONOX_PLATFORM_WINDOWS
     430
    390431        if (limitToCPU <= 0)
    391432            return;
    392433
    393 #ifdef ORXONOX_PLATFORM_WINDOWS
    394434        unsigned int coreNr = limitToCPU - 1;
    395435        // Get the current process core mask
     
    465505#endif
    466506
    467         executablePath_g = boost::filesystem::path(buffer);
     507        configuration_->executablePath_ = boost::filesystem::path(buffer);
    468508#ifndef ORXONOX_PLATFORM_APPLE
    469         executablePath_g = executablePath_g.branch_path(); // remove executable name
     509        configuration_->executablePath_ = configuration_->executablePath_.branch_path(); // remove executable name
    470510#endif
    471511    }
     
    481521    void Core::checkDevBuild()
    482522    {
    483         if (boost::filesystem::exists(executablePath_g / "orxonox_dev_build.keep_me"))
     523        if (boost::filesystem::exists(configuration_->executablePath_ / "orxonox_dev_build.keep_me"))
    484524        {
    485525            COUT(1) << "Running from the build tree." << std::endl;
    486526            Core::isDevBuild_ = true;
    487             mediaPath_g  = ORXONOX_MEDIA_DEV_PATH;
    488             configPath_g = ORXONOX_CONFIG_DEV_PATH;
    489             logPath_g    = ORXONOX_LOG_DEV_PATH;
     527            configuration_->mediaPath_  = ORXONOX_MEDIA_DEV_PATH;
     528            configuration_->configPath_ = ORXONOX_CONFIG_DEV_PATH;
     529            configuration_->logPath_    = ORXONOX_LOG_DEV_PATH;
    490530        }
    491531        else
     
    494534            // Also set the root path
    495535            boost::filesystem::path relativeExecutablePath(ORXONOX_RUNTIME_INSTALL_PATH);
    496             rootPath_g = executablePath_g;
    497             while (!boost::filesystem::equivalent(rootPath_g / relativeExecutablePath, executablePath_g) && !rootPath_g.empty())
    498                 rootPath_g = rootPath_g.branch_path();
    499             if (rootPath_g.empty())
     536            configuration_->rootPath_ = configuration_->executablePath_;
     537            while (!boost::filesystem::equivalent(configuration_->rootPath_ / relativeExecutablePath, configuration_->executablePath_)
     538                   && !configuration_->rootPath_.empty())
     539                configuration_->rootPath_ = configuration_->rootPath_.branch_path();
     540            if (configuration_->rootPath_.empty())
    500541                ThrowException(General, "Could not derive a root directory. Might the binary installation directory contain '..' when taken relative to the installation prefix path?");
    501542
    502543            // Using paths relative to the install prefix, complete them
    503             mediaPath_g  = rootPath_g / ORXONOX_MEDIA_INSTALL_PATH;
    504             configPath_g = rootPath_g / ORXONOX_CONFIG_INSTALL_PATH;
    505             logPath_g    = rootPath_g / ORXONOX_LOG_INSTALL_PATH;
     544            configuration_->mediaPath_  = configuration_->rootPath_ / ORXONOX_MEDIA_INSTALL_PATH;
     545            configuration_->configPath_ = configuration_->rootPath_ / ORXONOX_CONFIG_INSTALL_PATH;
     546            configuration_->logPath_    = configuration_->rootPath_ / ORXONOX_LOG_INSTALL_PATH;
    506547#else
    507548            // There is no root path, so don't set it at all
    508549
    509             mediaPath_g  = ORXONOX_MEDIA_INSTALL_PATH;
     550            configuration_->mediaPath_  = ORXONOX_MEDIA_INSTALL_PATH;
    510551
    511552            // Get user directory
     
    520561            userDataPath /= ".orxonox";
    521562
    522             configPath_g = userDataPath / ORXONOX_CONFIG_INSTALL_PATH;
    523             logPath_g    = userDataPath / ORXONOX_LOG_INSTALL_PATH;
     563            configuration_->configPath_ = userDataPath / ORXONOX_CONFIG_INSTALL_PATH;
     564            configuration_->logPath_    = userDataPath / ORXONOX_LOG_INSTALL_PATH;
    524565#endif
    525566        }
     
    529570        {
    530571            std::string directory(CommandLine::getValue("writingPathSuffix").getString());
    531             configPath_g = configPath_g / directory;
    532             logPath_g    = logPath_g    / directory;
     572            configuration_->configPath_ = configuration_->configPath_ / directory;
     573            configuration_->logPath_    = configuration_->logPath_    / directory;
    533574        }
    534575    }
     
    544585    {
    545586        std::vector<std::pair<boost::filesystem::path, std::string> > directories;
    546         directories.push_back(std::make_pair(boost::filesystem::path(configPath_g), "config"));
    547         directories.push_back(std::make_pair(boost::filesystem::path(logPath_g), "log"));
     587        directories.push_back(std::make_pair(boost::filesystem::path(configuration_->configPath_), "config"));
     588        directories.push_back(std::make_pair(boost::filesystem::path(configuration_->logPath_), "log"));
    548589
    549590        for (std::vector<std::pair<boost::filesystem::path, std::string> >::iterator it = directories.begin();
Note: See TracChangeset for help on using the changeset viewer.