| 254 | } |
| 255 | |
| 256 | void Sun::unpackUpdate( NetConnection *conn, BitStream *stream ) |
| 257 | { |
| 258 | Parent::unpackUpdate( conn, stream ); |
| 259 | |
| 260 | if ( stream->readFlag() ) // UpdateMask |
| 261 | { |
| 262 | stream->read( &mSunAzimuth ); |
| 263 | stream->read( &mSunElevation ); |
| 264 | stream->read( &mLightColor ); |
| 265 | stream->read( &mLightAmbient ); |
| 266 | stream->read( &mBrightness ); |
| 267 | mCastShadows = stream->readFlag(); |
| 268 | stream->read(&mStaticRefreshFreq); |
| 269 | stream->read(&mDynamicRefreshFreq); |
| 270 | stream->read( &mFlareScale ); |
| 271 | |
| 272 | if ( stream->readFlag() ) |
| 273 | { |
| 274 | SimObjectId id = stream->readRangedU32( DataBlockObjectIdFirst, DataBlockObjectIdLast ); |
| 275 | LightFlareData *datablock = NULL; |
| 276 | |
| 277 | if ( Sim::findObject( id, datablock ) ) |
| 278 | mFlareData = datablock; |
| 279 | else |
| 280 | { |
| 281 | conn->setLastError( "Sun::unpackUpdate() - invalid LightFlareData!" ); |
| 282 | mFlareData = NULL; |
| 283 | } |
| 284 | } |
| 285 | else |
| 286 | mFlareData = NULL; |
| 287 | |
| 288 | mCoronaEnabled = stream->readFlag(); |
| 289 | |
| 290 | UNPACK_ASSET(conn, CoronaMaterial); |
| 291 | |
| 292 | stream->read( &mCoronaScale ); |
| 293 | stream->read( &mCoronaTint ); |
| 294 | mCoronaUseLightColor = stream->readFlag(); |
| 295 | |
| 296 | mLight->unpackExtended( stream ); |
| 297 | } |
| 298 | |
| 299 | if ( isProperlyAdded() ) |
| 300 | { |
| 301 | _initCorona(); |
| 302 | _conformLights(); |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | void Sun::submitLights( LightManager *lm, bool staticLighting ) |
| 307 | { |
nothing calls this directly
no test coverage detected