Changeset 6293 in orxonox.OLD for branches/network/src
- Timestamp:
- Dec 26, 2005, 1:36:19 AM (19 years ago)
- Location:
- branches/network/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/world_entities/world_entity.cc
r6291 r6293 58 58 59 59 this->toList(OM_NULL); 60 61 modelFileName = NULL;62 60 } 63 61 … … 76 74 77 75 State::getObjectManager()->toList(this, OM_INIT); 78 79 if ( modelFileName )80 delete modelFileName;81 76 } 82 77 … … 106 101 void WorldEntity::loadModel(const char* fileName, float scaling, unsigned int modelNumber) 107 102 { 108 this->modelNumber = modelNumber;109 this->modelScaling = scaling;110 111 103 if ( fileName != NULL && strcmp(fileName, "") ) 112 104 { 113 if ( modelFileName )114 delete modelFileName;115 modelFileName = new char[strlen(fileName)+1];116 strcpy( modelFileName, fileName );117 105 // search for the special character # in the LoadParam 118 106 if (strchr(fileName, '#') != NULL) … … 142 130 else 143 131 { 144 if ( modelFileName )145 delete modelFileName;146 modelFileName = new char[1];147 strcpy( modelFileName, "" );148 132 this->setModel(NULL); 149 133 } … … 353 337 void WorldEntity::writeState( const byte * data, int length, int sender ) 354 338 { 339 char* modelFileName; 355 340 SYNCHELP_READ_BEGIN(); 356 341 SYNCHELP_READ_STRINGM( modelFileName ); 357 SYNCHELP_READ_FLOAT( modelScaling ); 358 SYNCHELP_READ_INT( modelNumber ); 342 PRINTF(0)("%s\n", modelFileName ); 359 343 loadModel( modelFileName ); 344 delete modelFileName; 360 345 } 361 346 … … 369 354 { 370 355 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()); 374 358 return SYNCHELP_WRITE_N; 375 359 } -
branches/network/src/world_entities/world_entity.h
r6291 r6293 88 88 OM_LIST objectListNumber; //!< The ObjectList from ObjectManager this Entity is in. 89 89 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;93 90 94 91
Note: See TracChangeset
for help on using the changeset viewer.