Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3562 in orxonox.OLD for orxonox/branches/levelloader/src


Ignore:
Timestamp:
Mar 15, 2005, 6:01:21 PM (20 years ago)
Author:
chris
Message:

orxonox/branches/levelloader: Managed to get through the whole loading sequence… still not generating a valid world though…

Location:
orxonox/branches/levelloader/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/levelloader/src/lib/util/substring.cc

    r3530 r3562  
    3434        strings = new char*[n];
    3535       
     36        assert( strings != NULL);
     37       
    3638        int i = 0;
    3739        int l = 0;
     
    4143        while( end != NULL)
    4244        {
     45                assert( i < n);
    4346                l = end - offset;
    4447                strings[i] = new char[l + 1];
     48                assert( strings[i] != NULL);
    4549                strncpy( strings[i], offset, l);
     50                strings[i][l] = 0;
    4651                i++;
    4752                end++;
    4853                offset = end;
    49                 end = strchr( string, ',');
     54                end = strchr( offset, ',');
    5055        }
    5156       
    5257        strings[i] = new char[l + 1];
     58        l = strlen( offset);
    5359        strncpy( strings[i], offset, l);
    54         l = strlen( offset);
     60        strings[i][l] = 0;
    5561}
    5662
  • orxonox/branches/levelloader/src/track_manager.cc

    r3557 r3562  
    192192  for (int i=0; i<childCount; i++)
    193193    {
    194         if( names != NULL)
    195         {
    196                 if( this->findTrackElementByName( names->getString(i)))
    197                 {
    198                         PRINTF(1)("Track name '%s' already taken", names->getString(i));
    199                 }
    200             }
    201                
     194           
    202195      this->currentTrackElem->children[i] = new TrackElement();
    203196      this->currentTrackElem->children[i]->ID = ++trackElemCount;
    204197      this->currentTrackElem->children[i]->startingTime = this->currentTrackElem->endTime + this->currentTrackElem->jumpTime;
    205198      this->addPoint(this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount()), this->currentTrackElem->children[i]);
    206     }
     199        if( names != NULL)
     200        {
     201                // todo check for duplicate track names to avoid confusion
     202                /*if( this->findTrackElementByName( names->getString(i)) != NULL)
     203                        PRINTF0("Track name '%s' already taken", names->getString(i));
     204                else*/
     205                        this->currentTrackElem->children[i]->setName( names->getString(i));
     206            }
     207           
     208   }
    207209}
    208210
     
    377379  printf("Forking with %d children\n", count);
    378380  if (this->currentTrackElem->isSavePoint)
     381  {
     382        PRINTF0("Cannot fork a SavePoint - skipped\n");
    379383    return;
     384  }
    380385  this->currentTrackElem->isFork = true;
    381386  this->currentTrackElem->isHotPoint = true;
Note: See TracChangeset for help on using the changeset viewer.