Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 28, 2005, 1:06:09 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches/ll2trunktemp: now WorldEntity loads model property

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/ll2trunktemp/src/world_entities/player.cc

    r3998 r4002  
    8282   \todo add more parameters to load
    8383*/
    84 Player::Player(TiXmlElement* root)
    85 {
    86         char* temp;
    87         const char* string;
    88         string = grabParameter( root, "name");
    89         if( string == NULL)
    90         {
    91                 PRINTF0("Player is missing a proper 'name'\n");
    92                 string = "Unknown";
    93                 temp = new char[strlen(string + 2)];
    94                 strcpy( temp, string);
    95                 this->setName( temp);
    96         }
    97         else
    98         {
    99                 temp = new char[strlen(string + 2)];
    100                 strcpy( temp, string);
    101                 this->setName( temp);
    102         }
    103        
    104         this->model = NULL;
    105         string = grabParameter( root, "model");
    106         if( string != NULL)
    107         this->model = (Model*)ResourceManager::getInstance()->load(string, OBJ, RP_CAMPAIGN);
    108         else
    109         {
    110                 PRINTF0("Player is missing a proper 'model'\n");
    111         this->model = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj", OBJ, RP_CAMPAIGN);
    112         }
    113         if( this->model == NULL)
    114         {
    115                 PRINTF0("Player model '%s' could not be loaded\n", string);
    116         }
    117        
    118         this->weapons = new tList<Weapon>();
     84Player::Player(TiXmlElement* root) : WorldEntity(root)
     85{
     86  /*
     87    char* temp;
     88    const char* string;
     89    string = grabParameter( root, "name");
     90    if( string == NULL)
     91    {
     92    PRINTF0("Player is missing a proper 'name'\n");
     93    string = "Unknown";
     94    temp = new char[strlen(string + 2)];
     95    strcpy( temp, string);
     96    this->setName( temp);
     97    }
     98    else
     99    {
     100    temp = new char[strlen(string + 2)];
     101    strcpy( temp, string);
     102    this->setName( temp);
     103    }
     104   
     105    this->model = NULL;
     106    string = grabParameter( root, "model");
     107    if( string != NULL)
     108    this->model = (Model*)ResourceManager::getInstance()->load(string, OBJ, RP_CAMPAIGN);
     109    else
     110    {
     111    PRINTF0("Player is missing a proper 'model'\n");
     112    this->model = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj", OBJ, RP_CAMPAIGN);
     113    }
     114    if( this->model == NULL)
     115    {
     116    PRINTF0("Player model '%s' could not be loaded\n", string);
     117    }
     118  */
     119  this->weapons = new tList<Weapon>();
    119120  this->activeWeapon = NULL;
    120121  /*
Note: See TracChangeset for help on using the changeset viewer.