Changeset 4217 in orxonox.OLD for orxonox/branches/movie_player/src/world_entities/player.cc
- Timestamp:
- May 18, 2005, 11:27:40 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/movie_player/src/world_entities/player.cc
r4010 r4217 82 82 Player::Player(TiXmlElement* root) : WorldEntity(root) 83 83 { 84 /*85 char* temp;86 const char* string;87 string = grabParameter( root, "name");88 if( string == NULL)89 {90 PRINTF0("Player is missing a proper 'name'\n");91 string = "Unknown";92 temp = new char[strlen(string + 2)];93 strcpy( temp, string);94 this->setName( temp);95 }96 else97 {98 temp = new char[strlen(string + 2)];99 strcpy( temp, string);100 this->setName( temp);101 }102 103 this->model = NULL;104 string = grabParameter( root, "model");105 if( string != NULL)106 this->model = (Model*)ResourceManager::getInstance()->load(string, OBJ, RP_CAMPAIGN);107 else108 {109 PRINTF0("Player is missing a proper 'model'\n");110 this->model = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj", OBJ, RP_CAMPAIGN);111 }112 if( this->model == NULL)113 {114 PRINTF0("Player model '%s' could not be loaded\n", string);115 }116 */117 84 this->weapons = new tList<Weapon>(); 118 85 this->activeWeapon = NULL; … … 294 261 { 295 262 PRINTF(3)("recieved command [%s]\n", cmd->cmd); 296 if( !strcmp( cmd->cmd, "up")) this->bUp = !cmd->bUp;297 if( !strcmp( cmd->cmd, "down")) this->bDown = !cmd->bUp;298 if( !strcmp( cmd->cmd, "left")) this->bLeft = !cmd->bUp;299 if( !strcmp( cmd->cmd, "right")) this->bRight = !cmd->bUp;300 if( !strcmp( cmd->cmd, "fire")) this->bFire = !cmd->bUp;301 if( !strcmp( cmd->cmd, "mode")) if(cmd->bUp) this->bWeaponChange = !this->bWeaponChange;302 } 263 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_UP)) this->bUp = !cmd->bUp; 264 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_DOWN)) this->bDown = !cmd->bUp; 265 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_LEFT)) this->bLeft = !cmd->bUp; 266 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_RIGHT)) this->bRight = !cmd->bUp; 267 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_FIRE)) this->bFire = !cmd->bUp; 268 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_NEXT_WEAPON)) if(cmd->bUp) this->bWeaponChange = !this->bWeaponChange; 269 }
Note: See TracChangeset
for help on using the changeset viewer.