Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4501 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jun 3, 2005, 11:59:34 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: loading of track works just fine now. little problems with the setSavePoint-function

Location:
orxonox/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/story_entities/world.cc

    r4496 r4501  
    452452  this->localPlayer->setParentMode(PNODE_ALL);
    453453  Vector* cameraOffset = new Vector (0, 5, -10);
    454   trackManager->condition(2, LEFTRIGHT, this->localPlayer);
    455  
     454  trackManager->condition(1, LEFTRIGHT, this->localPlayer);
     455  trackManager->debug(3);
     456
    456457  this->sky->setParent(this->localCamera);
    457458
     
    544545     
    545546  trackManager->forkS("testFork1,testFork2");
    546   trackManager->workOn("testFork1");
     547  trackManager->workOnS("testFork1");
    547548  trackManager->addPointV(Vector(640, 25, -30));
    548549  trackManager->addPointV(Vector(700, 40, -120));
     
    555556  trackManager->setDuration(4);
    556557
    557   trackManager->workOn("testFork2");
     558  trackManager->workOnS("testFork2");
    558559  trackManager->addPointV(Vector(640, 25, 20));
    559560  trackManager->addPointV(Vector(670, 50, 120));
  • orxonox/trunk/src/util/loading/load_param.cc

    r4496 r4501  
    3434  this->loadString = NULL;
    3535
    36   if (likely(!multi))
    37     this->loadString = grabParameter(root, paramName);
     36  if (paramCount == 0)
     37    this->loadString = "none";
    3838  else
    3939    {
    40       printf("paramName:::::%s\n", root->Value());
    41       if (!strcmp(root->Value(), paramName))
    42         {
    43           const TiXmlNode* val = root->FirstChild();
    44           if( val->ToText())
    45             this->loadString = val->Value();
    46         }
    47     }
    48   if (loadString)
    49     printf("%s\n", loadString);
     40      if (likely(!multi))
     41        this->loadString = grabParameter(root, paramName);
     42      else
     43        {
     44          if (!strcmp(root->Value(), paramName))
     45            {
     46              const TiXmlNode* val = root->FirstChild();
     47              if( val->ToText())
     48                this->loadString = val->Value();
     49            }
     50        }
     51    }
    5052
    5153  this->paramDesc = NULL;
  • orxonox/trunk/src/util/loading/load_param.h

    r4496 r4501  
    247247{
    248248 public:
     249  LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(), bool multi = false)
     250    : BaseLoadParam(root, pt2Object, paramName, 0, multi, "")
     251    {
     252      if (loadString != NULL && root != NULL)
     253        (*pt2Object.*function)();
     254      else
     255        PRINTF(4)("Not loaded parameter %s of %s\n", paramName, pt2Object->getClassName());
     256    }
     257
     258
    249259  //! makes functions with one string loadable
    250260  LoadParam1(l_STRING);
  • orxonox/trunk/src/util/track/track_manager.cc

    r4496 r4501  
    409409       
    410410  element = root->FirstChildElement();
     411
    411412       
    412413  while( element != NULL)
    413414    {
     415      LoadParam<TrackManager>(element, "WorkOn", this, &TrackManager::workOnS, true)
     416        .describe("Selects a TrackElement (by name) to work on");
     417
    414418      LoadParam<TrackManager>(element, "Point", this, &TrackManager::addPoint, true)
    415419        .describe("Adds a new Point to the currently selected TrackElement");
     
    418422        .describe("Sets the Duration of the currently selected TrackElement");
    419423     
    420       LoadParam<TrackManager>(element, "SavePoint", this, &TrackManager::setSavePoint, true);
     424      LoadParam<TrackManager>(element, "SavePoint", this, &TrackManager::setSavePointS, true)
     425        .describe("Sets the current selected Point to a Savepoint, meaning that the curve will be ended and a new one starts, and that one starts again from this point on");
     426
     427      LoadParam<TrackManager>(element, "Fork", this, &TrackManager::forkS, true)
     428        .describe("Forks the Path into multiple forked Path names seperated by ','");
     429
     430      LoadParam<TrackManager>(element, "Join", this, &TrackManager::joinS, true)
     431        .describe("Joins multiple joining Path names seperated by ','");
    421432
    422433      /*
    423       if( !strcmp( element->Value(), "SavePoint"))
    424         {
    425           PRINTF(5)("Loaded Savepoint\n");
    426           setSavePoint();
     434        if( !strcmp( element->Value(), "Fork"))
     435        {
     436        container = element->FirstChild();
     437        if( container->ToText())
     438        {
     439        assert( container->Value() != NULL);
     440        PRINTF(4)("Loaded Fork: %s\n", container->Value());
     441        forkS(container->Value());
     442        }
    427443        }
    428444      */
    429       if( !strcmp( element->Value(), "Fork"))
    430         {
    431           container = element->FirstChild();
    432           if( container->ToText())
    433             {
    434               assert( container->Value() != NULL);
    435               PRINTF(4)("Loaded Fork: %s\n", container->Value());
    436               forkS(container->Value());
    437             }
    438         }
    439       else if( !strcmp( element->Value(), "Join"))
    440         {
    441           container = element->FirstChild();
    442           if( container->ToText())
    443             {
    444               assert( container->Value() != NULL);
    445               PRINTF0("Loaded Join: %s\n", container->Value());
    446               joinS(container->Value());
    447             }
    448         }
    449       else if( !strcmp( element->Value(), "WorkOn"))
    450         {
    451           container = element->FirstChild();
    452           if( container->ToText())
    453             {
    454               assert( container->Value() != NULL);
    455               PRINTF(4)("Loaded WorkOn: %s\n", container->Value());
    456               workOn( container->Value());
    457             }
    458         }
    459                
     445      /*
     446        if( !strcmp( element->Value(), "Join"))
     447        {
     448        container = element->FirstChild();
     449        if( container->ToText())
     450        {
     451        assert( container->Value() != NULL);
     452        PRINTF0("Loaded Join: %s\n", container->Value());
     453        joinS(container->Value());
     454        }
     455        }
     456      */       
    460457      element = element->NextSiblingElement();
    461458    }
     
    545542   \param trackName the Name of the Track to work on
    546543*/
    547 void TrackManager::workOn(const char* trackName)
     544void TrackManager::workOnS(const char* trackName)
    548545{
    549546  TrackElement* tmpElem = this->firstTrackElem->findByName(trackName);
     
    658655   \todo this must be better
    659656*/
    660 void TrackManager::setSavePoint(int isLoadable)
    661 {
    662   this->setSavePoint();
     657void TrackManager::setSavePointS(const char* nextElementName)
     658{
     659  this->firstTrackElem->findByID(this->setSavePoint(NULL))->setName(nextElementName);
    663660}
    664661
     
    743740    {
    744741      this->firstTrackElem->findByID(trackIDs[i])->setName(strings.getString(i));
    745     } 
     742    }
     743  delete []trackIDs;
    746744}
    747745
  • orxonox/trunk/src/util/track/track_manager.h

    r4496 r4501  
    146146  // Methods to change the Path (initialisation)
    147147  void workOn(unsigned int trackID);
    148   void workOn(const char* trackName);
     148  void workOnS(const char* trackName);
    149149
    150150  /** \see setCurveType(CurveType curveType, TrackElement* trackElem); \param curveType the type of the Curve */
     
    156156  void addPointV(Vector newPoint, TrackElement* trackElem = NULL);
    157157  int addHotPoint(Vector newPoint, TrackElement* trackElem = NULL);
    158   void setSavePoint(int isLoadable);
     158  void setSavePointS(const char* nextElementName);
    159159  int setSavePoint(TrackElement* trackElem = NULL);
    160160  void fork(unsigned int count, ...);
Note: See TracChangeset for help on using the changeset viewer.