Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4104 in orxonox.OLD for orxonox/trunk/src/story_entities/world.cc


Ignore:
Timestamp:
May 7, 2005, 1:55:44 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: loadScreen now loadable as well

File:
1 edited

Legend:

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

    r4099 r4104  
    268268ErrorMessage World::load()
    269269{       
    270   PRINTF(0)("> Loading world: '%s'\n", getPath());
    271  
     270  PRINTF(3)("> Loading world: '%s'\n", getPath());
     271  TiXmlElement* element;
    272272  GameLoader* loader = GameLoader::getInstance();
    273273 
    274274  if( getPath() == NULL)
    275275    {
    276       PRINTF0("World has no path specified for loading");
     276      PRINTF(1)("World has no path specified for loading");
    277277      return (ErrorMessage){213,"Path not specified","World::load()"};
    278278    }
     
    280280  TiXmlDocument* XMLDoc = new TiXmlDocument( path);
    281281  // load the campaign document
    282   if( !XMLDoc->LoadFile())
    283     //this->glmis->step();
    284  
     282  if( !XMLDoc->LoadFile()) 
    285283  {
    286284    // report an error
    287     PRINTF0("Error loading XML File: %s @ %d:%d\n", XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
     285    PRINTF(1)("loading XML File: %s @ %d:%d\n", XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
    288286    delete XMLDoc;
    289287    return (ErrorMessage){213,"XML File parsing error","World::load()"};
     
    297295    {
    298296      // report an error
    299       PRINTF0("Specified XML File is not an orxonox world data file (WorldDataFile element missing)\n");
     297      PRINTF(1)("Specified XML File is not an orxonox world data file (WorldDataFile element missing)\n");
    300298      delete XMLDoc;
    301299      return (ErrorMessage){213,"Path not a WorldDataFile","World::load()"};
     
    308306  if( string == NULL)
    309307    {
    310       PRINTF0("World is missing a proper 'name'\n");
     308      PRINTF(2)("World is missing a proper 'name'\n");
    311309      string = "Unknown";
    312310      temp = new char[strlen(string + 2)];
     
    320318      this->worldName = temp;
    321319    }
    322  
    323  
     320  ////////////////
     321  // LOADSCREEN //
     322  ////////////////
     323  element = root->FirstChildElement("LoadScreen");
     324  if (element == NULL)
     325    {
     326      PRINTF(2)("no LoadScreen specified, loading default\n");
     327
     328      glmis->setBackgroundImage("pictures/load_screen.jpg");
     329      this->glmis->setMaximum(8);
     330      this->glmis->draw();
     331    }
     332  else
     333    {
     334      this->glmis->load(element);
     335      this->glmis->draw();
     336    }
     337  this->glmis->draw();
    324338  // find WorldEntities
    325   TiXmlElement* element = root->FirstChildElement( "WorldEntities");
     339  element = root->FirstChildElement("WorldEntities");
    326340 
    327341  if( element == NULL)
    328342    {
    329       PRINTF0("World is missing 'WorldEntities'\n");
     343      PRINTF(1)("World is missing 'WorldEntities'\n");
    330344    }
    331345  else
     
    333347      element = element->FirstChildElement();
    334348      // load Players/Objects/Whatever
    335       PRINTF0("Loading WorldEntities\n");
     349      PRINTF(4)("Loading WorldEntities\n");
    336350      while( element != NULL)
    337351        {
     
    345359          glmis->step(); //! \todo temporary
    346360        }
    347       PRINTF0("Done loading WorldEntities\n");
     361      PRINTF(4)("Done loading WorldEntities\n");
    348362    }
    349363 
     
    831845  glmis->setBackgroundImage("pictures/load_screen.jpg");
    832846  this->glmis->setMaximum(8);
    833   this->glmis->draw();
     847  //  this->glmis->draw();
    834848 
    835849  PRINTF(3)("World::displayLoadScreen - end\n");
Note: See TracChangeset for help on using the changeset viewer.