Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5653 in orxonox.OLD for trunk


Ignore:
Timestamp:
Nov 20, 2005, 6:43:58 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: further cleanup

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/light.cc

    r5652 r5653  
    258258void LightManager::loadParams(const TiXmlElement* root)
    259259{
    260   LoadParam<LightManager>(root, "Lights", this, &LightManager::loadLights)
     260  LoadParamXML(root, "Lights", this, LightManager, loadLights)
    261261      .describe("an XML-Element to load lights from.");
    262262
    263   LoadParam<LightManager>(root, "ambient-color", this, &LightManager::setAmbientColor)
     263  LoadParamNEW(root, "ambient-color", this, LightManager, setAmbientColor)
    264264      .describe("sets the ambient Color of the Environmental Light");
    265265}
  • trunk/src/lib/particles/particle_emitter.cc

    r5652 r5653  
    117117
    118118
    119   LoadParam<ParticleEmitter>(root, "emission-direction", this, &ParticleEmitter::setDirection);
     119  LoadParamNEW(root, "emission-direction", this, ParticleEmitter, setDirection);
    120120}
    121121
  • trunk/src/util/loading/load_param.cc

    r5652 r5653  
    107107}
    108108
     109/**
     110 * Constructs a new LoadParameter
     111 * @param root the XML-element to load this Parameter from
     112 * @param paramName the Parameter to load
     113 * @param object the BaseObject, to load this parameter on to (will be cast to executor's Parameter)
     114 * @param executor the Executor, that executes the loading procedure.
     115 */
    109116LoadParamBase::LoadParamBase(const TiXmlElement* root, const char* paramName, BaseObject* object, const Executor& executor)
    110117{
     
    123130}
    124131
    125 
     132/**
     133 * This is a VERY SPECIAL deconsrtuctor.
     134 * It is made, so that it loads the Parameters on destruction.
     135 * meaning, if an Executor a valid Object exist, and all
     136 * Execution-Conditions are met, they are executed here.
     137 */
    126138LoadParamBase::~LoadParamBase()
    127139{
    128140  if (likely(this->executor != NULL))
    129141  {
    130     printf("%s: %s", this->paramName, this->loadString);
    131142    if (likely(this->object != NULL && this->executor != NULL) &&
    132143        ( this->loadString != NULL ||
    133144         ((this->executor->getType() & Executor_NoLoadString) == Executor_NoLoadString)))
    134145    {
    135       printf(" - exec");
     146      PRINTF(4)("Loading '%s' with Parameters '%s' onto: '%s'(%s)\n", this->paramName, this->loadString, this->object->getName(), this->object->getClassName());
    136147      this->executor->execute(this->object, this->loadString);
    137148    }
    138     printf ("\n");
    139149    delete this->executor;
    140150  }
     
    142152}
    143153
    144 
     154/**
     155 * set the default values of the executor
     156 * @param count how many default values to set.
     157 * @param ... the default values !! must be at least count parameters!!
     158 */
    145159LoadParamBase* LoadParamBase::defaultValues(unsigned int count, ...)
    146160{
  • trunk/src/util/loading/load_param.h

    r5652 r5653  
    284284#include "functor_list.h"
    285285#undef FUNCTOR_LIST
    286 
    287   //! makes functions with one Vector loadable
    288   //LoadParam1(l_VECTOR);
    289 
    290   // loads a Ti-XML-element
    291   LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(const TiXmlElement*), bool multi = false)
    292   : LoadParamBase(root, pt2Object, paramName, 1, multi, NULL, "XML")
    293   {
    294     if (root != NULL)
    295     {
    296       const TiXmlElement* elem = root->FirstChildElement(paramName);
    297       if (elem != NULL)
    298         (*pt2Object.*function)(elem);
    299       else
    300         PRINTF(4)("%s of %s is empty\n", paramName, pt2Object->getClassName());
    301     }
    302     else
    303       PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName());
    304   }
    305 
    306   //LoadParamPT(l_XML_ELEM);
    307286};
    308287
  • trunk/src/world_entities/weapons/weapon_manager.cc

    r5652 r5653  
    124124  LOAD_PARAM_START_CYCLE(root, element);
    125125
    126   LoadParam<WeaponManager>(element, "weapons", this, &WeaponManager::loadWeapons)
     126
     127  LoadParamXML(element, "weapons", this, WeaponManager, loadWeapons)
    127128      .describe("loads Weapons");
    128       // LoadParam<WeaponManager>(root, "Weapon", this, &WeaponManager::addWeapon);
    129129
    130130  LOAD_PARAM_END_CYCLE(element);
     
    140140
    141141  Weapon* newWeapon = dynamic_cast<Weapon*>(Factory::getFirst()->fabricate(element));
    142 
     142  /// @todo implement this !!
    143143
    144144
Note: See TracChangeset for help on using the changeset viewer.