| 322 | } |
| 323 | |
| 324 | void LightBase::unpackUpdate( NetConnection *conn, BitStream *stream ) |
| 325 | { |
| 326 | Parent::unpackUpdate( conn, stream ); |
| 327 | |
| 328 | mIsEnabled = stream->readFlag(); |
| 329 | |
| 330 | if ( stream->readFlag() ) // TransformMask |
| 331 | stream->readAffineTransform( &mObjToWorld ); |
| 332 | |
| 333 | if ( stream->readFlag() ) // UpdateMask |
| 334 | { |
| 335 | stream->read( &mColor ); |
| 336 | stream->read( &mBrightness ); |
| 337 | mCastShadows = stream->readFlag(); |
| 338 | stream->read(&mStaticRefreshFreq); |
| 339 | stream->read(&mDynamicRefreshFreq); |
| 340 | |
| 341 | stream->read( &mPriority ); |
| 342 | |
| 343 | mLight->unpackExtended( stream ); |
| 344 | |
| 345 | mAnimState.active = stream->readFlag(); |
| 346 | stream->read( &mAnimState.animationPeriod ); |
| 347 | stream->read( &mAnimState.animationPhase ); |
| 348 | stream->read( &mFlareScale ); |
| 349 | } |
| 350 | |
| 351 | if ( stream->readFlag() ) // DatablockMask |
| 352 | { |
| 353 | if ( stream->readFlag() ) |
| 354 | { |
| 355 | SimObjectId id = stream->readRangedU32( DataBlockObjectIdFirst, DataBlockObjectIdLast ); |
| 356 | LightAnimData *datablock = NULL; |
| 357 | |
| 358 | if ( Sim::findObject( id, datablock ) ) |
| 359 | mAnimationData = datablock; |
| 360 | else |
| 361 | { |
| 362 | conn->setLastError( "Light::unpackUpdate() - invalid LightAnimData!" ); |
| 363 | mAnimationData = NULL; |
| 364 | } |
| 365 | } |
| 366 | else |
| 367 | mAnimationData = NULL; |
| 368 | |
| 369 | if ( stream->readFlag() ) |
| 370 | { |
| 371 | SimObjectId id = stream->readRangedU32( DataBlockObjectIdFirst, DataBlockObjectIdLast ); |
| 372 | LightFlareData *datablock = NULL; |
| 373 | |
| 374 | if ( Sim::findObject( id, datablock ) ) |
| 375 | mFlareData = datablock; |
| 376 | else |
| 377 | { |
| 378 | conn->setLastError( "Light::unpackUpdate() - invalid LightCoronaData!" ); |
| 379 | mFlareData = NULL; |
| 380 | } |
| 381 | } |
nothing calls this directly
no test coverage detected