Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5654 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Nov 20, 2005, 9:12:50 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: cycle-loading of LoadParam works…

Location:
trunk/src/lib
Files:
4 edited

Legend:

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

    r5652 r5654  
    162162  if (root != NULL)
    163163  {
    164     const TiXmlElement* element = root->FirstChildElement();
    165     while (element != NULL)
     164    LOAD_PARAM_START_CYCLE(root, element);
    166165    {
    167       LoadParam<PNode>(element, "parent", this, &PNode::addChild, true)
     166      LoadParam_CYCLE(element, "parent", this, PNode, addChild)
    168167          .describe("adds a new Child to the current Node.");
    169168
    170       element = element->NextSiblingElement();
    171169    }
     170    LOAD_PARAM_END_CYCLE(element);
    172171  }
    173172}
  • trunk/src/lib/graphics/render2D/element_2d.cc

    r5652 r5654  
    165165  if (root != NULL)
    166166  {
    167     const TiXmlElement* element = root->FirstChildElement();
    168     while (element != NULL)
    169     {
    170       LoadParam<Element2D>(root, "parent", this, &Element2D::addChild2D, true)
     167    LOAD_PARAM_START_CYCLE(root, element);
     168    {
     169      LoadParam_CYCLE(element, "parent", this, Element2D, addChild2D)
    171170          .describe("adds a new Child to the current Node.");
    172 
    173       element = element->NextSiblingElement();
    174     }
     171    }
     172    LOAD_PARAM_END_CYCLE(element);
    175173  }
    176174}
  • trunk/src/lib/particles/particle_engine.cc

    r5447 r5654  
    9090void ParticleEngine::loadParams(const TiXmlElement* root)
    9191{
    92   const TiXmlElement* element = root->FirstChildElement();
    93   while( element != NULL)
    94   {
    95     LoadParam<ParticleEngine>(element, "connect", this, &ParticleEngine::addConnection, true)
     92  LOAD_PARAM_START_CYCLE(root, element);
     93  {
     94    LoadParam_CYCLE(element, "connect", this, ParticleEngine, addConnection)
    9695        .describe("connects an Emitter to a System (emitterName, systemName)");
    97     element = element->NextSiblingElement();
    98   }
     96  }
     97  LOAD_PARAM_END_CYCLE(element);
    9998}
    10099
  • trunk/src/lib/particles/particle_system.cc

    r5652 r5654  
    122122      .describe("the maximal count of Particles, that can be emitted into this system");
    123123
    124   //LoadParam<ParticleSystem>(root, "type", this, &ParticleSystem::setType);
    125124  LoadParamNEW(root, "life-span", this, ParticleSystem, setLifeSpan)
    126125      .describe("sets the life-span of the Particles.");
     
    132131      .describe("sets the type of the Particles, (dot, spark, sprite or model)");
    133132
    134   const TiXmlElement* element = root->FirstChildElement();
    135   while (element != NULL)
     133  LOAD_PARAM_START_CYCLE(root, element);
    136134  {
    137 
     135    element->ToText();
    138136  // PER-PARTICLE-ATTRIBUTES:
    139     LoadParam<ParticleSystem>(element, "radius", this, &ParticleSystem::setRadius, true)
     137    LoadParam_CYCLE(element, "radius", this, ParticleSystem, setRadius)
    140138        .describe("The Radius of each particle over time (TimeIndex [0-1], radius at TimeIndex, randomRadius at TimeIndex)");
    141139
    142     LoadParam<ParticleSystem>(element, "mass", this, &ParticleSystem::setMass, true)
     140    LoadParam_CYCLE(element, "mass", this, ParticleSystem, setMass)
    143141        .describe("The Mass of each particle over time (TimeIndex: [0-1], mass at TimeIndex, randomMass at TimeIndex)");
    144142
    145     LoadParam<ParticleSystem>(element, "color", this, &ParticleSystem::setColor, true)
     143    LoadParam_CYCLE(element, "color", this, ParticleSystem, setColor)
    146144        .describe("The Color of each particle over time (TimeIndex: [0-1], red: [0-1], green: [0-1], blue: [0-1], alpha: [0-1])");
    147     element = element->NextSiblingElement();
    148145  }
     146  LOAD_PARAM_END_CYCLE(element);
    149147
    150148}
Note: See TracChangeset for help on using the changeset viewer.