Changeset 6341 in orxonox.OLD for trunk/src/world_entities/skybox.cc
- Timestamp:
- Dec 30, 2005, 1:57:12 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/skybox.cc
r6307 r6341 22 22 #include "static_model.h" 23 23 #include "material.h" 24 #include "network_game_manager.h" 25 #include "converter.h" 24 26 25 27 using namespace std; … … 77 79 } 78 80 this->setParentMode(PNODE_MOVEMENT); 81 82 this->textureName = NULL; 79 83 } 80 84 … … 208 212 this->setModel(model); 209 213 } 214 215 int SkyBox::writeBytes( const byte * data, int length, int sender ) 216 { 217 setRequestedSync( false ); 218 setIsOutOfSync( false ); 219 220 SYNCHELP_READ_BEGIN(); 221 222 SYNCHELP_READ_FKT( WorldEntity::writeState ); 223 224 SYNCHELP_READ_FLOAT( size ); 225 if ( textureName ) 226 { 227 delete[] textureName; 228 textureName = NULL; 229 } 230 SYNCHELP_READ_STRINGM( textureName ); 231 232 PRINT(0)("GOT DATA: size=%f texture='%s'\n", size, textureName); 233 234 this->setSize( size ); 235 this->setTextureAndType( textureName, "jpg" ); 236 this->rebuild(); 237 238 return SYNCHELP_READ_N; 239 } 240 241 242 243 int SkyBox::readBytes( byte * data, int maxLength, int * reciever ) 244 { 245 if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() ) 246 { 247 (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() ); 248 setRequestedSync( true ); 249 } 250 251 int rec = this->getRequestSync(); 252 if ( rec > 0 ) 253 { 254 PRINT(0)("SEND DATA: size=%f texture='%s'\n", size, textureName); 255 *reciever = rec; 256 257 SYNCHELP_WRITE_BEGIN(); 258 259 SYNCHELP_WRITE_FKT( WorldEntity::readState ); 260 261 SYNCHELP_WRITE_FLOAT(this->size); 262 SYNCHELP_WRITE_STRING(this->textureName); 263 264 return SYNCHELP_WRITE_N; 265 } 266 267 *reciever = 0; 268 return 0; 269 } 270 271 void SkyBox::writeDebug( ) const 272 { 273 } 274 275 void SkyBox::readDebug( ) const 276 { 277 }
Note: See TracChangeset
for help on using the changeset viewer.