Changeset 3557 in orxonox.OLD for orxonox/branches/levelloader/src/world_entities
- Timestamp:
- Mar 15, 2005, 10:53:46 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/levelloader/src/world_entities/environment.cc
r3542 r3557 35 35 Environment::Environment ( TiXmlElement* root) 36 36 { 37 assert( root != NULL); 38 37 39 char* temp; 38 40 const char* string = grabParameter( root, "name"); 41 39 42 if( string == NULL) 40 43 { 41 PRINTF (1)("Environment is missing a proper 'name'\n");44 PRINTF0("Environment is missing a proper 'name'\n"); 42 45 string = "Unknown"; 43 temp = new char[strlen(string + 2)]; 44 strcpy( temp, string); 45 this->setName( temp); 46 this->setName( string); 46 47 } 47 48 else 48 49 { 49 temp = new char[strlen(string + 2)]; 50 strcpy( temp, string); 51 this->setName( temp); 50 this->setName( string); 52 51 } 53 52 … … 58 57 else 59 58 { 60 PRINTF (1)("Environment is missing a proper 'model'\n");59 PRINTF0("Environment is missing a proper 'model'\n"); 61 60 this->model = new OBJModel( "../data/models/reaplow.obj"); 62 61 } 63 62 if( this->model == NULL) 64 63 { 65 PRINTF (1)("Environment model '%s' could not be loaded\n", string);64 PRINTF0("Environment model '%s' could not be loaded\n", string); 66 65 } 67 66 … … 69 68 70 69 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) 72 71 { 73 72 Vector* es = new Vector( buff[0], buff[1], buff[2]); … … 77 76 else 78 77 { 79 PRINTF (1)("Environment is missing a proper 'position'\n");78 PRINTF0("Environment is missing a proper 'position'\n"); 80 79 Vector* es = new Vector(); 81 80 this->setAbsCoor(es); 82 81 delete es; 83 82 } 84 83 85 84 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) 87 86 { 88 87 Quaternion* qs = new Quaternion( buff[0], buff[1], buff[2]); … … 92 91 else 93 92 { 94 PRINTF (1)("Environment is missing a proper 'orientation'\n");93 PRINTF0("Environment is missing a proper 'orientation'\n"); 95 94 Quaternion* qs = new Quaternion (); 96 95 this->setAbsDir(qs);
Note: See TracChangeset
for help on using the changeset viewer.