Changeset 5652 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Nov 20, 2005, 6:32:39 PM (19 years ago)
- Location:
- trunk/src/lib
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/coord/p_node.cc
r5438 r5652 141 141 static_cast<BaseObject*>(this)->loadParams(root); 142 142 143 LoadParam <PNode>(root, "rel-coor", this, &PNode::setRelCoor)143 LoadParamNEW(root, "rel-coor", this, PNode, setRelCoor) 144 144 .describe("Sets The relative position of the Node to its parent."); 145 145 146 LoadParam <PNode>(root, "abs-coor", this, &PNode::setAbsCoor)146 LoadParamNEW(root, "abs-coor", this, PNode, setAbsCoor) 147 147 .describe("Sets The absolute Position of the Node."); 148 148 149 LoadParam <PNode>(root, "rel-dir", this, &PNode::setRelDir)149 LoadParamNEW(root, "rel-dir", this, PNode, setRelDir) 150 150 .describe("Sets The relative rotation of the Node to its parent."); 151 151 152 LoadParam <PNode>(root, "abs-dir", this, &PNode::setAbsDir)152 LoadParamNEW(root, "abs-dir", this, PNode, setAbsDir) 153 153 .describe("Sets The absolute rotation of the Node."); 154 154 155 LoadParam <PNode>(root, "parent", this, &PNode::setParent)155 LoadParamNEW(root, "parent", this, PNode, setParent) 156 156 .describe("the Name of the Parent of this PNode"); 157 157 158 LoadParam <PNode>(root, "parent-mode", this, &PNode::setParentMode)158 LoadParamNEW(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
r5357 r5652 88 88 static_cast<PNode*>(this)->loadParams(root); 89 89 90 LoadParam <Light>(root, "diffuse-color", this, &Light::setDiffuseColor)90 LoadParamNEW(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 <Light>(root, "specular-color", this, &Light::setSpecularColor)93 LoadParamNEW(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 <Light>(root, "attenuation", this, &Light::setAttenuation)96 LoadParamNEW(root, "attenuation", this, Light, setAttenuation) 97 97 .describe("sets the Attenuation of the LightSource (constant Factor, linear Factor, quadratic Factor)."); 98 98 99 LoadParam <Light>(root, "spot-direction", this, &Light::setSpotDirection)99 LoadParamNEW(root, "spot-direction", this, Light, setSpotDirection) 100 100 .describe("sets the Direction of the Spot"); 101 101 102 LoadParam <Light>(root, "spot-cutoff", this, &Light::setSpotCutoff)102 LoadParamNEW(root, "spot-cutoff", this, Light, setSpotCutoff) 103 103 .describe("the cuttoff of the Spotlight"); 104 104 } -
trunk/src/lib/graphics/render2D/element_2d.cc
r5418 r5652 130 130 { 131 131 // ELEMENT2D-native settings. 132 LoadParam <Element2D>(root, "alignment", this, &Element2D::setAlignment)132 LoadParamNEW(root, "alignment", this, Element2D, setAlignment) 133 133 .describe("loads the alignment: (either: center, left, right or screen-center)"); 134 134 135 LoadParam <Element2D>(root, "layer", this, &Element2D::setLayer)135 LoadParamNEW(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 <Element2D>(root, "bind-node", this, &Element2D::setBindNode)138 LoadParamNEW(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 <Element2D>(root, "visibility", this, &Element2D::setVisibility)141 LoadParamNEW(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 <Element2D>(root, "rel-coor", this, &Element2D::setRelCoor2D)146 LoadParamNEW(root, "rel-coor", this, Element2D, setRelCoor2D) 147 147 .describe("Sets The relative position of the Node to its parent."); 148 148 149 LoadParam <Element2D>(root, "abs-coor", this, &Element2D::setAbsCoor2D)149 LoadParamNEW(root, "abs-coor", this, Element2D, setAbsCoor2D) 150 150 .describe("Sets The absolute Position of the Node."); 151 151 152 LoadParam <Element2D>(root, "rel-dir", this, &Element2D::setRelDir2D)152 LoadParamNEW(root, "rel-dir", this, Element2D, setRelDir2D) 153 153 .describe("Sets The relative rotation of the Node to its parent."); 154 154 155 LoadParam <Element2D>(root, "abs-dir", this, &Element2D::setAbsDir2D)155 LoadParamNEW(root, "abs-dir", this, Element2D, setAbsDir2D) 156 156 .describe("Sets The absolute rotation of the Node."); 157 157 158 LoadParam <Element2D>(root, "parent", this, &Element2D::setParent2D)158 LoadParamNEW(root, "parent", this, Element2D, setParent2D) 159 159 .describe("the Name of the Parent of this Element2D"); 160 160 161 LoadParam <Element2D>(root, "parent-mode", this, &Element2D::setParentMode2D)161 LoadParamNEW(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
r5373 r5652 57 57 void GLMenuImageScreen::loadParams(const TiXmlElement* root) 58 58 { 59 LoadParam <GLMenuImageScreen>(root, "BackgroundImage", this, &GLMenuImageScreen::setBackgroundImage)59 LoadParamNEW(root, "BackgroundImage", this, GLMenuImageScreen, setBackgroundImage) 60 60 .describe("sets the image to load onto the loadscreen"); 61 61 62 LoadParam <GLMenuImageScreen>(root, "BackgroundPS", this, &GLMenuImageScreen::setPosScale)62 LoadParamNEW(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 <GLMenuImageScreen>(root, "BarImage", this, &GLMenuImageScreen::setBarImage)65 LoadParamNEW(root, "BarImage", this, GLMenuImageScreen, setBarImage) 66 66 .describe("sets the image of the LoadingBar"); 67 67 68 LoadParam <GLMenuImageScreen>(root, "BarPS", this, &GLMenuImageScreen::setBarPosScale)68 LoadParamNEW(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 <GLMenuImageScreen>(root, "ElementCount", this, &GLMenuImageScreen::setMaximum)71 LoadParamNEW(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 } … … 123 123 void GLMenuImageScreen::setPosScale(float offsetX, float offsetY, float scaleX, float scaleY) 124 124 { 125 printf("IMG: %f %f %f %f\n", offsetX, offsetY,offsetX, offsetY); 125 126 this->setPosition(offsetX, offsetY); 126 127 this->setScale(scaleX, scaleY); … … 144 145 void GLMenuImageScreen::setBarPosScale(float barX, float barY, float barW, float barH) 145 146 { 147 printf("BAR: %f %f %f %f\n", barX, barY, barW, barH); 148 146 149 this->barX = barX; 147 150 this->barY = barY; -
trunk/src/lib/lang/base_object.cc
r5646 r5652 63 63 // name setup 64 64 LoadParamNEW(root, "name", this, BaseObject, setName) 65 //LoadParamBase(root, "name", this, ExecutorObjective<BaseObject>(&BaseObject::setName))66 65 .describe("the Name of the Object."); 67 // LoadParam<BaseObject>(root, "name", this, &BaseObject::setName)68 //.describe("the name of the Object at hand");69 66 } 70 67 -
trunk/src/lib/particles/particle_emitter.cc
r5445 r5652 22 22 23 23 #include "load_param.h" 24 #include "factory.h" 24 25 #include "debug.h" 25 26 #include "stdlibincl.h" … … 94 95 static_cast<PNode*>(this)->loadParams(root); 95 96 96 LoadParam <ParticleEmitter>(root, "type", this, &ParticleEmitter::setType)97 LoadParamNEW(root, "type", this, ParticleEmitter, setType) 97 98 .describe("What type of emitter is this [dot, plane, cube, sphere]."); 98 99 99 LoadParam <ParticleEmitter>(root, "size", this, &ParticleEmitter::setSize)100 LoadParamNEW(root, "size", this, ParticleEmitter, setSize) 100 101 .describe("How big the emitter is (no effect on dot-emitters)"); 101 102 102 LoadParam <ParticleEmitter>(root, "rate", this, &ParticleEmitter::setEmissionRate)103 LoadParamNEW(root, "rate", this, ParticleEmitter, setEmissionRate) 103 104 .describe("How many particles should be emittet from this emitter"); 104 105 105 LoadParam <ParticleEmitter>(root, "inherit-speed", this, &ParticleEmitter::setInheritSpeed)106 LoadParamNEW(root, "inherit-speed", this, ParticleEmitter, setInheritSpeed) 106 107 .describe("the extent, the speed of the emitter has on the particles"); 107 108 108 LoadParam <ParticleEmitter>(root, "emission-velocity", this, &ParticleEmitter::setEmissionVelocity)109 LoadParamNEW(root, "emission-velocity", this, ParticleEmitter, setEmissionVelocity) 109 110 .describe("How fast the particles are emittet (their initial speed)"); 110 111 111 LoadParam <ParticleEmitter>(root, "emission-momentum", this, &ParticleEmitter::setEmissionMomentum)112 LoadParamNEW(root, "emission-momentum", this, ParticleEmitter, setEmissionMomentum) 112 113 .describe("How fast the particles rotation is at emissiontime (their initial momentum)"); 113 114 114 LoadParam <ParticleEmitter>(root, "spread", this, &ParticleEmitter::setSpread)115 LoadParamNEW(root, "spread", this, ParticleEmitter, setSpread) 115 116 .describe("The angle the particles are emitted from (angle, deviation)"); 116 117 -
trunk/src/lib/particles/particle_system.cc
r5511 r5652 25 25 26 26 #include "load_param.h" 27 #include " compiler.h"27 #include "factory.h" 28 28 #include "material.h" 29 29 #include "state.h" … … 119 119 static_cast<PhysicsInterface*>(this)->loadParams(root); 120 120 121 LoadParam <ParticleSystem>(root, "max-count", this, &ParticleSystem::setMaxCount)121 LoadParamNEW(root, "max-count", this, ParticleSystem, setMaxCount) 122 122 .describe("the maximal count of Particles, that can be emitted into this system"); 123 123 124 124 //LoadParam<ParticleSystem>(root, "type", this, &ParticleSystem::setType); 125 LoadParam <ParticleSystem>(root, "life-span", this, &ParticleSystem::setLifeSpan)125 LoadParamNEW(root, "life-span", this, ParticleSystem, setLifeSpan) 126 126 .describe("sets the life-span of the Particles."); 127 127 128 LoadParam <ParticleSystem>(root, "conserve", this, &ParticleSystem::setConserve)129 .describe("sets the Conserve fac rotof the Particles (1.0: they keep all their energy, 0.0:they keep no energy)");130 131 LoadParam <ParticleSystem>(root, "type", this, &ParticleSystem::setType)128 LoadParamNEW(root, "conserve", this, ParticleSystem, setConserve) 129 .describe("sets the Conserve factor of the Particles (1.0: they keep all their energy, 0.0:they keep no energy)"); 130 131 LoadParamNEW(root, "type", this, ParticleSystem, setType) 132 132 .describe("sets the type of the Particles, (dot, spark, sprite or model)"); 133 133 -
trunk/src/lib/physics/fields/field.cc
r5357 r5652 60 60 static_cast<PNode*>(this)->loadParams(root); 61 61 62 LoadParam<Field>(root, "magnitude", this, &Field::setMagnitude) 63 .describe("sets the magnitude of this Field"); 62 LoadParamNEW(root, "magnitude", this, Field, setMagnitude) 63 .describe("sets the magnitude of this Field") 64 ->defaultValues(1, 1); 64 65 65 LoadParam <Field>(root, "attenuation", this, &Field::setAttenuation)66 LoadParamNEW(root, "attenuation", this, Field, setAttenuation) 66 67 .describe("sets the attenuation of this Field."); 67 68 -
trunk/src/lib/physics/physics_connection.cc
r5357 r5652 52 52 static_cast<BaseObject*>(this)->loadParams(root); 53 53 54 LoadParam <PhysicsConnection>(root, "subject", this, &PhysicsConnection::setSubject)54 LoadParamNEW(root, "subject", this, PhysicsConnection, setSubject) 55 55 .describe("set the subject by a name"); 56 56 57 LoadParam <PhysicsConnection>(root, "field", this, &PhysicsConnection::setField)57 LoadParamNEW(root, "field", this, PhysicsConnection, setField) 58 58 .describe("set the field by name"); 59 59 -
trunk/src/lib/physics/physics_engine.cc
r5217 r5652 93 93 void PhysicsEngine::loadParams(const TiXmlElement* root) 94 94 { 95 LoadParam <PhysicsEngine>(root, "Fields", this, &PhysicsEngine::loadFields)95 LoadParamXML(root, "Fields", this, PhysicsEngine, loadFields) 96 96 .describe("loads a list of fields"); 97 97 98 LoadParam <PhysicsEngine>(root, "Connections", this, &PhysicsEngine::loadConnections)98 LoadParamXML(root, "Connections", this, PhysicsEngine, loadConnections) 99 99 .describe("loads a list of fields"); 100 100 } -
trunk/src/lib/shell/shell_command.cc
r5642 r5652 74 74 75 75 } 76 77 78 79 76 80 77 /** … … 256 253 if (!strcmp(enumCMD->getName(), inputSplits.getString(fktPos))) 257 254 { 258 if (objectPointer == NULL && enumCMD->executor->getType() ==Executor_Objective)255 if (objectPointer == NULL && enumCMD->executor->getType() & Executor_Objective) 259 256 { 260 257 delete itCMD; -
trunk/src/lib/util/executor/executor.h
r5642 r5652 21 21 //! an enumerator for the definition of the Type. 22 22 typedef enum { 23 Executor_Objective = 1, 24 Executor_Static = 2, 23 Executor_Objective = 0x00000001, 24 Executor_Static = 0x00000002, 25 26 Executor_NoLoadString = 0x00000010, 25 27 } Executor_Type; 26 28 … … 43 45 44 46 /** @returns the Type of this Function (either static or objective) */ 45 inline Executor_TypegetType() const { return this->functorType; };47 inline long getType() const { return this->functorType; }; 46 48 /** @returns the Count of Parameters this Executor takes */ 47 49 inline unsigned int getParamCount() const { return this->paramCount; }; … … 56 58 57 59 protected: 58 Executor_TypefunctorType; //!< The type of Function we've got (either static or objective).59 unsigned int 60 MultiType* 60 long functorType; //!< The type of Function we've got (either static or objective). 61 unsigned int paramCount; //!< the count of parameters. 62 MultiType* defaultValue; //!< Default Values. 61 63 }; 62 64 … … 196 198 #define ExecutorExecute4(t1,t2,t3,t4) \ 197 199 else if (this->paramCount == 4 && this->defaultValue[0].getType() == t1##_PARAM && this->defaultValue[1].getType() == t2##_PARAM && this->defaultValue[2].getType() == t3##_PARAM && this->defaultValue[3].getType() == t4##_PARAM) \ 198 EXECUTOREXECUTER(_4_##t1##_##t2##_##t3##_##t4)(t1##_FUNC(sub.getString(0), t1##_DEFGRAB(0)), t2##_FUNC(sub.getString(1), t2##_DEFGRAB(1)), t3##_FUNC(sub.getString(2), t3##_DEFGRAB(2)), t4##_FUNC(sub.getString(3), t4##_DEFGRAB(3))) 200 EXECUTOREXECUTER(_4_##t1##_##t2##_##t3##_##t4)(t1##_FUNC(sub.getString(0), t1##_DEFGRAB(0)), t2##_FUNC(sub.getString(1), t2##_DEFGRAB(1)), t3##_FUNC(sub.getString(2), t3##_DEFGRAB(2)), t4##_FUNC(sub.getString(3), t4##_DEFGRAB(3))) \ 201 199 202 200 203 //! execute-macro for functions with five parameters … … 258 261 virtual void execute (BaseObject* object, const char* parameters) 259 262 { 260 SubString sub(parameters, true);263 SubString sub(parameters, ','); /// FIXME /// 261 264 //! FUNCTOR_LIST is the List of Executive Functions 262 265 #define FUNCTOR_LIST(x) ExecutorExecute ## x -
trunk/src/lib/util/executor/executor_specials.h
r5651 r5652 38 38 39 39 this->functionPointer = function; 40 this->functorType = Executor_Objective | Executor_NoLoadString; 40 41 } 41 42 … … 66 67 private: 67 68 /** 68 * used for the copy- constructor69 * used for the copy-(Clone)-constructor 69 70 */ 70 71 ExecutorXML() : Executor() { };
Note: See TracChangeset
for help on using the changeset viewer.