Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 26, 2008, 11:36:50 AM (16 years ago)
Author:
rgrieder
Message:
  • added SetConfigValueGeneric to set the config value of the actual class when using hierarchies
  • fixed a bug when handling derived mouse input
  • refined 'keybind' command so that input goes to KeyDetector only
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/core/ConfigValueIncludes.h

    r1062 r1428  
    5353        container##varname = new orxonox::ConfigValueContainer(CFT_Settings, this->getIdentifier(), #varname, varname = defvalue); \
    5454        this->getIdentifier()->addConfigValueContainer(#varname, container##varname); \
     55    } \
     56    container##varname->getValue(&varname)
     57
     58/**
     59    @brief Assigns the value, defined in the config-file, to the variable (or the default-value, if there is no entry in the file).
     60    @param classname name in which the config value should be stored
     61    @param varname The name of the variable
     62    @param defvalue The default-value of the variable
     63*/
     64#define SetConfigValueGeneric(classname, varname, defvalue) \
     65    orxonox::ConfigValueContainer* container##varname = ClassManager<classname>::getIdentifier()->getConfigValueContainer(#varname); \
     66    if (!container##varname) \
     67    { \
     68        container##varname = new orxonox::ConfigValueContainer(CFT_Settings, ClassManager<classname>::getIdentifier(), #varname, varname = defvalue); \
     69        ClassManager<classname>::getIdentifier()->addConfigValueContainer(#varname, container##varname); \
    5570    } \
    5671    container##varname->getValue(&varname)
Note: See TracChangeset for help on using the changeset viewer.