- Timestamp:
- Nov 21, 2005, 3:50:41 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/coord/p_node.cc
r5654 r5671 141 141 static_cast<BaseObject*>(this)->loadParams(root); 142 142 143 LoadParam NEW(root, "rel-coor", this, PNode, setRelCoor)143 LoadParam(root, "rel-coor", this, PNode, setRelCoor) 144 144 .describe("Sets The relative position of the Node to its parent."); 145 145 146 LoadParam NEW(root, "abs-coor", this, PNode, setAbsCoor)146 LoadParam(root, "abs-coor", this, PNode, setAbsCoor) 147 147 .describe("Sets The absolute Position of the Node."); 148 148 149 LoadParam NEW(root, "rel-dir", this, PNode, setRelDir)149 LoadParam(root, "rel-dir", this, PNode, setRelDir) 150 150 .describe("Sets The relative rotation of the Node to its parent."); 151 151 152 LoadParam NEW(root, "abs-dir", this, PNode, setAbsDir)152 LoadParam(root, "abs-dir", this, PNode, setAbsDir) 153 153 .describe("Sets The absolute rotation of the Node."); 154 154 155 LoadParam NEW(root, "parent", this, PNode, setParent)155 LoadParam(root, "parent", this, PNode, setParent) 156 156 .describe("the Name of the Parent of this PNode"); 157 157 158 LoadParam NEW(root, "parent-mode", this, PNode, setParentMode)158 LoadParam(root, "parent-mode", this, PNode, setParentMode) 159 159 .describe("the mode to connect this node to its parent ()"); 160 160 -
trunk/src/lib/graphics/light.cc
r5653 r5671 88 88 static_cast<PNode*>(this)->loadParams(root); 89 89 90 LoadParam NEW(root, "diffuse-color", this, Light, setDiffuseColor)90 LoadParam(root, "diffuse-color", this, Light, setDiffuseColor) 91 91 .describe("sets the diffuse color of the Light (red [0-1], green [0-1], blue [0-1])"); 92 92 93 LoadParam NEW(root, "specular-color", this, Light, setSpecularColor)93 LoadParam(root, "specular-color", this, Light, setSpecularColor) 94 94 .describe("sets the specular color of the Light (red [0-1], green [0-1], blue [0-1])"); 95 95 96 LoadParam NEW(root, "attenuation", this, Light, setAttenuation)96 LoadParam(root, "attenuation", this, Light, setAttenuation) 97 97 .describe("sets the Attenuation of the LightSource (constant Factor, linear Factor, quadratic Factor)."); 98 98 99 LoadParam NEW(root, "spot-direction", this, Light, setSpotDirection)99 LoadParam(root, "spot-direction", this, Light, setSpotDirection) 100 100 .describe("sets the Direction of the Spot"); 101 101 102 LoadParam NEW(root, "spot-cutoff", this, Light, setSpotCutoff)102 LoadParam(root, "spot-cutoff", this, Light, setSpotCutoff) 103 103 .describe("the cuttoff of the Spotlight"); 104 104 } … … 261 261 .describe("an XML-Element to load lights from."); 262 262 263 LoadParam NEW(root, "ambient-color", this, LightManager, setAmbientColor)263 LoadParam(root, "ambient-color", this, LightManager, setAmbientColor) 264 264 .describe("sets the ambient Color of the Environmental Light"); 265 265 } -
trunk/src/lib/graphics/render2D/element_2d.cc
r5654 r5671 130 130 { 131 131 // ELEMENT2D-native settings. 132 LoadParam NEW(root, "alignment", this, Element2D, setAlignment)132 LoadParam(root, "alignment", this, Element2D, setAlignment) 133 133 .describe("loads the alignment: (either: center, left, right or screen-center)"); 134 134 135 LoadParam NEW(root, "layer", this, Element2D, setLayer)135 LoadParam(root, "layer", this, Element2D, setLayer) 136 136 .describe("loads the layer onto which to project: (either: top, medium, bottom, below-all)"); 137 137 138 LoadParam NEW(root, "bind-node", this, Element2D, setBindNode)138 LoadParam(root, "bind-node", this, Element2D, setBindNode) 139 139 .describe("sets a node, this 2D-Element should be shown upon (name of the node)"); 140 140 141 LoadParam NEW(root, "visibility", this, Element2D, setVisibility)141 LoadParam(root, "visibility", this, Element2D, setVisibility) 142 142 .describe("if the Element is visible or not"); 143 143 144 144 145 145 // PNode-style: 146 LoadParam NEW(root, "rel-coor", this, Element2D, setRelCoor2D)146 LoadParam(root, "rel-coor", this, Element2D, setRelCoor2D) 147 147 .describe("Sets The relative position of the Node to its parent."); 148 148 149 LoadParam NEW(root, "abs-coor", this, Element2D, setAbsCoor2D)149 LoadParam(root, "abs-coor", this, Element2D, setAbsCoor2D) 150 150 .describe("Sets The absolute Position of the Node."); 151 151 152 LoadParam NEW(root, "rel-dir", this, Element2D, setRelDir2D)152 LoadParam(root, "rel-dir", this, Element2D, setRelDir2D) 153 153 .describe("Sets The relative rotation of the Node to its parent."); 154 154 155 LoadParam NEW(root, "abs-dir", this, Element2D, setAbsDir2D)155 LoadParam(root, "abs-dir", this, Element2D, setAbsDir2D) 156 156 .describe("Sets The absolute rotation of the Node."); 157 157 158 LoadParam NEW(root, "parent", this, Element2D, setParent2D)158 LoadParam(root, "parent", this, Element2D, setParent2D) 159 159 .describe("the Name of the Parent of this Element2D"); 160 160 161 LoadParam NEW(root, "parent-mode", this, Element2D, setParentMode2D)161 LoadParam(root, "parent-mode", this, Element2D, setParentMode2D) 162 162 .describe("the mode to connect this node to its parent ()"); 163 163 -
trunk/src/lib/gui/gl_gui/glmenu/glmenu_imagescreen.cc
r5655 r5671 57 57 void GLMenuImageScreen::loadParams(const TiXmlElement* root) 58 58 { 59 LoadParam NEW(root, "BackgroundImage", this, GLMenuImageScreen, setBackgroundImage)59 LoadParam(root, "BackgroundImage", this, GLMenuImageScreen, setBackgroundImage) 60 60 .describe("sets the image to load onto the loadscreen"); 61 61 62 LoadParam NEW(root, "BackgroundPS", this, GLMenuImageScreen, setPosScale)62 LoadParam(root, "BackgroundPS", this, GLMenuImageScreen, setPosScale) 63 63 .describe("The Position and Scale of the Background Image in %(0-1.0). PosX, PosY, SizeX, SizeY"); 64 64 65 LoadParam NEW(root, "BarImage", this, GLMenuImageScreen, setBarImage)65 LoadParam(root, "BarImage", this, GLMenuImageScreen, setBarImage) 66 66 .describe("sets the image of the LoadingBar"); 67 67 68 LoadParam NEW(root, "BarPS", this, GLMenuImageScreen, setBarPosScale)68 LoadParam(root, "BarPS", this, GLMenuImageScreen, setBarPosScale) 69 69 .describe("The Position and Scale of the Loading Bar in %(0-1.0). PosX, PosY, SizeX, SizeY"); 70 70 71 LoadParam NEW(root, "ElementCount", this, GLMenuImageScreen, setMaximum)71 LoadParam(root, "ElementCount", this, GLMenuImageScreen, setMaximum) 72 72 .describe("The Count of elements to load into the bar (this is only a maximum value)"); 73 73 } -
trunk/src/lib/lang/base_object.cc
r5652 r5671 62 62 { 63 63 // name setup 64 LoadParam NEW(root, "name", this, BaseObject, setName)64 LoadParam(root, "name", this, BaseObject, setName) 65 65 .describe("the Name of the Object."); 66 66 } -
trunk/src/lib/particles/particle_emitter.cc
r5653 r5671 95 95 static_cast<PNode*>(this)->loadParams(root); 96 96 97 LoadParam NEW(root, "type", this, ParticleEmitter, setType)97 LoadParam(root, "type", this, ParticleEmitter, setType) 98 98 .describe("What type of emitter is this [dot, plane, cube, sphere]."); 99 99 100 LoadParam NEW(root, "size", this, ParticleEmitter, setSize)100 LoadParam(root, "size", this, ParticleEmitter, setSize) 101 101 .describe("How big the emitter is (no effect on dot-emitters)"); 102 102 103 LoadParam NEW(root, "rate", this, ParticleEmitter, setEmissionRate)103 LoadParam(root, "rate", this, ParticleEmitter, setEmissionRate) 104 104 .describe("How many particles should be emittet from this emitter"); 105 105 106 LoadParam NEW(root, "inherit-speed", this, ParticleEmitter, setInheritSpeed)106 LoadParam(root, "inherit-speed", this, ParticleEmitter, setInheritSpeed) 107 107 .describe("the extent, the speed of the emitter has on the particles"); 108 108 109 LoadParam NEW(root, "emission-velocity", this, ParticleEmitter, setEmissionVelocity)109 LoadParam(root, "emission-velocity", this, ParticleEmitter, setEmissionVelocity) 110 110 .describe("How fast the particles are emittet (their initial speed)"); 111 111 112 LoadParam NEW(root, "emission-momentum", this, ParticleEmitter, setEmissionMomentum)112 LoadParam(root, "emission-momentum", this, ParticleEmitter, setEmissionMomentum) 113 113 .describe("How fast the particles rotation is at emissiontime (their initial momentum)"); 114 114 115 LoadParam NEW(root, "spread", this, ParticleEmitter, setSpread)115 LoadParam(root, "spread", this, ParticleEmitter, setSpread) 116 116 .describe("The angle the particles are emitted from (angle, deviation)"); 117 117 118 118 119 LoadParam NEW(root, "emission-direction", this, ParticleEmitter, setDirection);119 LoadParam(root, "emission-direction", this, ParticleEmitter, setDirection); 120 120 } 121 121 -
trunk/src/lib/particles/particle_system.cc
r5654 r5671 119 119 static_cast<PhysicsInterface*>(this)->loadParams(root); 120 120 121 LoadParam NEW(root, "max-count", this, ParticleSystem, setMaxCount)121 LoadParam(root, "max-count", this, ParticleSystem, setMaxCount) 122 122 .describe("the maximal count of Particles, that can be emitted into this system"); 123 123 124 LoadParam NEW(root, "life-span", this, ParticleSystem, setLifeSpan)124 LoadParam(root, "life-span", this, ParticleSystem, setLifeSpan) 125 125 .describe("sets the life-span of the Particles."); 126 126 127 LoadParam NEW(root, "conserve", this, ParticleSystem, setConserve)127 LoadParam(root, "conserve", this, ParticleSystem, setConserve) 128 128 .describe("sets the Conserve factor of the Particles (1.0: they keep all their energy, 0.0:they keep no energy)"); 129 129 130 LoadParam NEW(root, "type", this, ParticleSystem, setType)130 LoadParam(root, "type", this, ParticleSystem, setType) 131 131 .describe("sets the type of the Particles, (dot, spark, sprite or model)"); 132 132 -
trunk/src/lib/physics/fields/field.cc
r5652 r5671 60 60 static_cast<PNode*>(this)->loadParams(root); 61 61 62 LoadParam NEW(root, "magnitude", this, Field, setMagnitude)62 LoadParam(root, "magnitude", this, Field, setMagnitude) 63 63 .describe("sets the magnitude of this Field") 64 64 ->defaultValues(1, 1); 65 65 66 LoadParam NEW(root, "attenuation", this, Field, setAttenuation)66 LoadParam(root, "attenuation", this, Field, setAttenuation) 67 67 .describe("sets the attenuation of this Field."); 68 68 -
trunk/src/lib/physics/physics_connection.cc
r5652 r5671 52 52 static_cast<BaseObject*>(this)->loadParams(root); 53 53 54 LoadParam NEW(root, "subject", this, PhysicsConnection, setSubject)54 LoadParam(root, "subject", this, PhysicsConnection, setSubject) 55 55 .describe("set the subject by a name"); 56 56 57 LoadParam NEW(root, "field", this, PhysicsConnection, setField)57 LoadParam(root, "field", this, PhysicsConnection, setField) 58 58 .describe("set the field by name"); 59 59 -
trunk/src/story_entities/campaign.cc
r5652 r5671 75 75 static_cast<BaseObject*>(this)->loadParams(root); 76 76 77 LoadParam NEW(root, "identifier", this, Campaign, setStoryID)77 LoadParam(root, "identifier", this, Campaign, setStoryID) 78 78 .describe("A Unique Identifier for this Campaign"); 79 79 -
trunk/src/story_entities/world.cc
r5652 r5671 186 186 PRINTF(4)("Creating a World\n"); 187 187 188 LoadParam NEW(root, "identifier", this, World, setStoryID)188 LoadParam(root, "identifier", this, World, setStoryID) 189 189 .describe("Sets the StoryID of this world"); 190 190 191 LoadParam NEW(root, "nextid", this, World, setNextStoryID)191 LoadParam(root, "nextid", this, World, setNextStoryID) 192 192 .describe("Sets the ID of the next world"); 193 193 194 LoadParam NEW(root, "path", this, World, setPath)194 LoadParam(root, "path", this, World, setPath) 195 195 .describe("The Filename of this World (relative from the data-dir)"); 196 196 } -
trunk/src/util/loading/load_param.cc
r5655 r5671 32 32 * @param executor the Executor, that executes the loading procedure. 33 33 */ 34 LoadParam::LoadParam(const TiXmlElement* root, const char* paramName, BaseObject* object, const Executor& executor, bool inLoadCycle)34 CLoadParam::CLoadParam(const TiXmlElement* root, const char* paramName, BaseObject* object, const Executor& executor, bool inLoadCycle) 35 35 { 36 36 this->paramName = paramName; … … 63 63 * Execution-Conditions are met, they are executed here. 64 64 */ 65 LoadParam::~LoadParam()65 CLoadParam::~CLoadParam() 66 66 { 67 67 if (likely(this->executor != NULL)) … … 84 84 * @param ... the default values !! must be at least count parameters!! 85 85 */ 86 LoadParam*LoadParam::defaultValues(unsigned int count, ...)86 CLoadParam* CLoadParam::defaultValues(unsigned int count, ...) 87 87 { 88 88 if (this == NULL) … … 104 104 * @returns a pointer to itself. 105 105 */ 106 LoadParam*LoadParam::describe(const char* descriptionText)106 CLoadParam* CLoadParam::describe(const char* descriptionText) 107 107 { 108 108 if (LoadClassDescription::parametersDescription && this->paramDesc && !this->paramDesc->getDescription()) -
trunk/src/util/loading/load_param.h
r5655 r5671 45 45 * @param FUNCTION The function of Class to Load (if you want to call &CLASS::FUNCTION write FUNCTION here). 46 46 */ 47 #define LoadParam NEW(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) 49 49 50 50 #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) 52 52 53 53 #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) 55 55 56 56 #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) 58 58 59 59 … … 85 85 **************************/ 86 86 //! abstract Base class for a Loadable parameter 87 class LoadParam : public BaseObject87 class CLoadParam : public BaseObject 88 88 { 89 89 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(); 92 92 93 LoadParam* describe(const char* descriptionText);94 LoadParam* defaultValues(unsigned int count, ...);93 CLoadParam* describe(const char* descriptionText); 94 CLoadParam* defaultValues(unsigned int count, ...); 95 95 96 96 … … 101 101 const char* paramName; 102 102 103 LoadClassDescription* classDesc; //!< The LoadClassDescription of this LoadParameter103 LoadClassDescription* classDesc; //!< The LoadClassDescription of this CLoadParameter 104 104 LoadParamDescription* paramDesc; //!< The LoadParameterDescription of this LoadParameter 105 105 const char* loadString; //!< The string loaded by this LoadParam -
trunk/src/util/loading/load_param_description.h
r5655 r5671 56 56 class LoadClassDescription 57 57 { 58 friend class LoadParam;58 friend class CLoadParam; 59 59 public: 60 60 LoadClassDescription(const char* className); -
trunk/src/world_entities/skybox.cc
r5652 r5671 55 55 static_cast<WorldEntity*>(this)->loadParams(root); 56 56 57 LoadParam NEW(root, "Materialset", this, SkyBox, setTexture)57 LoadParam(root, "Materialset", this, SkyBox, setTexture) 58 58 .describe("Sets the material on the SkyBox. The string must be the path relative to the data-dir, and without a trailing .jpg"); 59 59 60 LoadParam NEW(root, "Size", this, SkyBox, setSize)60 LoadParam(root, "Size", this, SkyBox, setSize) 61 61 .describe("Sets the Size of the SkyBox (normally this should be 90% of the maximal viewing Distance)."); 62 62 } -
trunk/src/world_entities/terrain.cc
r5654 r5671 104 104 static_cast<WorldEntity*>(this)->loadParams(root); 105 105 106 LoadParam NEW(root, "vegetation", this, Terrain, loadVegetation)106 LoadParam(root, "vegetation", this, Terrain, loadVegetation) 107 107 .describe("the fileName of the vegetation, that should be loaded onto this terrain. (must be relative to the data-dir)") ; 108 108 } -
trunk/src/world_entities/weapons/aim.cc
r5652 r5671 70 70 static_cast<PNode*>(this)->loadParams(root); 71 71 72 LoadParam NEW(root, "texture", this, Aim, setTexture)72 LoadParam(root, "texture", this, Aim, setTexture) 73 73 .describe("the texture-file to load onto the Aim"); 74 74 75 LoadParam NEW(root, "size", this, Aim, setSize)75 LoadParam(root, "size", this, Aim, setSize) 76 76 .describe("the size of the Aim in Pixels"); 77 77 78 LoadParam NEW(root, "rotation-speed", this, Aim, setRotationSpeed)78 LoadParam(root, "rotation-speed", this, Aim, setRotationSpeed) 79 79 .describe("the Speed with which the Aim should rotate"); 80 80 } -
trunk/src/world_entities/weapons/crosshair.cc
r5652 r5671 84 84 static_cast<EventListener*>(this)->loadParams(root); 85 85 86 LoadParam NEW(root, "texture", this, Crosshair, setTexture)86 LoadParam(root, "texture", this, Crosshair, setTexture) 87 87 .describe("the texture-file to load onto the Crosshair"); 88 88 89 LoadParam NEW(root, "size", this, Crosshair, setSize)89 LoadParam(root, "size", this, Crosshair, setSize) 90 90 .describe("the size of the Crosshair in Pixels"); 91 91 92 LoadParam NEW(root, "rotation-speed", this, Crosshair, setRotationSpeed)92 LoadParam(root, "rotation-speed", this, Crosshair, setRotationSpeed) 93 93 .describe("the Speed with which the Crosshair should rotate"); 94 94 } -
trunk/src/world_entities/weapons/weapon.cc
r5652 r5671 109 109 static_cast<WorldEntity*>(this)->loadParams(root); 110 110 111 LoadParam NEW(root, "projectile", this, Weapon, setProjectileType)111 LoadParam(root, "projectile", this, Weapon, setProjectileType) 112 112 .describe("Sets the name of the Projectile to load onto the Entity"); 113 113 114 LoadParam NEW(root, "emission-point", this, Weapon, setEmissionPoint)114 LoadParam(root, "emission-point", this, Weapon, setEmissionPoint) 115 115 .describe("Sets the Point of emission of this weapon"); 116 116 117 LoadParam NEW(root, "state-duration", this, Weapon, setStateDuration)117 LoadParam(root, "state-duration", this, Weapon, setStateDuration) 118 118 .describe("Sets the duration of a given state (1: state-Name; 2: duration in seconds)"); 119 119 120 LoadParam NEW(root, "action-sound", this, Weapon, setActionSound)120 LoadParam(root, "action-sound", this, Weapon, setActionSound) 121 121 .describe("Sets a given sound to an action (1: action-Name; 2: name of the sound (relative to the Data-Path))"); 122 122 } -
trunk/src/world_entities/weapons/weapon_manager.cc
r5654 r5671 119 119 static_cast<BaseObject*>(this)->loadParams(root); 120 120 121 LoadParam NEW(root, "slot-count", this, WeaponManager, setSlotCount)121 LoadParam(root, "slot-count", this, WeaponManager, setSlotCount) 122 122 .describe("how many slots(cannons) the WeaponManager can handle"); 123 123 -
trunk/src/world_entities/world_entity.cc
r5652 r5671 76 76 77 77 // Model Loading 78 LoadParam NEW(root, "model", this, WorldEntity, loadModel)78 LoadParam(root, "model", this, WorldEntity, loadModel) 79 79 .describe("the fileName of the model, that should be loaded onto this world-entity. (must be relative to the data-dir)") 80 80 ->defaultValues(2, NULL, 1.0f);
Note: See TracChangeset
for help on using the changeset viewer.