Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 2, 2008, 12:09:55 AM (16 years ago)
Author:
rgrieder
Message:

Finally managed to have a master InputState which enables:

  • Console always opens
  • Debug overlay toggles visibility in gui mode too

Had to change several other code:

  • ConfigFileManager uses special class instead of enum for ConfigFileType
  • You can add an arbitrary config file and get the ConfigFileType
  • ConfigFileManager is an Ogre singleton too. Created in Main.cc
  • CommandLineArgument "optionsFile" specifies another file for command line arguments
  • CommandLineArgument "settingsFile" declares the file used for settings (orxonox.ini)
  • changed all fileNames to filenames
  • "Loaded config file blah" now uses COUT(3) instead of COUT(0)
  • fixed a bug in ConfigFileManager::load() that cause orxonox.ini to double its size after every call
Location:
code/branches/objecthierarchy/src/orxonox/gamestates
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/orxonox/gamestates/GSGraphics.cc

    r2084 r2101  
    9393    void GSGraphics::setConfigValues()
    9494    {
    95         SetConfigValue(resourceFile_, "resources.cfg").description("Location of the resources file in the data path.");
    96         SetConfigValue(ogreConfigFile_,  "ogre.cfg").description("Location of the Ogre config file");
    97         SetConfigValue(ogrePluginsFile_, "plugins.cfg").description("Location of the Ogre plugins file");
    98         SetConfigValue(ogreLogFile_,     "ogre.log").description("Logfile for messages from Ogre. \
    99                                                                  Use \"\" to suppress log file creation.");
    100         SetConfigValue(ogreLogLevelTrivial_ , 5).description("Corresponding orxonox debug level for ogre Trivial");
    101         SetConfigValue(ogreLogLevelNormal_  , 4).description("Corresponding orxonox debug level for ogre Normal");
    102         SetConfigValue(ogreLogLevelCritical_, 2).description("Corresponding orxonox debug level for ogre Critical");
    103         SetConfigValue(statisticsRefreshCycle_, 200000).description("Sets the time in microseconds interval at \
    104                                                                     which average fps, etc. get updated.");
     95        SetConfigValue(resourceFile_,    "resources.cfg")
     96            .description("Location of the resources file in the data path.");
     97        SetConfigValue(ogreConfigFile_,  "ogre.cfg")
     98            .description("Location of the Ogre config file");
     99        SetConfigValue(ogrePluginsFile_, "plugins.cfg")
     100            .description("Location of the Ogre plugins file");
     101        SetConfigValue(ogreLogFile_,     "ogre.log")
     102            .description("Logfile for messages from Ogre. Use \"\" to suppress log file creation.");
     103        SetConfigValue(ogreLogLevelTrivial_ , 5)
     104            .description("Corresponding orxonox debug level for ogre Trivial");
     105        SetConfigValue(ogreLogLevelNormal_  , 4)
     106            .description("Corresponding orxonox debug level for ogre Normal");
     107        SetConfigValue(ogreLogLevelCritical_, 2)
     108            .description("Corresponding orxonox debug level for ogre Critical");
     109        SetConfigValue(statisticsRefreshCycle_, 200000)
     110            .description("Sets the time in microseconds interval at which average fps, etc. get updated.");
     111        SetConfigValue(defaultMasterKeybindings_, "def_masterKeybindings.ini")
     112            .description("Filename of default master keybindings.");
    105113    }
    106114
     
    136144        inputManager_->initialise(windowHnd, renderWindow_->getWidth(), renderWindow_->getHeight(), true);
    137145        // Configure master input state with a KeyBinder
    138         //masterKeyBinder_ = new KeyBinder();
    139         //masterKeyBinder_->loadBindings("master_keybindings.ini");
    140         //inputManager_->getMasterInputState()->addKeyHandler(masterKeyBinder_);
     146        masterKeyBinder_ = new KeyBinder();
     147        masterKeyBinder_->loadBindings("masterKeybindings.ini", defaultMasterKeybindings_);
     148        inputManager_->getMasterInputState()->addKeyHandler(masterKeyBinder_);
    141149
    142150        // Load the InGameConsole
     
    172180
    173181        //inputManager_->getMasterInputState()->removeKeyHandler(this->masterKeyBinder_);
    174         //delete this->masterKeyBinder_;
     182        delete this->masterKeyBinder_;
    175183        delete this->inputManager_;
    176184
  • code/branches/objecthierarchy/src/orxonox/gamestates/GSGraphics.h

    r2084 r2101  
    103103
    104104        // config values
    105         std::string           resourceFile_;          //!< resources file name
    106         std::string           ogreConfigFile_;        //!< ogre config file name
    107         std::string           ogrePluginsFile_;       //!< ogre plugins file name
    108         std::string           ogreLogFile_;           //!< log file name for Ogre log messages
    109         int                   ogreLogLevelTrivial_;   //!< Corresponding Orxonx debug level for LL_TRIVIAL
    110         int                   ogreLogLevelNormal_;    //!< Corresponding Orxonx debug level for LL_NORMAL
    111         int                   ogreLogLevelCritical_;  //!< Corresponding Orxonx debug level for LL_CRITICAL
    112         unsigned int          detailLevelParticle_;   //!< Detail level of particle effects (0: off, 1: low, 2: normal, 3: high)
     105        std::string           resourceFile_;             //!< resources file name
     106        std::string           ogreConfigFile_;           //!< ogre config file name
     107        std::string           ogrePluginsFile_;          //!< ogre plugins file name
     108        std::string           ogreLogFile_;              //!< log file name for Ogre log messages
     109        int                   ogreLogLevelTrivial_;      //!< Corresponding Orxonx debug level for LL_TRIVIAL
     110        int                   ogreLogLevelNormal_;       //!< Corresponding Orxonx debug level for LL_NORMAL
     111        int                   ogreLogLevelCritical_;     //!< Corresponding Orxonx debug level for LL_CRITICAL
     112        unsigned int          detailLevelParticle_;      //!< Detail level of particle effects (0: off, 1: low, 2: normal, 3: high)
     113        std::string           defaultMasterKeybindings_; //!< Filename of default master keybindings.
    113114    };
    114115}
  • code/branches/objecthierarchy/src/orxonox/gamestates/GSLevel.cc

    r2084 r2101  
    7171    {
    7272        SetConfigValue(keyDetectorCallbackCode_, "KeybindBindingStringKeyName=");
     73        SetConfigValue(defaultKeybindings_, "def_keybindings.ini")
     74            .description("Filename of default keybindings.");
    7375    }
    7476
     
    7981            inputState_ = InputManager::getInstance().createInputState<SimpleInputState>("game", 20);
    8082            keyBinder_ = new KeyBinder();
    81             keyBinder_->loadBindings("keybindings.ini");
     83            keyBinder_->loadBindings("keybindings.ini", defaultKeybindings_);
    8284            inputState_->setHandler(keyBinder_);
    8385
  • code/branches/objecthierarchy/src/orxonox/gamestates/GSLevel.h

    r2073 r2101  
    7171        LevelManager*         levelManager_;
    7272
    73         // config values
     73        //##### ConfigValues #####
    7474        std::string           keyDetectorCallbackCode_;
     75        //! Filename of default keybindings.
     76        std::string           defaultKeybindings_;
    7577
    7678    private:
Note: See TracChangeset for help on using the changeset viewer.