Changeset 7444 in orxonox.OLD for branches/network/src/world_entities/skybox.cc
- Timestamp:
- Apr 29, 2006, 1:57:48 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/world_entities/skybox.cc
r7328 r7444 95 95 { 96 96 this->rebuild(); 97 98 textureName_handle = registerVarId( new SynchronizeableString( &textureName, &textureName, "textureName") ); 99 size_handle = registerVarId( new SynchronizeableFloat( &size, &size, "size" ) ); 97 100 } 98 101 … … 292 295 } 293 296 294 int SkyBox::writeBytes( const byte * data, int length, int sender ) 295 { 296 setRequestedSync( false ); 297 setIsOutOfSync( false ); 298 299 SYNCHELP_READ_BEGIN(); 300 301 SYNCHELP_READ_FKT( WorldEntity::writeState, NWT_SB_WE_STATE ); 302 303 SYNCHELP_READ_FLOAT( size, NWT_SB_SIZE ); 304 if ( !this->textureName.empty() ) 305 { 306 textureName = ""; 307 } 308 std::string texName; 309 SYNCHELP_READ_STRING( texName, NWT_SB_TEXTURENAME ); 310 311 this->setSize( size ); 312 this->setTextureAndType( texName, "jpg" ); 313 this->rebuild(); 314 315 return SYNCHELP_READ_N; 316 } 317 318 319 320 int SkyBox::readBytes( byte * data, int maxLength, int * reciever ) 321 { 322 if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() ) 323 { 324 (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() ); 325 setRequestedSync( true ); 326 } 327 328 int rec = this->getRequestSync(); 329 if ( rec > 0 ) 330 { 331 *reciever = rec; 332 333 SYNCHELP_WRITE_BEGIN(); 334 335 SYNCHELP_WRITE_FKT( WorldEntity::readState, NWT_SB_WE_STATE ); 336 337 SYNCHELP_WRITE_FLOAT(this->size, NWT_SB_SIZE); 338 SYNCHELP_WRITE_STRING(this->textureName, NWT_SB_TEXTURENAME); 339 340 return SYNCHELP_WRITE_N; 341 } 342 343 *reciever = 0; 344 return 0; 345 } 346 347 void SkyBox::writeDebug( ) const 348 { 349 } 350 351 void SkyBox::readDebug( ) const 352 { 353 } 297 void SkyBox::varChangeHandler( std::list< int > & id ) 298 { 299 #warning implement this 300 }
Note: See TracChangeset
for help on using the changeset viewer.