Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/levelloader/src/world_entities/environment.cc

    r3542 r3557  
    3535Environment::Environment ( TiXmlElement* root)
    3636{
     37        assert( root != NULL);
     38       
    3739        char* temp;
    3840        const char* string = grabParameter( root, "name");
     41
    3942        if( string == NULL)
    4043        {
    41                 PRINTF(1)("Environment is missing a proper 'name'\n");
     44                PRINTF0("Environment is missing a proper 'name'\n");
    4245                string = "Unknown";
    43                 temp = new char[strlen(string + 2)];
    44                 strcpy( temp, string);
    45                 this->setName( temp);
     46                this->setName( string);
    4647        }
    4748        else
    4849        {
    49                 temp = new char[strlen(string + 2)];
    50                 strcpy( temp, string);
    51                 this->setName( temp);
     50                this->setName( string);
    5251        }
    5352       
     
    5857        else
    5958        {
    60                 PRINTF(1)("Environment is missing a proper 'model'\n");
     59                PRINTF0("Environment is missing a proper 'model'\n");
    6160                this->model = new OBJModel( "../data/models/reaplow.obj");
    6261        }
    6362        if( this->model == NULL)
    6463        {
    65                 PRINTF(1)("Environment model '%s' could not be loaded\n", string);
     64                PRINTF0("Environment model '%s' could not be loaded\n", string);
    6665        }
    6766       
     
    6968       
    7069        string = grabParameter( root, "position");
    71         if( string != NULL && sscanf( string, "%f,%f,%f", &(buff[0]), &(buff[1]), &(buff[2])) == 3)
     70        if( string != NULL && sscanf( string, "%lf,%lf,%lf", &(buff[0]), &(buff[1]), &(buff[2])) == 3)
    7271        {
    7372                Vector* es = new Vector( buff[0], buff[1], buff[2]);
     
    7776        else
    7877        {
    79                 PRINTF(1)("Environment is missing a proper 'position'\n");
     78                PRINTF0("Environment is missing a proper 'position'\n");
    8079                Vector* es = new Vector();
    8180                this->setAbsCoor(es);
    8281                delete es;
    8382        }
    84        
     83               
    8584        string = grabParameter( root, "orientation");
    86         if( string != NULL && sscanf( string, "%f,%f,%f", &(buff[0]), &(buff[1]), &(buff[2])) == 3)
     85        if( string != NULL && sscanf( string, "%lf,%lf,%lf", &(buff[0]), &(buff[1]), &(buff[2])) == 3)
    8786        {
    8887                Quaternion* qs = new Quaternion( buff[0], buff[1], buff[2]);
     
    9291        else
    9392        {
    94                 PRINTF(1)("Environment is missing a proper 'orientation'\n");
     93                PRINTF0("Environment is missing a proper 'orientation'\n");
    9594        Quaternion* qs = new Quaternion ();
    9695                this->setAbsDir(qs);
Note: See TracChangeset for help on using the changeset viewer.