Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 14, 2005, 9:58:58 AM (19 years ago)
Author:
chris
Message:

orxonox/branches/levelloader: First incarnation of a debugworld loaded from a XML-File in place, compilability in place, all necessary basic loading constuctors in place. Unfortunately the code still generates interferences with the old hardcoded debugworld resulting in SegFault crash.

File:
1 edited

Legend:

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

    r3530 r3542  
    161161  if( name == NULL)
    162162  {
    163                 PRINTF(1)("No filename specified for loading");
     163                PRINTF0("No filename specified for loading");
    164164                return NULL;
    165165  }
     
    170170        {
    171171                // report an error
    172                 PRINTF(1)("Error loading XML File: %s @ %d:%d\n", XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
     172                PRINTF0("Error loading XML File: %s @ %d:%d\n", XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
    173173                delete XMLDoc;
    174174                return NULL;
     
    176176       
    177177        // check basic validity
    178         TiXmlElement* element = XMLDoc->RootElement();
    179         assert( element != NULL);
    180        
    181         element = element->FirstChildElement( "Campaign");
    182        
    183         if( element == NULL )
     178        TiXmlElement* root = XMLDoc->RootElement();
     179        assert( root != NULL);
     180       
     181        if( strcmp( root->Value(), "Campaign"))
    184182        {
    185183                // report an error
    186                 PRINTF(1)("Specified XML File is not an orxonox campaign file (Campaign element missing)\n");
     184                PRINTF0("Specified XML File is not an orxonox campaign file (Campaign element missing)\n");
    187185                delete XMLDoc;
    188186                return NULL;
     
    190188       
    191189        // construct campaign
    192         Campaign* c = new Campaign( element);
     190        Campaign* c = new Campaign( root);
    193191       
    194192        // free the XML data
     
    272270        assert( factory != NULL);
    273271       
    274         printf("Registered factory for '%s'\n", factory->getClassname());
     272        PRINTF0("Registered factory for '%s'\n", factory->getClassname());
    275273       
    276274        if( first == NULL) first = factory;
     
    286284        if( first == NULL)
    287285        {
    288                 PRINTF(1)("GameLoader does not know any factories, fabricate() failed\n");
     286                PRINTF0("GameLoader does not know any factories, fabricate() failed\n");
    289287                return NULL;
    290288        }
Note: See TracChangeset for help on using the changeset viewer.