Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5671 in orxonox.OLD for trunk


Ignore:
Timestamp:
Nov 21, 2005, 3:50:41 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: renamed class LoadParam to CLoadParam and Macro LoadParamNew to LoadParam

Location:
trunk/src
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/coord/p_node.cc

    r5654 r5671  
    141141  static_cast<BaseObject*>(this)->loadParams(root);
    142142
    143   LoadParamNEW(root, "rel-coor", this, PNode, setRelCoor)
     143  LoadParam(root, "rel-coor", this, PNode, setRelCoor)
    144144      .describe("Sets The relative position of the Node to its parent.");
    145145
    146   LoadParamNEW(root, "abs-coor", this, PNode, setAbsCoor)
     146  LoadParam(root, "abs-coor", this, PNode, setAbsCoor)
    147147      .describe("Sets The absolute Position of the Node.");
    148148
    149   LoadParamNEW(root, "rel-dir", this, PNode, setRelDir)
     149  LoadParam(root, "rel-dir", this, PNode, setRelDir)
    150150      .describe("Sets The relative rotation of the Node to its parent.");
    151151
    152   LoadParamNEW(root, "abs-dir", this, PNode, setAbsDir)
     152  LoadParam(root, "abs-dir", this, PNode, setAbsDir)
    153153      .describe("Sets The absolute rotation of the Node.");
    154154
    155   LoadParamNEW(root, "parent", this, PNode, setParent)
     155  LoadParam(root, "parent", this, PNode, setParent)
    156156      .describe("the Name of the Parent of this PNode");
    157157
    158   LoadParamNEW(root, "parent-mode", this, PNode, setParentMode)
     158  LoadParam(root, "parent-mode", this, PNode, setParentMode)
    159159      .describe("the mode to connect this node to its parent ()");
    160160
  • trunk/src/lib/graphics/light.cc

    r5653 r5671  
    8888  static_cast<PNode*>(this)->loadParams(root);
    8989
    90   LoadParamNEW(root, "diffuse-color", this, Light, setDiffuseColor)
     90  LoadParam(root, "diffuse-color", this, Light, setDiffuseColor)
    9191      .describe("sets the diffuse color of the Light (red [0-1], green [0-1], blue [0-1])");
    9292
    93   LoadParamNEW(root, "specular-color", this, Light, setSpecularColor)
     93  LoadParam(root, "specular-color", this, Light, setSpecularColor)
    9494      .describe("sets the specular color of the Light (red [0-1], green [0-1], blue [0-1])");
    9595
    96   LoadParamNEW(root, "attenuation", this, Light, setAttenuation)
     96  LoadParam(root, "attenuation", this, Light, setAttenuation)
    9797      .describe("sets the Attenuation of the LightSource (constant Factor, linear Factor, quadratic Factor).");
    9898
    99   LoadParamNEW(root, "spot-direction", this, Light, setSpotDirection)
     99  LoadParam(root, "spot-direction", this, Light, setSpotDirection)
    100100      .describe("sets the Direction of the Spot");
    101101
    102   LoadParamNEW(root, "spot-cutoff", this, Light, setSpotCutoff)
     102  LoadParam(root, "spot-cutoff", this, Light, setSpotCutoff)
    103103      .describe("the cuttoff of the Spotlight");
    104104}
     
    261261      .describe("an XML-Element to load lights from.");
    262262
    263   LoadParamNEW(root, "ambient-color", this, LightManager, setAmbientColor)
     263  LoadParam(root, "ambient-color", this, LightManager, setAmbientColor)
    264264      .describe("sets the ambient Color of the Environmental Light");
    265265}
  • trunk/src/lib/graphics/render2D/element_2d.cc

    r5654 r5671  
    130130{
    131131  // ELEMENT2D-native settings.
    132   LoadParamNEW(root, "alignment", this, Element2D, setAlignment)
     132  LoadParam(root, "alignment", this, Element2D, setAlignment)
    133133      .describe("loads the alignment: (either: center, left, right or screen-center)");
    134134
    135   LoadParamNEW(root, "layer", this, Element2D, setLayer)
     135  LoadParam(root, "layer", this, Element2D, setLayer)
    136136      .describe("loads the layer onto which to project: (either: top, medium, bottom, below-all)");
    137137
    138   LoadParamNEW(root, "bind-node", this, Element2D, setBindNode)
     138  LoadParam(root, "bind-node", this, Element2D, setBindNode)
    139139      .describe("sets a node, this 2D-Element should be shown upon (name of the node)");
    140140
    141   LoadParamNEW(root, "visibility", this, Element2D, setVisibility)
     141  LoadParam(root, "visibility", this, Element2D, setVisibility)
    142142      .describe("if the Element is visible or not");
    143143
    144144
    145145// PNode-style:
    146   LoadParamNEW(root, "rel-coor", this, Element2D, setRelCoor2D)
     146  LoadParam(root, "rel-coor", this, Element2D, setRelCoor2D)
    147147      .describe("Sets The relative position of the Node to its parent.");
    148148
    149   LoadParamNEW(root, "abs-coor", this, Element2D, setAbsCoor2D)
     149  LoadParam(root, "abs-coor", this, Element2D, setAbsCoor2D)
    150150      .describe("Sets The absolute Position of the Node.");
    151151
    152   LoadParamNEW(root, "rel-dir", this, Element2D, setRelDir2D)
     152  LoadParam(root, "rel-dir", this, Element2D, setRelDir2D)
    153153      .describe("Sets The relative rotation of the Node to its parent.");
    154154
    155   LoadParamNEW(root, "abs-dir", this, Element2D, setAbsDir2D)
     155  LoadParam(root, "abs-dir", this, Element2D, setAbsDir2D)
    156156      .describe("Sets The absolute rotation of the Node.");
    157157
    158   LoadParamNEW(root, "parent", this, Element2D, setParent2D)
     158  LoadParam(root, "parent", this, Element2D, setParent2D)
    159159      .describe("the Name of the Parent of this Element2D");
    160160
    161   LoadParamNEW(root, "parent-mode", this, Element2D, setParentMode2D)
     161  LoadParam(root, "parent-mode", this, Element2D, setParentMode2D)
    162162      .describe("the mode to connect this node to its parent ()");
    163163
  • trunk/src/lib/gui/gl_gui/glmenu/glmenu_imagescreen.cc

    r5655 r5671  
    5757void GLMenuImageScreen::loadParams(const TiXmlElement* root)
    5858{
    59   LoadParamNEW(root, "BackgroundImage", this, GLMenuImageScreen, setBackgroundImage)
     59  LoadParam(root, "BackgroundImage", this, GLMenuImageScreen, setBackgroundImage)
    6060    .describe("sets the image to load onto the loadscreen");
    6161
    62   LoadParamNEW(root, "BackgroundPS", this, GLMenuImageScreen, setPosScale)
     62  LoadParam(root, "BackgroundPS", this, GLMenuImageScreen, setPosScale)
    6363    .describe("The Position and Scale of the Background Image in %(0-1.0). PosX, PosY, SizeX, SizeY");
    6464
    65   LoadParamNEW(root, "BarImage", this, GLMenuImageScreen, setBarImage)
     65  LoadParam(root, "BarImage", this, GLMenuImageScreen, setBarImage)
    6666    .describe("sets the image of the LoadingBar");
    6767
    68   LoadParamNEW(root, "BarPS", this, GLMenuImageScreen, setBarPosScale)
     68  LoadParam(root, "BarPS", this, GLMenuImageScreen, setBarPosScale)
    6969    .describe("The Position and Scale of the Loading Bar in %(0-1.0). PosX, PosY, SizeX, SizeY");
    7070
    71   LoadParamNEW(root, "ElementCount", this, GLMenuImageScreen, setMaximum)
     71  LoadParam(root, "ElementCount", this, GLMenuImageScreen, setMaximum)
    7272    .describe("The Count of elements to load into the bar (this is only a maximum value)");
    7373}
  • trunk/src/lib/lang/base_object.cc

    r5652 r5671  
    6262{
    6363  // name setup
    64   LoadParamNEW(root, "name", this, BaseObject, setName)
     64  LoadParam(root, "name", this, BaseObject, setName)
    6565      .describe("the Name of the Object.");
    6666}
  • trunk/src/lib/particles/particle_emitter.cc

    r5653 r5671  
    9595  static_cast<PNode*>(this)->loadParams(root);
    9696
    97   LoadParamNEW(root, "type", this, ParticleEmitter, setType)
     97  LoadParam(root, "type", this, ParticleEmitter, setType)
    9898    .describe("What type of emitter is this [dot, plane, cube, sphere].");
    9999
    100   LoadParamNEW(root, "size", this, ParticleEmitter, setSize)
     100  LoadParam(root, "size", this, ParticleEmitter, setSize)
    101101    .describe("How big the emitter is (no effect on dot-emitters)");
    102102
    103   LoadParamNEW(root, "rate", this, ParticleEmitter, setEmissionRate)
     103  LoadParam(root, "rate", this, ParticleEmitter, setEmissionRate)
    104104    .describe("How many particles should be emittet from this emitter");
    105105
    106   LoadParamNEW(root, "inherit-speed", this, ParticleEmitter, setInheritSpeed)
     106  LoadParam(root, "inherit-speed", this, ParticleEmitter, setInheritSpeed)
    107107    .describe("the extent, the speed of the emitter has on the particles");
    108108
    109   LoadParamNEW(root, "emission-velocity", this, ParticleEmitter, setEmissionVelocity)
     109  LoadParam(root, "emission-velocity", this, ParticleEmitter, setEmissionVelocity)
    110110    .describe("How fast the particles are emittet (their initial speed)");
    111111
    112   LoadParamNEW(root, "emission-momentum", this, ParticleEmitter, setEmissionMomentum)
     112  LoadParam(root, "emission-momentum", this, ParticleEmitter, setEmissionMomentum)
    113113      .describe("How fast the particles rotation is at emissiontime (their initial momentum)");
    114114
    115   LoadParamNEW(root, "spread", this, ParticleEmitter, setSpread)
     115  LoadParam(root, "spread", this, ParticleEmitter, setSpread)
    116116    .describe("The angle the particles are emitted from (angle, deviation)");
    117117
    118118
    119   LoadParamNEW(root, "emission-direction", this, ParticleEmitter, setDirection);
     119  LoadParam(root, "emission-direction", this, ParticleEmitter, setDirection);
    120120}
    121121
  • trunk/src/lib/particles/particle_system.cc

    r5654 r5671  
    119119  static_cast<PhysicsInterface*>(this)->loadParams(root);
    120120
    121   LoadParamNEW(root, "max-count", this, ParticleSystem, setMaxCount)
     121  LoadParam(root, "max-count", this, ParticleSystem, setMaxCount)
    122122      .describe("the maximal count of Particles, that can be emitted into this system");
    123123
    124   LoadParamNEW(root, "life-span", this, ParticleSystem, setLifeSpan)
     124  LoadParam(root, "life-span", this, ParticleSystem, setLifeSpan)
    125125      .describe("sets the life-span of the Particles.");
    126126
    127   LoadParamNEW(root, "conserve", this, ParticleSystem, setConserve)
     127  LoadParam(root, "conserve", this, ParticleSystem, setConserve)
    128128      .describe("sets the Conserve factor of the Particles (1.0: they keep all their energy, 0.0:they keep no energy)");
    129129
    130   LoadParamNEW(root, "type", this, ParticleSystem, setType)
     130  LoadParam(root, "type", this, ParticleSystem, setType)
    131131      .describe("sets the type of the Particles, (dot, spark, sprite or model)");
    132132
  • trunk/src/lib/physics/fields/field.cc

    r5652 r5671  
    6060  static_cast<PNode*>(this)->loadParams(root);
    6161
    62   LoadParamNEW(root, "magnitude", this, Field, setMagnitude)
     62  LoadParam(root, "magnitude", this, Field, setMagnitude)
    6363      .describe("sets the magnitude of this Field")
    6464      ->defaultValues(1, 1);
    6565
    66   LoadParamNEW(root, "attenuation", this, Field, setAttenuation)
     66  LoadParam(root, "attenuation", this, Field, setAttenuation)
    6767      .describe("sets the attenuation of this Field.");
    6868
  • trunk/src/lib/physics/physics_connection.cc

    r5652 r5671  
    5252  static_cast<BaseObject*>(this)->loadParams(root);
    5353
    54   LoadParamNEW(root, "subject", this, PhysicsConnection, setSubject)
     54  LoadParam(root, "subject", this, PhysicsConnection, setSubject)
    5555      .describe("set the subject by a name");
    5656
    57   LoadParamNEW(root, "field", this, PhysicsConnection, setField)
     57  LoadParam(root, "field", this, PhysicsConnection, setField)
    5858      .describe("set the field by name");
    5959
  • trunk/src/story_entities/campaign.cc

    r5652 r5671  
    7575  static_cast<BaseObject*>(this)->loadParams(root);
    7676
    77   LoadParamNEW(root, "identifier", this, Campaign, setStoryID)
     77  LoadParam(root, "identifier", this, Campaign, setStoryID)
    7878     .describe("A Unique Identifier for this Campaign");
    7979
  • trunk/src/story_entities/world.cc

    r5652 r5671  
    186186  PRINTF(4)("Creating a World\n");
    187187
    188   LoadParamNEW(root, "identifier", this, World, setStoryID)
     188  LoadParam(root, "identifier", this, World, setStoryID)
    189189    .describe("Sets the StoryID of this world");
    190190
    191   LoadParamNEW(root, "nextid", this, World, setNextStoryID)
     191  LoadParam(root, "nextid", this, World, setNextStoryID)
    192192    .describe("Sets the ID of the next world");
    193193
    194   LoadParamNEW(root, "path", this, World, setPath)
     194  LoadParam(root, "path", this, World, setPath)
    195195    .describe("The Filename of this World (relative from the data-dir)");
    196196}
  • trunk/src/util/loading/load_param.cc

    r5655 r5671  
    3232 * @param executor the Executor, that executes the loading procedure.
    3333 */
    34 LoadParam::LoadParam(const TiXmlElement* root, const char* paramName, BaseObject* object, const Executor& executor, bool inLoadCycle)
     34CLoadParam::CLoadParam(const TiXmlElement* root, const char* paramName, BaseObject* object, const Executor& executor, bool inLoadCycle)
    3535{
    3636  this->paramName = paramName;
     
    6363 * Execution-Conditions are met, they are executed here.
    6464 */
    65 LoadParam::~LoadParam()
     65CLoadParam::~CLoadParam()
    6666{
    6767  if (likely(this->executor != NULL))
     
    8484 * @param ... the default values !! must be at least count parameters!!
    8585 */
    86 LoadParam* LoadParam::defaultValues(unsigned int count, ...)
     86CLoadParam* CLoadParam::defaultValues(unsigned int count, ...)
    8787{
    8888  if (this == NULL)
     
    104104 * @returns a pointer to itself.
    105105*/
    106 LoadParam* LoadParam::describe(const char* descriptionText)
     106CLoadParam* CLoadParam::describe(const char* descriptionText)
    107107{
    108108  if (LoadClassDescription::parametersDescription && this->paramDesc && !this->paramDesc->getDescription())
  • trunk/src/util/loading/load_param.h

    r5655 r5671  
    4545 * @param FUNCTION The function of Class to Load (if you want to call &CLASS::FUNCTION write FUNCTION here).
    4646 */
    47 #define LoadParamNEW(ROOT, PARAMETER_NAME, OBJECT, CLASS, FUNCTION) \
    48          LoadParam(ROOT, PARAMETER_NAME, OBJECT, ExecutorObjective<CLASS>(&CLASS::FUNCTION), false)
     47#define LoadParam(ROOT, PARAMETER_NAME, OBJECT, CLASS, FUNCTION) \
     48         CLoadParam(ROOT, PARAMETER_NAME, OBJECT, ExecutorObjective<CLASS>(&CLASS::FUNCTION), false)
    4949
    5050#define LoadParam_CYCLE(ROOT, PARAMETER_NAME, OBJECT, CLASS, FUNCTION) \
    51          LoadParam(ROOT, PARAMETER_NAME, OBJECT, ExecutorObjective<CLASS>(&CLASS::FUNCTION), true)
     51         CLoadParam(ROOT, PARAMETER_NAME, OBJECT, ExecutorObjective<CLASS>(&CLASS::FUNCTION), true)
    5252
    5353#define LoadParamXML(ROOT, PARAMETER_NAME, OBJECT, CLASS, FUNCTION) \
    54          LoadParam(ROOT, PARAMETER_NAME, OBJECT, ExecutorXML<CLASS>(&CLASS::FUNCTION, ROOT, PARAMETER_NAME), false)
     54         CLoadParam(ROOT, PARAMETER_NAME, OBJECT, ExecutorXML<CLASS>(&CLASS::FUNCTION, ROOT, PARAMETER_NAME), false)
    5555
    5656#define LoadParamXML_CYCLE(ROOT, PARAMETER_NAME, OBJECT, CLASS, FUNCTION) \
    57          LoadParam(ROOT, PARAMETER_NAME, OBJECT, ExecutorXML<CLASS>(&CLASS::FUNCTION, ROOT, PARAMETER_NAME), true)
     57         CLoadParam(ROOT, PARAMETER_NAME, OBJECT, ExecutorXML<CLASS>(&CLASS::FUNCTION, ROOT, PARAMETER_NAME), true)
    5858
    5959
     
    8585**************************/
    8686//! abstract Base class for a Loadable parameter
    87 class LoadParam : public BaseObject
     87class CLoadParam : public BaseObject
    8888{
    8989  public:
    90     LoadParam(const TiXmlElement* root, const char* paramName, BaseObject* object, const Executor& executor, bool inLoadCycle = false);
    91     ~LoadParam();
     90    CLoadParam(const TiXmlElement* root, const char* paramName, BaseObject* object, const Executor& executor, bool inLoadCycle = false);
     91    ~CLoadParam();
    9292
    93     LoadParam* describe(const char* descriptionText);
    94     LoadParam* defaultValues(unsigned int count, ...);
     93    CLoadParam* describe(const char* descriptionText);
     94    CLoadParam* defaultValues(unsigned int count, ...);
    9595
    9696
     
    101101    const char*              paramName;
    102102
    103     LoadClassDescription*    classDesc;            //!< The LoadClassDescription of this LoadParameter
     103    LoadClassDescription*    classDesc;            //!< The LoadClassDescription of this CLoadParameter
    104104    LoadParamDescription*    paramDesc;            //!< The LoadParameterDescription of this LoadParameter
    105105    const char*              loadString;           //!< The string loaded by this LoadParam
  • trunk/src/util/loading/load_param_description.h

    r5655 r5671  
    5656class LoadClassDescription
    5757{
    58   friend class LoadParam;
     58  friend class CLoadParam;
    5959 public:
    6060  LoadClassDescription(const char* className);
  • trunk/src/world_entities/skybox.cc

    r5652 r5671  
    5555  static_cast<WorldEntity*>(this)->loadParams(root);
    5656
    57   LoadParamNEW(root, "Materialset", this, SkyBox, setTexture)
     57  LoadParam(root, "Materialset", this, SkyBox, setTexture)
    5858      .describe("Sets the material on the SkyBox. The string must be the path relative to the data-dir, and without a trailing .jpg");
    5959
    60   LoadParamNEW(root, "Size", this, SkyBox, setSize)
     60  LoadParam(root, "Size", this, SkyBox, setSize)
    6161      .describe("Sets the Size of the SkyBox (normally this should be 90% of the maximal viewing Distance).");
    6262}
  • trunk/src/world_entities/terrain.cc

    r5654 r5671  
    104104  static_cast<WorldEntity*>(this)->loadParams(root);
    105105
    106   LoadParamNEW(root, "vegetation", this, Terrain, loadVegetation)
     106  LoadParam(root, "vegetation", this, Terrain, loadVegetation)
    107107      .describe("the fileName of the vegetation, that should be loaded onto this terrain. (must be relative to the data-dir)") ;
    108108}
  • trunk/src/world_entities/weapons/aim.cc

    r5652 r5671  
    7070  static_cast<PNode*>(this)->loadParams(root);
    7171
    72   LoadParamNEW(root, "texture", this, Aim, setTexture)
     72  LoadParam(root, "texture", this, Aim, setTexture)
    7373      .describe("the texture-file to load onto the Aim");
    7474
    75   LoadParamNEW(root, "size", this, Aim, setSize)
     75  LoadParam(root, "size", this, Aim, setSize)
    7676      .describe("the size of the Aim in Pixels");
    7777
    78   LoadParamNEW(root, "rotation-speed", this, Aim, setRotationSpeed)
     78  LoadParam(root, "rotation-speed", this, Aim, setRotationSpeed)
    7979      .describe("the Speed with which the Aim should rotate");
    8080}
  • trunk/src/world_entities/weapons/crosshair.cc

    r5652 r5671  
    8484  static_cast<EventListener*>(this)->loadParams(root);
    8585
    86   LoadParamNEW(root, "texture", this, Crosshair, setTexture)
     86  LoadParam(root, "texture", this, Crosshair, setTexture)
    8787      .describe("the texture-file to load onto the Crosshair");
    8888
    89   LoadParamNEW(root, "size", this, Crosshair, setSize)
     89  LoadParam(root, "size", this, Crosshair, setSize)
    9090      .describe("the size of the Crosshair in Pixels");
    9191
    92   LoadParamNEW(root, "rotation-speed", this, Crosshair, setRotationSpeed)
     92  LoadParam(root, "rotation-speed", this, Crosshair, setRotationSpeed)
    9393      .describe("the Speed with which the Crosshair should rotate");
    9494}
  • trunk/src/world_entities/weapons/weapon.cc

    r5652 r5671  
    109109  static_cast<WorldEntity*>(this)->loadParams(root);
    110110
    111   LoadParamNEW(root, "projectile", this, Weapon, setProjectileType)
     111  LoadParam(root, "projectile", this, Weapon, setProjectileType)
    112112      .describe("Sets the name of the Projectile to load onto the Entity");
    113113
    114   LoadParamNEW(root, "emission-point", this, Weapon, setEmissionPoint)
     114  LoadParam(root, "emission-point", this, Weapon, setEmissionPoint)
    115115      .describe("Sets the Point of emission of this weapon");
    116116
    117   LoadParamNEW(root, "state-duration", this, Weapon, setStateDuration)
     117  LoadParam(root, "state-duration", this, Weapon, setStateDuration)
    118118      .describe("Sets the duration of a given state (1: state-Name; 2: duration in seconds)");
    119119
    120   LoadParamNEW(root, "action-sound", this, Weapon, setActionSound)
     120  LoadParam(root, "action-sound", this, Weapon, setActionSound)
    121121      .describe("Sets a given sound to an action (1: action-Name; 2: name of the sound (relative to the Data-Path))");
    122122}
  • trunk/src/world_entities/weapons/weapon_manager.cc

    r5654 r5671  
    119119  static_cast<BaseObject*>(this)->loadParams(root);
    120120
    121   LoadParamNEW(root, "slot-count", this, WeaponManager, setSlotCount)
     121  LoadParam(root, "slot-count", this, WeaponManager, setSlotCount)
    122122      .describe("how many slots(cannons) the WeaponManager can handle");
    123123
  • trunk/src/world_entities/world_entity.cc

    r5652 r5671  
    7676
    7777  // Model Loading
    78   LoadParamNEW(root, "model", this, WorldEntity, loadModel)
     78  LoadParam(root, "model", this, WorldEntity, loadModel)
    7979      .describe("the fileName of the model, that should be loaded onto this world-entity. (must be relative to the data-dir)")
    8080      ->defaultValues(2, NULL, 1.0f);
Note: See TracChangeset for help on using the changeset viewer.