Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 1, 2008, 3:54:20 PM (16 years ago)
Author:
rgrieder
Message:
  • @everyone: Do not create a branch until I've added the svn:eol-style property correctly. Otherwise this would cost me another 4 hours or so when we want to merge back.
  • merged network branch back to trunk
  • I had to omit the changes from last evening concerning the line endings
  • might not work yet because of the line endings
  • @beni: script branch is the only branch still open. you probably will have to apply a patch because of inconsistent new lines
File:
1 edited

Legend:

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

    r1062 r1502  
    5757
    5858/**
     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); \
     70    } \
     71    container##varname->getValue(&varname)
     72
     73/**
    5974    @brief Assigns the vector-values, defined in the config-file, to the vector (or the default-value, if there are no entries in the file).
    6075    @param varname The name of the std::vector
     
    6984            temp.push_back(MultiTypeMath(defvalue[i])); \
    7085        container##varname = new orxonox::ConfigValueContainer(CFT_Settings, this->getIdentifier(), #varname, temp); \
     86        container##varname->setVectorType(varname); \
    7187        this->getIdentifier()->addConfigValueContainer(#varname, container##varname); \
    7288    } \
     
    106122    }
    107123
    108 /**
    109     @brief Assigns the command, defined in the keybind-file, to the key-variable (or an empty string, if there is no entry in the file).
    110     @param varname The name of the key-variable
    111 */
    112 #define SetKeybind(keyname) \
    113     orxonox::ConfigValueContainer* container##keyname = this->getIdentifier()->getConfigValueContainer(#keyname); \
    114     if (!container##keyname) \
    115     { \
    116         container##keyname = new orxonox::ConfigValueContainer(CFT_Keybindings, this->getIdentifier(), #keyname, keyname = ""); \
    117         this->getIdentifier()->addConfigValueContainer(#keyname, container##keyname); \
    118     } \
    119     container##keyname->getValue(&varname)
    120 
    121124#endif /* _ConfigValueIncludes_H__ */
Note: See TracChangeset for help on using the changeset viewer.