Changeset 3542 in orxonox.OLD for orxonox/branches/levelloader/src/world_entities/player.cc
- Timestamp:
- Mar 14, 2005, 9:58:58 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/levelloader/src/world_entities/player.cc
r3499 r3542 22 22 23 23 using namespace std; 24 25 CREATE_FACTORY(Player); 24 26 25 27 /** … … 59 61 60 62 /** 63 \brief creates a new Player from Xml Data 64 \param root the xml element containing player data 65 66 \todo add more parameters to load 67 */ 68 Player::Player(TiXmlElement* root) 69 { 70 char* temp; 71 const char* string; 72 string = grabParameter( root, "name"); 73 if( string == NULL) 74 { 75 PRINTF(1)("Player is missing a proper 'name'\n"); 76 string = "Unknown"; 77 temp = new char[strlen(string + 2)]; 78 strcpy( temp, string); 79 this->setName( temp); 80 } 81 else 82 { 83 temp = new char[strlen(string + 2)]; 84 strcpy( temp, string); 85 this->setName( temp); 86 } 87 88 this->model = NULL; 89 string = grabParameter( root, "model"); 90 if( string != NULL) 91 this->model = new OBJModel( string); 92 else 93 { 94 PRINTF(1)("Player is missing a proper 'model'\n"); 95 this->model = new OBJModel( "../data/models/reaplow.obj"); 96 } 97 if( this->model == NULL) 98 { 99 PRINTF(1)("Player model '%s' could not be loaded\n", string); 100 } 101 } 102 103 /** 61 104 \brief destructs the player 62 105 */
Note: See TracChangeset
for help on using the changeset viewer.