Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2690


Ignore:
Timestamp:
Feb 23, 2009, 8:57:42 PM (15 years ago)
Author:
rgrieder
Message:
  • Moved def_keybindings to media repository in folder defaultConfig
  • If you have a better name for that folder, you're welcome
  • the "def_" prefix has been removed
  • ConfigFileManager now looks for a file in media/defaultConfig with the same name if the config file does not exist yet
  • No file gets written while only loading
  • Removed hacky GCC 3 warning code for each library and instead just put "Wno-sign-compare" to the GCC 3 flags (that will remove all boost::filesystem warnings)
  • ogre.cfg still remains on tardis for the development build (not install though)
Location:
code/branches/buildsystem3
Files:
2 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem3/cmake/BuildConfigGCC.cmake

    r2673 r2690  
    5656ENDIF()
    5757
     58# For GCC older than version 4, do not display sign compare warings
     59# because of boost::filesystem (which creates about a hundred per include)
     60ADD_COMPILER_FLAGS("-Wno-sign-compare" GCC_NO_SYSTEM_HEADER_SUPPORT CACHE)
     61
    5862# Increase warning level if requested
    5963IF(EXTRA_COMPILER_WARNINGS)
  • code/branches/buildsystem3/config/CMakeLists.txt

    r2685 r2690  
    2020SET(ORXONOX_CONFIG_DEV_PATH ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
    2121
    22 SET(READ_ONLY_CONFIG_FILES
    23   def_keybindings.ini
    24   def_masterKeybindings.ini
    25 )
    26 
    27 SET(WRITABLE_CONFIG_FILES
    28 )
    29 
    3022IF(TARDIS)
    3123  # OGRE can't find fonts to display config screen on Tardis,
    3224  # so providing default config file here (bug).
    33   LIST(APPEND WRITABLE_CONFIG_FILES ogre.cfg)
     25  # Cause: Ogre 1.4.5 was compiled for an older debian version
     26  IF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ogre.cfg)
     27    CONFIGURE_FILE(ogre.cfg ${CMAKE_CURRENT_BINARY_DIR}/ogre.cfg COPYONLY)
     28  ENDIF()
    3429ENDIF(TARDIS)
    35 
    36 # We need the same code for both READ_ONLY and WRITABLE config files
    37 MACRO(CONFIGURE_FILES _file_name _build_configs _read_only_arg)
    38   SET(_read_only ${_read_only_arg})
    39   FOREACH(_build_config ${_build_configs})
    40     # Is there an extra file in bin/Debug or bin/Release?
    41     IF(${_build_config} MATCHES "Rel")
    42       SET(_build_config_short "Release")
    43     ELSE()
    44       SET(_build_config_short "Debug")
    45     ENDIF()
    46     IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_build_config_short}/${_file_name})
    47       SET(_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${_build_config_short}/${_file_name})
    48     ELSE()
    49       SET(_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${_file_name})
    50     ENDIF()
    51 
    52     # Copy to the folder named like the build config for Visual Studio
    53     IF(CMAKE_CONFIGURATION_TYPES)
    54       SET(_out_file ${CMAKE_CURRENT_BINARY_DIR}/${_build_config}/${_file_name})
    55     ELSE()
    56       SET(_out_file ${CMAKE_CURRENT_BINARY_DIR}/${_file_name})
    57     ENDIF()
    58     # Only copy if target file doesn't exist. This may result in problems but
    59     # otherwise we might delete a user's config
    60     IF(NOT EXISTS ${_out_file} OR _read_only)
    61       CONFIGURE_FILE(${_in_file} ${_out_file} @ONLY)
    62     ENDIF()
    63   ENDFOREACH(_build_config)
    64 ENDMACRO(CONFIGURE_FILES)
    65 
    66 # Copy config files to all Visual Studio output directories
    67 IF(CMAKE_CONFIGURATION_TYPES)
    68   SET(BUILD_CONFIGS ${CMAKE_CONFIGURATION_TYPES})
    69 ELSE()
    70   SET(BUILD_CONFIGS ${CMAKE_BUILD_TYPE})
    71 ENDIF()
    72 
    73 FOREACH(_file_name ${READ_ONLY_CONFIG_FILES})
    74   CONFIGURE_FILES("${_file_name}" "${BUILD_CONFIGS}" TRUE)
    75 ENDFOREACH(_file_name)
    76 FOREACH(_file_name ${WRITABLE_CONFIG_FILES})
    77   CONFIGURE_FILES("${_file_name}" "${BUILD_CONFIGS}" FALSE)
    78 ENDFOREACH(_file_name)
    79 
    80 
    81 ################ Installation #################
    82 
    83 # Not using collective call to allow configuration with CMake.
    84 FOREACH(_file ${READ_ONLY_CONFIG_FILES} ${WRITABLE_CONFIG_FILES})
    85   IF(CMAKE_CONFIGURATION_TYPES)
    86     FOREACH(_configuration ${CMAKE_CONFIGURATION_TYPES})
    87       INSTALL(
    88         FILES ${CMAKE_CURRENT_BINARY_DIR}/${_configuration}/${_file}
    89         DESTINATION ${ORXONOX_CONFIG_INSTALL_PATH}
    90         CONFIGURATIONS ${_configuration}
    91       )
    92     ENDFOREACH(_configuration)
    93   ELSE()
    94     INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_file} DESTINATION ${ORXONOX_CONFIG_INSTALL_PATH})
    95   ENDIF()
    96 ENDFOREACH(_file)
  • code/branches/buildsystem3/log/CMakeLists.txt

    r2685 r2690  
    1919 
    2020SET(ORXONOX_LOG_DEV_PATH ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
    21 
    22 # Create some directories for the logs or CEGUI crashes when setting up the log
    23 IF(CMAKE_CONFIGURATION_TYPES)
    24   FOREACH(_configuration ${CMAKE_CONFIGURATION_TYPES})
    25     FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_configuration})
    26   ENDFOREACH(_configuration)
    27 ENDIF()
    28 
    29 # Also create the folder when installing
    30 INSTALL(CODE "FILE(MAKE_DIRECTORY \"${ORXONOX_LOG_INSTALL_PATH}\")")
  • code/branches/buildsystem3/src/CMakeLists.txt

    r2685 r2690  
    6969# which one we have to define the macros separately for each configuration
    7070ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Debug"          Debug)
    71 ADD_COMPILER_FLAGS("-DCMAKE_BIULD_TYPE=Release"        Release)
     71ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Release"        Release)
    7272ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=RelWithDebInfo" RelWithDebInfo)
    7373ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=MinSizeRel"     MinSizeRel)
  • code/branches/buildsystem3/src/core/CMakeLists.txt

    r2685 r2690  
    6868GENERATE_TOLUA_BINDINGS(Core CORE_FILES INPUTFILES LuaBind.h CommandExecutor.h)
    6969
    70 IF(GCC_NO_SYSTEM_HEADER_SUPPORT)
    71   # Get around displaying a few hundred lines of warning code
    72   SET_SOURCE_FILES_PROPERTIES(
    73     ArgumentCompletionFunctions.cc
    74     CommandLine.cc
    75     ConfigFileManager.cc
    76     Language.cc
    77     LuaBind.cc
    78     input/KeyBinder.cc
    79     PROPERTIES COMPILE_FLAGS "-Wno-sign-compare")
    80 ENDIF()
    81 
    8270ADD_LIBRARY(core SHARED ${CORE_FILES})
    8371
  • code/branches/buildsystem3/src/core/ConfigFileManager.cc

    r2687 r2690  
    223223    void ConfigFile::load(bool bCreateIfNotExisting)
    224224    {
    225         // Be sure we start from new
     225        // Be sure we start from new in the memory
    226226        this->clear();
    227227
    228         boost::filesystem::path filepath(Core::getConfigPath() + "/" + this->filename_);
    229 
    230         // This creates the config file if it's not existing
    231         std::ofstream createFile;
    232         createFile.open(filepath.file_string().c_str(), std::fstream::app);
    233         createFile.close();
     228        // Get default file if necessary and available
     229        boost::filesystem::path filepath(Core::getConfigPath());
     230        filepath /= this->filename_;
     231        if (!boost::filesystem::exists(filepath))
     232        {
     233            // Try to get default one from the media folder
     234            boost::filesystem::path defaultFilepath(Core::getMediaPath());
     235            defaultFilepath = defaultFilepath / "defaultConfig" / this->filename_;
     236            if (boost::filesystem::exists(defaultFilepath))
     237            {
     238                boost::filesystem::copy_file(defaultFilepath, filepath);
     239            }
     240        }
    234241
    235242        // Open the file
    236243        std::ifstream file;
    237244        file.open(filepath.file_string().c_str(), std::fstream::in);
    238 
    239         if (!file.is_open())
    240         {
    241             COUT(1) << "An error occurred in ConfigFileManager.cc:" << std::endl;
    242             COUT(1) << "Error: Couldn't open config-file \"" << this->filename_ << "\"." << std::endl;
    243             return;
    244         }
    245 
    246         char linearray[CONFIG_FILE_MAX_LINELENGHT];
    247 
    248         ConfigFileSection* newsection = 0;
    249 
    250         while (file.good() && !file.eof())
    251         {
    252             file.getline(linearray, CONFIG_FILE_MAX_LINELENGHT);
    253 
    254             std::string line = std::string(linearray);
    255 
    256             std::string temp = getStripped(line);
    257             if (!isEmpty(temp) && !isComment(temp))
    258             {
    259                 size_t   pos1 = temp.find('[');
    260                 if (pos1 == 0) pos1 = line.find('['); else pos1 = std::string::npos;
    261                 size_t   pos2 = line.find(']');
    262 
    263                 if (pos1 != std::string::npos && pos2 != std::string::npos && pos2 > pos1 + 1)
     245        if (file.is_open())
     246        {
     247
     248            char linearray[CONFIG_FILE_MAX_LINELENGHT];
     249
     250            ConfigFileSection* newsection = 0;
     251
     252            while (file.good() && !file.eof())
     253            {
     254                file.getline(linearray, CONFIG_FILE_MAX_LINELENGHT);
     255
     256                std::string line = std::string(linearray);
     257
     258                std::string temp = getStripped(line);
     259                if (!isEmpty(temp) && !isComment(temp))
    264260                {
    265                     // New section
    266                     std::string comment = line.substr(pos2 + 1);
    267                     if (isComment(comment))
    268                         newsection = new ConfigFileSection(line.substr(pos1 + 1, pos2 - pos1 - 1), comment);
    269                     else
    270                         newsection = new ConfigFileSection(line.substr(pos1 + 1, pos2 - pos1 - 1));
    271                     this->sections_.insert(this->sections_.end(), newsection);
    272                     continue;
    273                 }
    274             }
    275 
    276             if (newsection != 0)
    277             {
    278                 if (isComment(line))
    279                 {
    280                     // New comment
    281                     newsection->getEntries().insert(newsection->getEntries().end(), new ConfigFileEntryComment(removeTrailingWhitespaces(line)));
    282                     continue;
    283                 }
    284                 else
    285                 {
    286                     size_t pos1 = line.find('=');
    287 
    288                     if (pos1 != std::string::npos && pos1 > 0)
     261                    size_t   pos1 = temp.find('[');
     262                    if (pos1 == 0) pos1 = line.find('['); else pos1 = std::string::npos;
     263                    size_t   pos2 = line.find(']');
     264
     265                    if (pos1 != std::string::npos && pos2 != std::string::npos && pos2 > pos1 + 1)
    289266                    {
    290                         // New entry
    291                         size_t pos2 = line.find('[');
    292                         size_t pos3 = line.find(']');
    293                         size_t commentposition = getNextCommentPosition(line, pos1 + 1);
    294                         while (isBetweenQuotes(line, commentposition))
    295                         {
    296                             commentposition = getNextCommentPosition(line, commentposition + 1);
    297                         }
    298                         std::string value = "", comment = "";
    299                         if (commentposition == std::string::npos)
    300                         {
    301                             value = removeTrailingWhitespaces(line.substr(pos1 + 1));
    302                         }
     267                        // New section
     268                        std::string comment = line.substr(pos2 + 1);
     269                        if (isComment(comment))
     270                            newsection = new ConfigFileSection(line.substr(pos1 + 1, pos2 - pos1 - 1), comment);
    303271                        else
    304                         {
    305                             value = removeTrailingWhitespaces(line.substr(pos1 + 1, commentposition - pos1 - 1));
    306                             comment = removeTrailingWhitespaces(line.substr(commentposition));
    307                         }
    308 
    309                         if (pos2 != std::string::npos && pos3 != std::string::npos && pos3 > pos2 + 1)
    310                         {
    311                             // There might be an array index
    312                             unsigned int index = 0;
    313                             if (ConvertValue(&index, line.substr(pos2 + 1, pos3 - pos2 - 1)))
    314                             {
    315                                 // New array
    316                                 std::list<ConfigFileEntry*>::iterator it = newsection->getEntryIterator(getStripped(line.substr(0, pos2)), index, value, false);
    317                                 (*it)->setValue(value);
    318                                 (*it)->setComment(comment);
    319                                 continue;
    320                             }
    321                         }
    322 
    323                         // New value
    324                         newsection->getEntries().insert(newsection->getEntries().end(), new ConfigFileEntryValue(getStripped(line.substr(0, pos1)), value, false, comment));
     272                            newsection = new ConfigFileSection(line.substr(pos1 + 1, pos2 - pos1 - 1));
     273                        this->sections_.insert(this->sections_.end(), newsection);
    325274                        continue;
    326275                    }
    327276                }
    328             }
    329         }
    330 
    331         file.close();
    332 
    333         COUT(3) << "Loaded config file \"" << this->filename_ << "\"." << std::endl;
    334 
    335         // Save the file in case something changed (like stripped whitespaces)
    336         this->save();
    337 
    338         // Update all ConfigValueContainers
    339         this->updateConfigValues();
     277
     278                if (newsection != 0)
     279                {
     280                    if (isComment(line))
     281                    {
     282                        // New comment
     283                        newsection->getEntries().insert(newsection->getEntries().end(), new ConfigFileEntryComment(removeTrailingWhitespaces(line)));
     284                        continue;
     285                    }
     286                    else
     287                    {
     288                        size_t pos1 = line.find('=');
     289
     290                        if (pos1 != std::string::npos && pos1 > 0)
     291                        {
     292                            // New entry
     293                            size_t pos2 = line.find('[');
     294                            size_t pos3 = line.find(']');
     295                            size_t commentposition = getNextCommentPosition(line, pos1 + 1);
     296                            while (isBetweenQuotes(line, commentposition))
     297                            {
     298                                commentposition = getNextCommentPosition(line, commentposition + 1);
     299                            }
     300                            std::string value = "", comment = "";
     301                            if (commentposition == std::string::npos)
     302                            {
     303                                value = removeTrailingWhitespaces(line.substr(pos1 + 1));
     304                            }
     305                            else
     306                            {
     307                                value = removeTrailingWhitespaces(line.substr(pos1 + 1, commentposition - pos1 - 1));
     308                                comment = removeTrailingWhitespaces(line.substr(commentposition));
     309                            }
     310
     311                            if (pos2 != std::string::npos && pos3 != std::string::npos && pos3 > pos2 + 1)
     312                            {
     313                                // There might be an array index
     314                                unsigned int index = 0;
     315                                if (ConvertValue(&index, line.substr(pos2 + 1, pos3 - pos2 - 1)))
     316                                {
     317                                    // New array
     318                                    std::list<ConfigFileEntry*>::iterator it = newsection->getEntryIterator(getStripped(line.substr(0, pos2)), index, value, false);
     319                                    (*it)->setValue(value);
     320                                    (*it)->setComment(comment);
     321                                    continue;
     322                                }
     323                            }
     324
     325                            // New value
     326                            newsection->getEntries().insert(newsection->getEntries().end(), new ConfigFileEntryValue(getStripped(line.substr(0, pos1)), value, false, comment));
     327                            continue;
     328                        }
     329                    }
     330                }
     331            }
     332
     333            file.close();
     334
     335            COUT(3) << "Loaded config file \"" << this->filename_ << "\"." << std::endl;
     336
     337            // Save the file in case something changed (like stripped whitespaces)
     338            this->save();
     339
     340            // Update all ConfigValueContainers
     341            this->updateConfigValues();
     342        } // end file.is_open()
    340343    }
    341344
    342345    void ConfigFile::save() const
    343346    {
    344         boost::filesystem::path filepath(Core::getConfigPath() + "/" + this->filename_);
     347        boost::filesystem::path filepath(Core::getConfigPath());
     348        filepath /= this->filename_;
    345349
    346350        std::ofstream file;
  • code/branches/buildsystem3/src/core/Core.cc

    r2685 r2690  
    3434#include "Core.h"
    3535#include <cassert>
     36#include <fstream>
     37#include <boost/filesystem.hpp>
     38
     39#include "util/Exception.h"
    3640#include "Language.h"
    3741#include "CoreIncludes.h"
     
    5155    std::string Core::configPath_s(ORXONOX_CONFIG_INSTALL_PATH); // from OrxonoxConfig.h
    5256    std::string Core::logPath_s   (ORXONOX_LOG_INSTALL_PATH);    // from OrxonoxConfig.h
     57    std::string Core::mediaPath_s (ORXONOX_MEDIA_INSTALL_PATH);  // from OrxonoxConfig.h
    5358
    5459    Core* Core::singletonRef_s = 0;
     
    119124            defaultMediaPath = ORXONOX_MEDIA_DEV_PATH;
    120125
    121         SetConfigValue(mediaPath_, defaultMediaPath)
     126        SetConfigValue(mediaPath_s, defaultMediaPath)
    122127            .description("Relative path to the game data.").callback(this, &Core::mediaPathChanged);
    123128
     
    157162    void Core::mediaPathChanged()
    158163    {
    159         if (mediaPath_ != "" && mediaPath_[mediaPath_.size() - 1] != '/')
    160         {
    161             ModifyConfigValue(mediaPath_, set, mediaPath_ + "/");
    162         }
    163 
    164         if (mediaPath_ == "")
    165         {
    166             ModifyConfigValue(mediaPath_, set, "/");
     164        if (mediaPath_s != "" && mediaPath_s[mediaPath_s.size() - 1] != '/')
     165        {
     166            ModifyConfigValue(mediaPath_s, set, mediaPath_s + "/");
     167        }
     168
     169        if (mediaPath_s == "")
     170        {
     171            ModifyConfigValue(mediaPath_s, set, "/");
    167172            COUT(2) << "Warning: Data path set to \"/\", is that really correct?" << std::endl;
    168173        }
     
    245250        if (*path.end() != '/' && *path.end() != '\\')
    246251        {
    247             ModifyConfigValue(mediaPath_, tset, path + "/");
     252            ModifyConfigValue(mediaPath_s, tset, path + "/");
    248253        }
    249254        else
    250255        {
    251             ModifyConfigValue(mediaPath_, tset, path);
     256            ModifyConfigValue(mediaPath_s, tset, path);
    252257        }
    253258    }
     
    264269    }
    265270
    266     /*static*/ void Core::setDevBuild()
    267     {
    268         // Be careful never to call this function before main()!
    269 
    270         Core::isDevBuild_s = true;
    271         // Constants taken from OrxonoxConfig.h
    272         Core::configPath_s = ORXONOX_CONFIG_DEV_PATH;
    273         Core::logPath_s    = ORXONOX_LOG_DEV_PATH;
     271    /**
     272    @brief
     273        Checks for "orxonox_dev_build.keep_me" in the working diretory.
     274        If found it means that this is not an installed run, hence we
     275        don't write the logs and config files to ~/.orxonox
     276    */
     277    /*static*/ void Core::checkDevBuild()
     278    {
     279        std::ifstream probe;
     280        probe.open("orxonox_dev_build.keep_me");
     281        if (probe)
     282        {
     283            Core::isDevBuild_s = true;
     284            // Constants are taken from OrxonoxConfig.h
     285            Core::configPath_s = ORXONOX_CONFIG_DEV_PATH;
     286            Core::logPath_s    = ORXONOX_LOG_DEV_PATH;
     287            Core::mediaPath_s  = ORXONOX_MEDIA_DEV_PATH;
     288            probe.close();
     289        }
     290    }
     291
     292    /*
     293    @brief
     294        Checks for the log and the config directory and creates them
     295        if necessary. Otherwise me might have problems opening those files.
     296    */
     297    /*static*/ void Core::createDirectories()
     298    {
     299        std::vector<std::pair<boost::filesystem::path, std::string> > directories;
     300        directories.push_back(std::pair<boost::filesystem::path, std::string>
     301            (boost::filesystem::path(Core::configPath_s), "config"));
     302        directories.push_back(std::pair<boost::filesystem::path, std::string>
     303            (boost::filesystem::path(Core::logPath_s),    "log"));
     304
     305        for (std::vector<std::pair<boost::filesystem::path, std::string> >::iterator it = directories.begin();
     306            it != directories.end(); ++it)
     307        {
     308            if (boost::filesystem::exists(it->first) && !boost::filesystem::is_directory(it->first))
     309            {
     310                ThrowException(General, std::string("The ") + it->second + " directory has been preoccupied by a file! \
     311                                         Please remove " + it->first.file_string());
     312            }
     313            if (boost::filesystem::create_directory(it->first)) // function may not return true at all (bug?)
     314            {
     315                COUT(4) << "Created " << it->second << " directory" << std::endl;
     316            }
     317        }
    274318    }
    275319}
  • code/branches/buildsystem3/src/core/Core.h

    r2685 r2690  
    6868            static bool isDevBuild() { return Core::isDevBuild_s; }
    6969
    70             static const std::string& getMediaPath()
    71             { assert(singletonRef_s); return singletonRef_s->mediaPath_; }
    7270            static void tsetMediaPath(const std::string& path)
    7371            { assert(singletonRef_s); singletonRef_s->_tsetMediaPath(path); }
     72            static const std::string& getMediaPath()  { return mediaPath_s; }
    7473            static const std::string& getConfigPath() { return configPath_s; }
    7574            static const std::string& getLogPath()    { return logPath_s; }
     
    9695            void _tsetMediaPath(const std::string& path);
    9796
    98             static void setDevBuild();
     97            static void createDirectories();
     98            static void checkDevBuild();
    9999
    100100            int softDebugLevel_;                            //!< The debug level
     
    104104            std::string language_;                          //!< The language
    105105            bool bInitializeRandomNumberGenerator_;         //!< If true, srand(time(0)) is called
    106             std::string mediaPath_;                         //!< Path to the data/media file folder
    107106
    108107            static bool bShowsGraphics_s;                   //!< global variable that tells whether to show graphics
     
    115114            static std::string configPath_s;                //!< Path to the config file folder
    116115            static std::string logPath_s;                   //!< Path to the log file folder
     116            static std::string mediaPath_s;                 //!< Path to the data/media file folder
    117117
    118118            static Core* singletonRef_s;
  • code/branches/buildsystem3/src/core/input/KeyBinder.cc

    r2687 r2690  
    248248        True if loading succeeded.
    249249    */
    250     void KeyBinder::loadBindings(const std::string& filename, const std::string& defaultFilename)
     250    void KeyBinder::loadBindings(const std::string& filename)
    251251    {
    252252        COUT(3) << "KeyBinder: Loading key bindings..." << std::endl;
     
    255255            return;
    256256
    257         boost::filesystem::path folder(Core::getConfigPath());
    258         boost::filesystem::path filepath(folder/filename);
    259 
    260         // get bindings from default file if filename doesn't exist.
    261         std::ifstream infile;
    262         infile.open(filepath.file_string().c_str());
    263         if (!infile)
    264         {
    265             ConfigFileManager::getInstance().setFilename(this->configFile_, defaultFilename);
    266             ConfigFileManager::getInstance().saveAs(this->configFile_, filename);
    267         }
    268         else
    269             infile.close();
    270257        ConfigFileManager::getInstance().setFilename(this->configFile_, filename);
    271258
  • code/branches/buildsystem3/src/core/input/KeyBinder.h

    r2662 r2690  
    6161        virtual ~KeyBinder();
    6262
    63         void loadBindings(const std::string& filename, const std::string& defaultFilename);
     63        void loadBindings(const std::string& filename);
    6464        void clearBindings();
    6565        bool setBinding(const std::string& binding, const std::string& name, bool bTemporary = false);
  • code/branches/buildsystem3/src/orxonox/CMakeLists.txt

    r2685 r2690  
    3939# Not using precompiled header files: Avoid dependencies
    4040INCLUDE_DIRECTORIES(pch/nopch)
    41 
    42 IF(GCC_NO_SYSTEM_HEADER_SUPPORT)
    43   # Get around displaying a few hundred lines of warning code
    44   SET_SOURCE_FILES_PROPERTIES(
    45     gamestates/GSGraphics.cc
    46     gui/GUIManager.cc
    47     PROPERTIES COMPILE_FLAGS "-Wno-sign-compare"
    48   )
    49 ENDIF()
    5041
    5142ADD_EXECUTABLE(orxonox ${ORXONOX_FILES})
  • code/branches/buildsystem3/src/orxonox/Main.cc

    r2685 r2690  
    3737#include <exception>
    3838#include <cassert>
    39 #include <fstream>
    4039
    4140#include "OrxonoxConfig.h"
     
    9594    // First, determine whether we have an installed or a binary dir run
    9695    // The latter occurs when simply running from the build directory
    97     std::ifstream probe;
    98     probe.open("orxonox_dev_build.keep_me");
    99     if (probe)
    100     {
    101         Core::setDevBuild();
    102         probe.close();
    103     }
     96    Core::checkDevBuild();
     97
     98    // Make sure the directories we write in exist or else make them
     99    Core::createDirectories();
    104100
    105101    // create a signal handler (only active for linux)
  • code/branches/buildsystem3/src/orxonox/gamestates/GSGraphics.cc

    r2687 r2690  
    107107        SetConfigValue(ogreLogLevelCritical_, 2)
    108108            .description("Corresponding orxonox debug level for ogre Critical");
    109         SetConfigValue(defaultMasterKeybindings_, "def_masterKeybindings.ini")
    110             .description("Filename of default master keybindings.");
    111109    }
    112110
     
    148146        // Configure master input state with a KeyBinder
    149147        masterKeyBinder_ = new KeyBinder();
    150         masterKeyBinder_->loadBindings("masterKeybindings.ini", defaultMasterKeybindings_);
     148        masterKeyBinder_->loadBindings("masterKeybindings.ini");
    151149        inputManager_->getMasterInputState()->addKeyHandler(masterKeyBinder_);
    152150
  • code/branches/buildsystem3/src/orxonox/gamestates/GSGraphics.h

    r2664 r2690  
    105105        int                   ogreLogLevelNormal_;       //!< Corresponding Orxonx debug level for LL_NORMAL
    106106        int                   ogreLogLevelCritical_;     //!< Corresponding Orxonx debug level for LL_CRITICAL
    107         std::string           defaultMasterKeybindings_; //!< Filename of default master keybindings.
    108107
    109108        // console commands
  • code/branches/buildsystem3/src/orxonox/gamestates/GSLevel.cc

    r2685 r2690  
    7575    {
    7676        SetConfigValue(keyDetectorCallbackCode_, "KeybindBindingStringKeyName=");
    77         SetConfigValue(defaultKeybindings_, "def_keybindings.ini")
    78             .description("Filename of default keybindings.");
    7977    }
    8078
     
    8583            inputState_ = InputManager::getInstance().createInputState<SimpleInputState>("game", 20);
    8684            keyBinder_ = new KeyBinder();
    87             keyBinder_->loadBindings("keybindings.ini", defaultKeybindings_);
     85            keyBinder_->loadBindings("keybindings.ini");
    8886            inputState_->setHandler(keyBinder_);
    8987
  • code/branches/buildsystem3/src/orxonox/gamestates/GSLevel.h

    r2662 r2690  
    6666        //##### ConfigValues #####
    6767        std::string           keyDetectorCallbackCode_;
    68         //! Filename of default keybindings.
    69         std::string           defaultKeybindings_;
    7068
    7169        // console commands
Note: See TracChangeset for help on using the changeset viewer.