Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 13, 2005, 10:40:25 PM (19 years ago)
Author:
chris
Message:

orxonox/branches/levelloader: Got the system to compile, the basic backbone now runs. What remains to be done is implementing all necessary functions to load all vital classes into a world

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/levelloader/src/track_manager.cc

    r3525 r3530  
    112112{
    113113  // return if Found.
    114   if ( this->name != NULL && !strcmp( this->name, trackname))
     114  if ( this->name != NULL && !strcmp( this->name, trackName))
    115115    return this;
    116116  // search on.
     
    160160  PRINTF(3)("Deleting all the TrackElements\n");
    161161  delete this->firstTrackElem;
    162   delete this->namer;
     162  // delete this->name;
    163163
    164164  // we do not have a TrackManager anymore
     
    196196                if( this->findTrackElementByName( names->getString(i)))
    197197                {
    198                         PRINTF(ERR)("Track name '%s' already taken
     198                        PRINTF(1)("Track name '%s' already taken", names->getString(i));
    199199                }
    200200            }
     
    699699        while( element != NULL)
    700700        {
    701                 if( !strcmp( element->Value(), "Point")
     701                if( !strcmp( element->Value(), "Point"))
    702702                {
    703703                        container = element->FirstChild();
    704                         if( container != NULL && container->Type() == TEXT)
     704                        if( container->ToText())
    705705                        {
    706706                                assert( container->Value() != NULL);
     
    709709                                else
    710710                                {
    711                                         PRINTF(ERR)("Invalid Point in Track (skipped)\n");
     711                                        PRINTF(1)("Invalid Point in Track (skipped)\n");
    712712                                }                       
    713713                        }
    714714                }
    715                 else if( !strcmp( element->Value(), "Duration")
     715                else if( !strcmp( element->Value(), "Duration"))
    716716                {
    717717                        container = element->FirstChild();
    718                         if( container != NULL && container->Type() == TEXT)
     718                        if( container->ToText())
    719719                        {
    720720                                assert( container->Value() != NULL);
     
    723723                                else
    724724                                {
    725                                         PRINTF(ERR)("Invalid Duration in Track (skipped)\n");
     725                                        PRINTF(1)("Invalid Duration in Track (skipped)\n");
    726726                                }                       
    727727                        }
    728728                }
    729                 else if( !strcmp( element->Value(), "SavePoint")
     729                else if( !strcmp( element->Value(), "SavePoint"))
    730730                {
    731731                        setSavePoint();
    732732                }
    733                 else if( !strcmp( element->Value(), "Fork")
     733                else if( !strcmp( element->Value(), "Fork"))
    734734                {
    735735                        container = element->FirstChild();
    736                         if( container != NULL && container->Type() == TEXT)
     736                        if( container->ToText())
    737737                        {
    738738                                assert( container->Value() != NULL);
     
    740740                        }
    741741                }
    742                 else if( !strcmp( element->Value(), "Join")
     742                else if( !strcmp( element->Value(), "Join"))
    743743                {
    744744                        container = element->FirstChild();
    745                         if( container != NULL && container->Type() == TEXT)
     745                        if( container->ToText())
    746746                        {
    747747                                assert( container->Value() != NULL);
     
    749749                        }
    750750                }
    751                 else if( !strcmp( element->Value(), "WorkOn")
     751                else if( !strcmp( element->Value(), "WorkOn"))
    752752                {
    753753                        container = element->FirstChild();
    754                         if( container != NULL && container->Type() == TEXT)
     754                        if( container->ToText())
    755755                        {
    756756                                assert( container->Value() != NULL);
     
    769769   The names used have to be unique within a particular track system.
    770770*/
    771 void TrackManager::forkS( char* string)
     771void TrackManager::forkS( const char* string)
    772772{
    773773        // get the names for the tracks and therefore the amount of new tracks
    774         SubString* names = new SubString( string);
     774        SubString* parts = new SubString( string);
    775775        int *IDs;
    776776        int n = parts->getN();
     
    780780        IDs = new int[n];
    781781       
    782         forkV( n, IDs, names);
     782        forkV( n, IDs, parts);
    783783       
    784784        // IDs are irrelevant when assigning string names to tracks
    785785        delete IDs;
    786         delete names;
     786        delete parts;
    787787}
    788788
     
    791791   \param string the names of the track to be joined, separated by commas
    792792*/
    793 void TrackManager::joinS( char* string)
     793void TrackManager::joinS( const char* string)
    794794{
    795795        SubString* parts = new SubString( string);
     
    805805        t = n;
    806806       
    807         PRINTF(DEBUG)("Joining tracks:");
     807        PRINTF(4)("Joining tracks:");
    808808       
    809809        for( int i = 0; i < n; i++)
     
    812812                if( element == NULL)
    813813                {
    814                         PRINTF(ERR)("Track name '%s' unknown, could not join\n", parts->getString( i));
     814                        PRINTF(1)("Track name '%s' unknown, could not join\n", parts->getString( i));
    815815                        t--;
    816816                }
    817817                else
    818818                {
    819                         PRINTF(DEBUG)(" '%s'(%d)", parts->getString( i), element->ID);
     819                        PRINTF(4)(" '%s'(%d)", parts->getString( i), element->ID);
    820820                        IDs[d] = element->ID;
    821821                        d++;
     
    823823        }
    824824       
    825         PRINTF(DEBUG)("\n");
     825        PRINTF(4)("\n");
    826826
    827827        joinV( t, IDs);
     
    835835   \param string the name of the track to work on (must have been previosly set by forkS)
    836836*/
    837 void TrackManager::workOnS( char* string)
     837void TrackManager::workOnS( const char* string)
    838838{
    839839  TrackElement* tmpElem = findTrackElementByName( string);
     
    841841    this->currentTrackElem = tmpElem;
    842842  else
    843     PRINTF(ERR)("TrackElement not Found, leaving unchanged\n");
    844   PRINTF(DEBUG)("now Working on %d\n", this->currentTrackElem->ID);
    845 }
     843    PRINTF(1)("TrackElement not Found, leaving unchanged\n");
     844  PRINTF(4)("now Working on %d\n", this->currentTrackElem->ID);
     845}
Note: See TracChangeset for help on using the changeset viewer.