Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6293 in orxonox.OLD for branches


Ignore:
Timestamp:
Dec 26, 2005, 1:36:19 AM (19 years ago)
Author:
rennerc
Message:
 
Location:
branches/network/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/world_entities/world_entity.cc

    r6291 r6293  
    5858
    5959  this->toList(OM_NULL);
    60 
    61   modelFileName = NULL;
    6260}
    6361
     
    7674
    7775  State::getObjectManager()->toList(this, OM_INIT);
    78 
    79   if ( modelFileName )
    80   delete modelFileName;
    8176}
    8277
     
    106101void WorldEntity::loadModel(const char* fileName, float scaling, unsigned int modelNumber)
    107102{
    108   this->modelNumber = modelNumber;
    109   this->modelScaling = scaling;
    110 
    111103  if ( fileName != NULL && strcmp(fileName, "") )
    112104  {
    113     if ( modelFileName )
    114     delete modelFileName;
    115     modelFileName = new char[strlen(fileName)+1];
    116     strcpy( modelFileName, fileName );
    117105    // search for the special character # in the LoadParam
    118106    if (strchr(fileName, '#') != NULL)
     
    142130  else
    143131  {
    144     if ( modelFileName )
    145     delete modelFileName;
    146     modelFileName = new char[1];
    147     strcpy( modelFileName, "" );
    148132    this->setModel(NULL);
    149133  }
     
    353337void WorldEntity::writeState( const byte * data, int length, int sender )
    354338{
     339  char* modelFileName;
    355340  SYNCHELP_READ_BEGIN();
    356341  SYNCHELP_READ_STRINGM( modelFileName );
    357   SYNCHELP_READ_FLOAT( modelScaling );
    358   SYNCHELP_READ_INT( modelNumber );
     342  PRINTF(0)("%s\n", modelFileName );
    359343  loadModel( modelFileName );
     344  delete modelFileName;
    360345}
    361346
     
    369354{
    370355  SYNCHELP_WRITE_BEGIN();
    371   SYNCHELP_WRITE_STRING( modelFileName );
    372   SYNCHELP_WRITE_FLOAT( modelScaling );
    373   SYNCHELP_WRITE_INT( modelNumber );
     356  SYNCHELP_WRITE_STRING( getModel( 0 )->getName() );
     357  PRINTF(0)("%s\n", getModel( 0 )->getName());
    374358  return SYNCHELP_WRITE_N;
    375359}
  • branches/network/src/world_entities/world_entity.h

    r6291 r6293  
    8888  OM_LIST                           objectListNumber;   //!< The ObjectList from ObjectManager this Entity is in.
    8989  std::list<WorldEntity*>::iterator objectListIterator; //!< The iterator position of this Entity in the given list of the ObjectManager.
    90   char*                   modelFileName;
    91   int                     modelNumber;
    92   float                   modelScaling;
    9390
    9491
Note: See TracChangeset for help on using the changeset viewer.