Changeset 4114 in orxonox.OLD for orxonox/trunk/src/world_entities
- Timestamp:
- May 7, 2005, 10:02:57 PM (20 years ago)
- Location:
- orxonox/trunk/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/player.cc
r4091 r4114 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; -
orxonox/trunk/src/world_entities/world_entity.cc
r4013 r4114 30 30 /** 31 31 \brief standard constructor 32 33 Every derived contructor HAS to call the previous one supplying the isFree parameter. This is necessary to distunguish34 between free and bound entities. The difference between them is simply the fact that the movement of a free entity is35 not bound to the track of a world. Use this to implement projectile or effect classes that do not have to travel along the track.36 To specify an entity to be free or bound set the default parameter in the declaration of the constructor.37 Theoretically you should never have to call the constructor of an Entity directly, for it is called by the spawn() function of the World38 class. So if you want to create a new entity at any time, call World::spawn(). It will handle everything that is necessary.39 32 */ 40 33 WorldEntity::WorldEntity () … … 46 39 } 47 40 41 /** 42 \brief Loads the WordEntity-specific Part of any derived Class 43 */ 48 44 WorldEntity::WorldEntity(TiXmlElement* root) 49 45 { … … 54 50 if( string == NULL) 55 51 { 56 PRINTF( 0)("WorldEntity is missing a proper 'name'\n");52 PRINTF(2)("WorldEntity is missing a proper 'name'\n"); 57 53 string = "Unknown"; 58 54 temp = new char[strlen(string + 2)]; … … 69 65 this->model = NULL; 70 66 string = grabParameter( root, "model"); 67 printf("::::::::::::::::::::::string is %s\n", string); 71 68 if( string != NULL) 72 69 this->model = (Model*)ResourceManager::getInstance()->load(string, OBJ, RP_CAMPAIGN); 73 70 else 74 71 { 75 PRINTF( 0)("WorldEntity is missing a proper 'model'\n");72 PRINTF(2)("WorldEntity is missing a proper 'model'\n"); 76 73 this->model = NULL; 77 74 } 78 75 if( this->model == NULL) 79 76 { 80 PRINTF(0)("WorldEntity model '%s' could not be loaded\n", string); 81 } 82 77 PRINTF(2)("WorldEntity model '%s' could not be loaded\n", string); 78 } 83 79 this->bDraw = true; 84 80 }
Note: See TracChangeset
for help on using the changeset viewer.