Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 15, 2005, 10:53:46 AM (20 years ago)
Author:
chris
Message:

orxonox/branches/levelloader: Rolling toward bug-free-ness

Location:
orxonox/branches/levelloader/src/story_entities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/levelloader/src/story_entities/campaign.cc

    r3542 r3557  
    4242        int id;
    4343       
     44        PRINTF0("Loading Campaign...\n");
     45       
    4446        assert( root != NULL);
    4547        GameLoader* loader = GameLoader::getInstance();
     
    5254        if( string == NULL || sscanf(string, "%d", &id) != 1)
    5355        {
    54                 PRINTF(1)("Campaign is missing a proper 'identifier'\n");
     56                PRINTF0("Campaign is missing a proper 'identifier'\n");
    5557                this->setStoryID( -1);
    5658        }
     
    5961  // find WorldList
    6062  element = root->FirstChildElement( "WorldList");
     63  if( element == NULL)
     64  {
     65                PRINTF0("Campaign is missing a proper 'WorldList'\n");
     66  }
     67  else
     68        element = element->FirstChildElement();
    6169 
    6270  // load Worlds/Subcampaigns/Whatever
     
    8189}
    8290
    83 
    84 ErrorMessage Campaign::start()
    85 {
    86   this->start(0);
    87 }
    88 
    89 
    90 ErrorMessage Campaign::start(int storyID = 0)
    91 {
    92   printf("World::start() - starting new StoryEntity Nr:%i\n", storyID);
     91ErrorMessage Campaign::start(int storyID)
     92{
     93  printf("Camapaign::start() - starting new StoryEntity Nr:%i\n", storyID);
    9394  ErrorMessage errorCode;
    9495  if( !this->isInit) return errorCode;
     
    9798  StoryEntity* se = this->getStoryEntity(storyID);
    9899  this->currentEntity = se;
     100  if( se == NULL)
     101  {
     102        printf("Camapaign::start() - Start StoryEntity not found\n");
     103        return errorCode;
     104  }
    99105  while( se != NULL && this->running)
    100106    {
  • orxonox/branches/levelloader/src/story_entities/campaign.h

    r3530 r3557  
    1919
    2020  virtual ErrorMessage init();
    21   virtual ErrorMessage start();
    22   virtual ErrorMessage start(int storyID);
     21  virtual ErrorMessage start(int storyID = 0);
    2322  virtual ErrorMessage pause();
    2423  virtual ErrorMessage resume();
  • orxonox/branches/levelloader/src/story_entities/world.cc

    r3542 r3557  
    6868       
    6969        localPlayer = NULL;
     70  this->entities = new tList<WorldEntity>();
    7071               
    7172}
     
    142143{
    143144       
    144         PRINTF0("Loading world: '%s'\n", getPath());
     145        PRINTF0("> Loading world: '%s'\n", getPath());
    145146       
    146147        GameLoader* loader = GameLoader::getInstance();
     
    166167        assert( root != NULL);
    167168       
    168         TiXmlElement* element = root->FirstChildElement( "WorldDataFile");
    169        
    170         if( root == NULL )
     169        if( root == NULL || root->Value() == NULL || strcmp( root->Value(), "WorldDataFile"))
    171170        {
    172171                // report an error
     
    197196       
    198197        // find WorldEntities
    199   element = root->FirstChildElement( "WorldEntities");
     198  TiXmlElement* element = root->FirstChildElement( "WorldEntities");
    200199 
    201200  if( element == NULL)
     
    207206        element = element->FirstChildElement();
    208207          // load Players/Objects/Whatever
     208                PRINTF0("Loading WorldEntities\n");
    209209                while( element != NULL)
    210210                {
    211211                        WorldEntity* created = (WorldEntity*) loader->fabricate( element);
    212                         if( created != NULL) spawn( created);
    213                         assert( element->Value() != NULL);
     212                        if( created != NULL) this->spawn( created);
    214213                                // if we load a 'Player' we use it as localPlayer
    215                         if( !strcmp( element->Value(), "Player")) localPlayer = (Player*) created;
     214                        // if( element->Value() != NULL && !strcmp( element->Value(), "Player")) localPlayer = (Player*) created;
    216215                        element = element->NextSiblingElement();
    217216                }
     217                PRINTF0("Done loading WorldEntities\n");
    218218        }
    219219       
     
    227227  {     
    228228        //load track
    229         trackManager = TrackManager::getInstance();
     229                PRINTF0("Loading Track\n");
     230                trackManager = TrackManager::getInstance();
    230231        trackManager->loadTrack( element);
    231232        trackManager->finalize();
     233                PRINTF0("Done loading Track\n");
    232234        }
    233235
     
    495497  //gluNurbsProperty (theNurb, GLU_NURBS_MODE, GLU_NURBS_TESSELLATOR);
    496498  //gluNurbsProperty (theNurb, GLU_NURBS_VERTEX, vertexCallback );
    497 
     499       
     500        PRINTF0("> Done Loading world: '%s'\n", getPath());
    498501}
    499502
Note: See TracChangeset for help on using the changeset viewer.