diff --git a/Engine/source/sfx/media/sfxVorbisStream.cpp b/Engine/source/sfx/media/sfxVorbisStream.cpp index 3a2f12ba6..38e4e5d95 100644 --- a/Engine/source/sfx/media/sfxVorbisStream.cpp +++ b/Engine/source/sfx/media/sfxVorbisStream.cpp @@ -40,6 +40,7 @@ SFXVorbisStream* SFXVorbisStream::create( Stream *stream ) SFXVorbisStream::SFXVorbisStream() : mVF( NULL ), + mBitstream(-1), mBytesRead( 0 ) { } @@ -47,6 +48,9 @@ SFXVorbisStream::SFXVorbisStream() SFXVorbisStream::SFXVorbisStream( const SFXVorbisStream& cloneFrom ) : Parent( cloneFrom ) { + mVF = NULL; + mBitstream = -1; + mBytesRead = 0; if( !mStream->hasCapability( Stream::StreamPosition ) ) { Con::errorf( "SFXVorbisStream::SFXVorbisStream() - Source stream does not allow seeking" ); diff --git a/Engine/source/sfx/media/sfxWavStream.cpp b/Engine/source/sfx/media/sfxWavStream.cpp index 3e5f4b983..e3833c401 100644 --- a/Engine/source/sfx/media/sfxWavStream.cpp +++ b/Engine/source/sfx/media/sfxWavStream.cpp @@ -94,6 +94,7 @@ SFXWavStream* SFXWavStream::create( Stream *stream ) } SFXWavStream::SFXWavStream() + :mDataStart(-1) { } diff --git a/Engine/source/sfx/openal/sfxALDevice.cpp b/Engine/source/sfx/openal/sfxALDevice.cpp index 080d77d6d..58d7c0146 100644 --- a/Engine/source/sfx/openal/sfxALDevice.cpp +++ b/Engine/source/sfx/openal/sfxALDevice.cpp @@ -35,8 +35,11 @@ SFXALDevice::SFXALDevice( SFXProvider *provider, : Parent( name, provider, useHardware, maxBuffers ), mOpenAL( openal ), mContext( NULL ), - mDevice( NULL ), - mRolloffFactor( 1.0f ) + mDevice( NULL ), + mDistanceModel(SFXDistanceModelLinear), + mDistanceFactor(1.0f), + mRolloffFactor( 1.0f ), + mUserRolloffFactor(1.0f) { mMaxBuffers = getMax( maxBuffers, 8 ); @@ -80,6 +83,10 @@ SFXALDevice::SFXALDevice( SFXProvider *provider, SFXInternal::gUpdateThread->start(); } #endif + + dMemset(effectSlot, 0, sizeof(effectSlot)); + dMemset(effect, 0, sizeof(effect)); + uLoop = 0; } //----------------------------------------------------------------------------- diff --git a/Engine/source/sfx/openal/sfxALProvider.cpp b/Engine/source/sfx/openal/sfxALProvider.cpp index 47b2444b3..434d4a44c 100644 --- a/Engine/source/sfx/openal/sfxALProvider.cpp +++ b/Engine/source/sfx/openal/sfxALProvider.cpp @@ -36,7 +36,7 @@ class SFXALProvider : public SFXProvider public: SFXALProvider() - : SFXProvider( "OpenAL" ) { mALDL = NULL; } + : SFXProvider( "OpenAL" ) { dMemset(&mOpenAL,0,sizeof(mOpenAL)); mALDL = NULL; } virtual ~SFXALProvider(); protected: diff --git a/Engine/source/sfx/sfxController.cpp b/Engine/source/sfx/sfxController.cpp index 2d9592eef..6bb5924b9 100644 --- a/Engine/source/sfx/sfxController.cpp +++ b/Engine/source/sfx/sfxController.cpp @@ -75,7 +75,8 @@ ConsoleDocClass( SFXController, SFXController::SFXController( SFXPlayList* playList ) : Parent( playList ), - mTrace( playList->trace() ) + mTrace( playList->trace() ), + mLoopCounter(0) { VECTOR_SET_ASSOCIATION( mInsns ); VECTOR_SET_ASSOCIATION( mSources ); diff --git a/Engine/source/sfx/sfxController.h b/Engine/source/sfx/sfxController.h index 32039d7c4..7d2ee4980 100644 --- a/Engine/source/sfx/sfxController.h +++ b/Engine/source/sfx/sfxController.h @@ -93,13 +93,14 @@ class SFXController : public SFXSource U32 mLoopCount; } mArg; - Insn() {} + Insn() + : mOpcode(SFXController::OP_Delay), mSlotIndex(0), mState(NULL) {mArg.mLoopCount=0;} Insn( EOp opcode ) - : mOpcode( opcode ), mSlotIndex( U32_MAX ), mState( NULL ) {} + : mOpcode( opcode ), mSlotIndex( U32_MAX ), mState( NULL ) {mArg.mLoopCount=0;} Insn( U32 slotIndex, SFXState* state ) - : mSlotIndex( slotIndex ), mState( state ) {} + : mOpcode(SFXController::OP_Delay), mSlotIndex( slotIndex ), mState( state ){mArg.mLoopCount=0;} Insn( EOp opcode, U32 slotIndex, SFXState* state ) - : mOpcode( opcode ), mSlotIndex( slotIndex ), mState( state ) {} + : mOpcode( opcode ), mSlotIndex( slotIndex ), mState( state ) {mArg.mLoopCount=0;} }; /// @@ -130,7 +131,7 @@ class SFXController : public SFXSource F32 mFadeOutTime; Source() - : mState( 0 ) {} + : mState( 0 ), mSlotIndex(0), mVolumeScale(1.0f), mPitchScale(1.0f), mFadeInTime(0), mFadeOutTime(0) {} }; /// The current instruction in "mInsns". @@ -169,7 +170,7 @@ class SFXController : public SFXSource void _genTransition( Insn& insn, SFXPlayList::ETransitionMode transition ); /// - void _dumpInsns(); + void _dumpInsns() {}; /// void _initInsn(); @@ -198,7 +199,7 @@ class SFXController : public SFXSource ~SFXController(); /// Constructor for the sake of ConsoleObject. - explicit SFXController() {} + explicit SFXController(): mIp(0), mTrace(false), mDelayEndTime(0), mLoopCounter(0) {} /// Return the playlist being played back by the controller. SFXPlayList* getPlayList() const; diff --git a/Engine/source/sfx/sfxInternal.h b/Engine/source/sfx/sfxInternal.h index 137456eac..4d0a922f5 100644 --- a/Engine/source/sfx/sfxInternal.h +++ b/Engine/source/sfx/sfxInternal.h @@ -324,7 +324,7 @@ class SFXWrapAroundBuffer : public SFXBuffer SFXWrapAroundBuffer( const ThreadSafeRef< SFXStream >& stream, SFXDescription* description ); SFXWrapAroundBuffer( SFXDescription* description ) - : Parent( description ), mBufferSize( 0 ) {} + : Parent( description ), mBufferSize( 0 ), mWriteOffset(0) {} virtual U32 getMemoryUsed() const { return mBufferSize; } }; diff --git a/Engine/source/sfx/sfxModifier.cpp b/Engine/source/sfx/sfxModifier.cpp index 3bc98c31f..bf63f392e 100644 --- a/Engine/source/sfx/sfxModifier.cpp +++ b/Engine/source/sfx/sfxModifier.cpp @@ -107,6 +107,8 @@ bool SFXRangeModifier::update() SFXFadeModifier::SFXFadeModifier( SFXSource* source, F32 time, F32 endVolume, F32 startTime, EOnEnd onEndDo, bool removeWhenDone ) : Parent( source, startTime, startTime + time, removeWhenDone ), + mStartVolume(source->getVolume()), + mCurrentVolume(source->getVolume()), mEndVolume( endVolume ), mOnEnd( onEndDo ) { diff --git a/Engine/source/sfx/sfxModifier.h b/Engine/source/sfx/sfxModifier.h index 182609964..39f2a7316 100644 --- a/Engine/source/sfx/sfxModifier.h +++ b/Engine/source/sfx/sfxModifier.h @@ -47,7 +47,7 @@ class SFXModifier : public IPolled /// Create an effect that operates on "source". SFXModifier( SFXSource* source, bool removeWhenDone = false ) - : mSource( source ) {} + : mSource( source ), mRemoveWhenDone(removeWhenDone) {} virtual ~SFXModifier() {} }; diff --git a/Engine/source/sfx/sfxSound.cpp b/Engine/source/sfx/sfxSound.cpp index 6b4895f80..c62c41605 100644 --- a/Engine/source/sfx/sfxSound.cpp +++ b/Engine/source/sfx/sfxSound.cpp @@ -68,7 +68,7 @@ ConsoleDocClass( SFXSound, //----------------------------------------------------------------------------- SFXSound::SFXSound() - : mVoice( NULL ) + : mVoice( NULL ), mDuration(0), mSetPositionValue(0) { // NOTE: This should never be used directly // and is only here to satisfy satisfy the @@ -79,7 +79,7 @@ SFXSound::SFXSound() SFXSound::SFXSound( SFXProfile *profile, SFXDescription* desc ) : Parent( profile, desc ), - mVoice( NULL ) + mVoice( NULL ), mDuration(0) { mSetPositionValue = 0; } diff --git a/Engine/source/sfx/sfxWorld.h b/Engine/source/sfx/sfxWorld.h index 289455b69..427e4721d 100644 --- a/Engine/source/sfx/sfxWorld.h +++ b/Engine/source/sfx/sfxWorld.h @@ -208,7 +208,7 @@ class SFXWorld : public ScopeTracker< NUM_DIMENSIONS, Object > /// between this space and the space above us in the stack. Object mObject; - Scope() {} + Scope() :mSortValue(0), mSoundscape(NULL) {} Scope( F32 sortValue, Object object ) : mSortValue( sortValue ), mSoundscape( NULL ),