//--------------------------------------------------------------------------
void LightningData::packData(BitStream* stream)
{
   Parent::packData(stream);

   U32 i;
   for (i = 0; i < MaxThunders; i++)
      sfxWrite( stream, thunderSounds[ i ] );
   for (i = 0; i < MaxTextures; i++) {
      stream->writeString(strikeTextureNames[i]);
   }

   sfxWrite( stream, strikeSound );
}
void ProximityMineData::packData( BitStream* stream )
{
   Parent::packData( stream );

   stream->write( armingDelay );
   sfxWrite( stream, armingSound );

   stream->write( autoTriggerDelay );
   stream->writeFlag( triggerOnOwner );
   stream->write( triggerRadius );
   stream->write( triggerSpeed );
   stream->write( triggerDelay );
   sfxWrite( stream, triggerSound );
}
U32 LevelInfo::packUpdate(NetConnection *conn, U32 mask, BitStream *stream)
{
   U32 retMask = Parent::packUpdate(conn, mask, stream);

   stream->write( mNearClip );
   stream->write( mVisibleDistance );
   stream->write( mDecalBias );

   stream->write( mFogData.density );
   stream->write( mFogData.densityOffset );
   stream->write( mFogData.atmosphereHeight );
   stream->write( mFogData.color );

   stream->write( mCanvasClearColor );
   stream->write( mWorldSize );

   stream->writeFlag( mAdvancedLightmapSupport );
   stream->write( mAmbientLightBlendPhase );
   mathWrite( *stream, mAmbientLightBlendCurve );

   sfxWrite( stream, mSoundAmbience );
   stream->writeInt( mSoundDistanceModel, 1 );
      
   return retMask;
}
Beispiel #4
0
void SFXTrack::packData( BitStream* stream )
{
   Parent::packData( stream );
   
   sfxWrite( stream, mDescription );

   for( U32 i = 0; i < MaxNumParameters; ++ i )
      if( stream->writeFlag( mParameters[ i ] ) )
         stream->writeString( mParameters[ i ] );
}
void SFXPlayList::packData( BitStream* stream )
{
   Parent::packData( stream );
   
   stream->writeInt( mRandomMode, NUM_RANDOM_MODE_BITS );
   stream->writeInt( mLoopMode, NUM_LOOP_MODE_BITS );
   stream->writeInt( mNumSlotsToPlay, NUM_SLOTS_TO_PLAY_BITS );
   
   #define FOR_EACH_SLOT \
      for( U32 i = 0; i < NUM_SLOTS; ++ i )
   
   FOR_EACH_SLOT stream->writeInt( mSlots.mReplayMode[ i ], NUM_REPLAY_MODE_BITS );
   FOR_EACH_SLOT stream->writeInt( mSlots.mTransitionIn[ i ], NUM_TRANSITION_MODE_BITS );
   FOR_EACH_SLOT stream->writeInt( mSlots.mTransitionOut[ i ], NUM_TRANSITION_MODE_BITS );
   FOR_EACH_SLOT stream->writeInt( mSlots.mStateMode[ i ], NUM_STATE_MODE_BITS );
      
   FOR_EACH_SLOT stream->write( mSlots.mFadeTimeIn.mValue[ i ] );
   FOR_EACH_SLOT stream->write( mSlots.mFadeTimeIn.mVariance[ i ][ 0 ] );
   FOR_EACH_SLOT stream->write( mSlots.mFadeTimeIn.mVariance[ i ][ 1 ] );
   FOR_EACH_SLOT stream->write( mSlots.mFadeTimeOut.mValue[ i ] );
   FOR_EACH_SLOT stream->write( mSlots.mFadeTimeOut.mVariance[ i ][ 0 ] );
   FOR_EACH_SLOT stream->write( mSlots.mFadeTimeOut.mVariance[ i ][ 1 ] );
   FOR_EACH_SLOT stream->write( mSlots.mDelayTimeIn.mValue[ i ] );
   FOR_EACH_SLOT stream->write( mSlots.mDelayTimeIn.mVariance[ i ][ 0 ] );
   FOR_EACH_SLOT stream->write( mSlots.mDelayTimeIn.mVariance[ i ][ 1 ] );
   FOR_EACH_SLOT stream->write( mSlots.mDelayTimeOut.mValue[ i ] );
   FOR_EACH_SLOT stream->write( mSlots.mDelayTimeOut.mVariance[ i ][ 0 ] );
   FOR_EACH_SLOT stream->write( mSlots.mDelayTimeOut.mVariance[ i ][ 1 ] );
   FOR_EACH_SLOT stream->write( mSlots.mVolumeScale.mValue[ i ] );
   FOR_EACH_SLOT stream->write( mSlots.mVolumeScale.mVariance[ i ][ 0 ] );
   FOR_EACH_SLOT stream->write( mSlots.mVolumeScale.mVariance[ i ][ 1 ] );
   FOR_EACH_SLOT stream->write( mSlots.mPitchScale.mValue[ i ] );
   FOR_EACH_SLOT stream->write( mSlots.mPitchScale.mVariance[ i ][ 0 ] );
   FOR_EACH_SLOT stream->write( mSlots.mPitchScale.mVariance[ i ][ 1 ] );
   FOR_EACH_SLOT stream->write( mSlots.mRepeatCount[ i ] );
      
   FOR_EACH_SLOT sfxWrite( stream, mSlots.mState[ i ] );
   FOR_EACH_SLOT sfxWrite( stream, mSlots.mTrack[ i ] );
}
Beispiel #6
0
U32 WaterObject::packUpdate( NetConnection * conn, U32 mask, BitStream *stream )
{
   U32 retMask = Parent::packUpdate( conn, mask, stream );

   if ( stream->writeFlag( mask & UpdateMask ) )
   {
      stream->write( mDensity );
      stream->write( mViscosity );
      stream->write( mLiquidType );

      if ( stream->writeFlag( mFullReflect ) )
      {
         stream->write( mReflectorDesc.priority );
         stream->writeInt( mReflectorDesc.maxRateMs, 32 );
         //stream->write( mReflectMaxDist );
         //stream->write( mReflectMinDist );
         stream->write( mReflectorDesc.detailAdjust );         
         stream->writeFlag( mReflectNormalUp );
         stream->writeFlag( mReflectorDesc.useOcclusionQuery );
         stream->writeInt( mReflectorDesc.texSize, 32 );
      }

      stream->write( mReflectivity );

      stream->write( mWaterFogData.density );
      stream->write( mWaterFogData.densityOffset );      
      stream->write( mWaterFogData.wetDepth );
      stream->write( mWaterFogData.wetDarkening );

      stream->write( mDistortStartDist );
      stream->write( mDistortEndDist );
      stream->write( mDistortFullDepth );

      stream->write( mDepthGradientMax );
      stream->writeFlag( mEmissive );
      
      stream->write( mFoamMaxDepth );
      stream->write( mFoamAmbientLerp );     
      stream->write( mFoamRippleInfluence );

      stream->write( mWaterFogData.color );

      stream->write( mFresnelBias );
      stream->write( mFresnelPower );
      
      Point4F specularData( mSpecularColor.red, mSpecularColor.green, mSpecularColor.blue, mSpecularPower );      
      mathWrite( *stream, specularData );

      stream->write( mClarity );
      stream->write( mUnderwaterColor );

      stream->write( mOverallRippleMagnitude );
      stream->write( mOverallWaveMagnitude );
      stream->write( mOverallFoamOpacity );
   }

   if ( stream->writeFlag( mask & WaveMask ) )
   {
      for( U32 i=0; i<MAX_WAVES; i++ )
      {
         stream->write( mRippleSpeed[i] );
         mathWrite( *stream, mRippleDir[i] );
         mathWrite( *stream, mRippleTexScale[i] );
         stream->write( mRippleMagnitude[i] );

         stream->write( mWaveSpeed[i] );
         mathWrite( *stream, mWaveDir[i] );
         stream->write( mWaveMagnitude[i] );  
      }

      for ( U32 i = 0; i < MAX_FOAM; i++ )
      {
         stream->write( mFoamSpeed[i] );
         mathWrite( *stream, mFoamDir[i] );
         mathWrite( *stream, mFoamTexScale[i] );
         stream->write( mFoamOpacity[i] );
      }
   }

   if ( stream->writeFlag( mask & MaterialMask ) )
   {
      for ( U32 i = 0; i < NumMatTypes; i++ )      
         stream->write( mSurfMatName[i] );
   }

   if ( stream->writeFlag( mask & TextureMask ) )
   {
      stream->write( mRippleTexName );
      stream->write( mDepthGradientTexName );
      stream->write( mFoamTexName );
      stream->write( mCubemapName );      
   }

   if( stream->writeFlag( mask & SoundMask ) )
      sfxWrite( stream, mSoundAmbience );

   return retMask;
}
Beispiel #7
0
//--------------------------------------------------------------------------
void ProjectileData::packData(BitStream* stream)
{
   Parent::packData(stream);

   stream->writeString(projectileShapeName);
   stream->writeFlag(faceViewer);
   if(stream->writeFlag(scale.x != 1 || scale.y != 1 || scale.z != 1))
   {
      stream->write(scale.x);
      stream->write(scale.y);
      stream->write(scale.z);
   }

   if (stream->writeFlag(particleEmitter != NULL))
      stream->writeRangedU32(particleEmitter->getId(), DataBlockObjectIdFirst,
                                                   DataBlockObjectIdLast);

   if (stream->writeFlag(particleWaterEmitter != NULL))
      stream->writeRangedU32(particleWaterEmitter->getId(), DataBlockObjectIdFirst,
                                                   DataBlockObjectIdLast);

   if (stream->writeFlag(explosion != NULL))
      stream->writeRangedU32(explosion->getId(), DataBlockObjectIdFirst,
                                                 DataBlockObjectIdLast);

   if (stream->writeFlag(waterExplosion != NULL))
      stream->writeRangedU32(waterExplosion->getId(), DataBlockObjectIdFirst,
                                                      DataBlockObjectIdLast);

   if (stream->writeFlag(splash != NULL))
      stream->writeRangedU32(splash->getId(), DataBlockObjectIdFirst,
                                              DataBlockObjectIdLast);

   if (stream->writeFlag(decal != NULL))
      stream->writeRangedU32(decal->getId(), DataBlockObjectIdFirst,
                                              DataBlockObjectIdLast);

   sfxWrite( stream, sound );

   if ( stream->writeFlag(lightDesc != NULL))
      stream->writeRangedU32(lightDesc->getId(), DataBlockObjectIdFirst,
                                                 DataBlockObjectIdLast);

   stream->write(impactForce);
   
//    stream->writeRangedU32(lifetime, 0, Projectile::MaxLivingTicks);
//    stream->writeRangedU32(armingDelay, 0, Projectile::MaxLivingTicks);
//    stream->writeRangedU32(fadeDelay, 0, Projectile::MaxLivingTicks);

   // [tom, 3/21/2007] Changing these to write all 32 bits as the previous
   // code limited these to a max value of 4095.
   stream->write(lifetime);
   stream->write(armingDelay);
   stream->write(fadeDelay);

   if(stream->writeFlag(isBallistic))
   {
      stream->write(gravityMod);
      stream->write(bounceElasticity);
      stream->write(bounceFriction);
   }

}
Beispiel #8
0
U32 SFXEmitter::packUpdate( NetConnection *con, U32 mask, BitStream *stream )
{
   U32 retMask = Parent::packUpdate( con, mask, stream );

   if( stream->writeFlag( mask & InitialUpdateMask ) )
   {
      // If this is the initial update then all the source
      // values are dirty and must be transmitted.
      mask |= TransformUpdateMask;
      mDirty = AllDirtyMask;

      // Clear the source masks... they are not
      // used during an initial update!
      mask &= ~AllSourceMasks;
   }

   stream->writeFlag( mPlayOnAdd );

   // transform
   if( stream->writeFlag( mask & TransformUpdateMask ) )
      stream->writeAffineTransform( mObjToWorld );

   // track
   if( stream->writeFlag( mDirty.test( Track ) ) )
      sfxWrite( stream, mTrack );

   // filename
   if( stream->writeFlag( mDirty.test( Filename ) ) )
      stream->writeString( mLocalProfile.mFilename );

   // volume
   if( stream->writeFlag( mDirty.test( Volume ) ) )
      stream->write( mDescription.mVolume );
      
   // pitch
   if( stream->writeFlag( mDirty.test( Pitch ) ) )
      stream->write( mDescription.mPitch );

   // islooping
   if( stream->writeFlag( mDirty.test( IsLooping ) ) )
      stream->writeFlag( mDescription.mIsLooping );
      
   // isStreaming
   if( stream->writeFlag( mDirty.test( IsStreaming ) ) )
      stream->writeFlag( mDescription.mIsStreaming );

   // is3d
   if( stream->writeFlag( mDirty.test( Is3D ) ) )
      stream->writeFlag( mDescription.mIs3D );

   // minDistance
   if( stream->writeFlag( mDirty.test( MinDistance ) ) )
      stream->write( mDescription.mMinDistance );

   // maxdistance
   if( stream->writeFlag( mDirty.test( MaxDistance) ) )
      stream->write( mDescription.mMaxDistance );

   // coneinsideangle
   if( stream->writeFlag( mDirty.test( ConeInsideAngle ) ) )
      stream->write( mDescription.mConeInsideAngle );

   // coneoutsideangle
   if( stream->writeFlag( mDirty.test( ConeOutsideAngle ) ) )
      stream->write( mDescription.mConeOutsideAngle );

   // coneoutsidevolume
   if( stream->writeFlag( mDirty.test( ConeOutsideVolume ) ) )
      stream->write( mDescription.mConeOutsideVolume );

   // sourcegroup
   if( stream->writeFlag( mDirty.test( SourceGroup ) ) )
      sfxWrite( stream, mDescription.mSourceGroup );
      
   // fadein
   if( stream->writeFlag( mDirty.test( FadeInTime ) ) )
      stream->write( mDescription.mFadeInTime );
      
   // fadeout
   if( stream->writeFlag( mDirty.test( FadeOutTime ) ) )
      stream->write( mDescription.mFadeOutTime );
      
   // scatterdistance
   if( stream->writeFlag( mDirty.test( ScatterDistance ) ) )
      mathWrite( *stream, mDescription.mScatterDistance );

   mDirty.clear();
   
   stream->writeFlag( mUseTrackDescriptionOnly );

   // We should never have both source masks 
   // enabled at the same time!
   AssertFatal( ( mask & AllSourceMasks ) != AllSourceMasks, 
      "SFXEmitter::packUpdate() - Bad source mask!" );

   // Write the source playback state.
   stream->writeFlag( mask & SourcePlayMask );
   stream->writeFlag( mask & SourceStopMask );

   return retMask;
}