Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 16, 2010, 10:56:26 PM (14 years ago)
Author:
landauf
Message:

added new macro to ConfigValueIncludes.h, "SetConfigValueExternal" for values with user-defined name AND user-defined section

added new config value for models to enable/disable LOD (aimed towards people which experience crashes when using LOD)
moved config value for the LOD of ParticleInterface to the same section (GraphicsSettings) using the new macro

Location:
code/trunk/src/libraries
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/ConfigValueIncludes.h

    r6536 r7166  
    9696    orxonox::setConfigValueGeneric(this, &variable, ConfigFileType::Settings, this->getIdentifier()->getName(), entryName, defaultValue)
    9797
     98/** Sets a runtime configurable value (simplified macro version of setConfigValueGeneric)
     99    If the container for the value doesn't yet exist, a new one is created.
     100    Also, the @a varname argument will be modified and set to the new value (default or from ini file).
     101@param variable
     102    Variable name as C++ identifier.
     103@param sectionName
     104    Name of the section in the ini file (e.g. [MySection])
     105@param entryName
     106    Name of the entry in the ini file (e.g. [MySection] myValue)
     107@param defaultValue
     108    Value to be used if it cannot be read from the ini file
     109*/
     110#define SetConfigValueExternal(variable, sectionName, entryName, defaultValue) \
     111    orxonox::setConfigValueGeneric(this, &variable, ConfigFileType::Settings, sectionName, entryName, defaultValue)
     112
    98113
    99114namespace orxonox
  • code/trunk/src/libraries/tools/ParticleInterface.cc

    r6417 r7166  
    9595    void ParticleInterface::setConfigValues()
    9696    {
    97         SetConfigValue(globalDetailLevel_, 2)
    98             .description("O: off, 1: low, 2: normal, 3: high").callback(this, &ParticleInterface::detailLevelChanged);
     97        SetConfigValueExternal(globalDetailLevel_, "GraphicsSettings", "particlesDetailLevel", 2)
     98            .description("O: off, 1: low, 2: normal, 3: high")
     99            .callback(this, &ParticleInterface::detailLevelChanged);
    99100    }
    100101
Note: See TracChangeset for help on using the changeset viewer.