Commit d3aee972 authored by Chuck Walbourn's avatar Chuck Walbourn
Browse files

Updated for DirectX Tool Kit / DirectXTex December 2017 releases

parent d141b065
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1049,13 +1049,13 @@ void AudioEngine::Impl::AllocateVoice( const WAVEFORMATEX* wfx, SOUND_EFFECT_INS
                    case WAVE_FORMAT_ADPCM:
                        {
                            auto wfadpcm = reinterpret_cast<const ADPCMWAVEFORMAT*>( wfx );
                            CreateADPCM( wfmt, 64, defaultRate, wfx->nChannels, wfadpcm->wSamplesPerBlock );
                            CreateADPCM( wfmt, sizeof(buff), defaultRate, wfx->nChannels, wfadpcm->wSamplesPerBlock );
                        }
                        break;

#if defined(_XBOX_ONE) && defined(_TITLE)
                    case WAVE_FORMAT_XMA2:
                        CreateXMA2( wfmt, 64, defaultRate, wfx->nChannels, 65536, 2, 0 );
                        CreateXMA2( wfmt, sizeof(buff), defaultRate, wfx->nChannels, 65536, 2, 0 );
                        break;
#endif
                    }
+1 −1
Original line number Diff line number Diff line
@@ -764,7 +764,7 @@ void SoundEffectInstanceBase::Apply3D( const AudioListener& listener, const Audi

    if ( reverb )
    {
        for ( size_t j = 0; j < mDSPSettings.SrcChannelCount; ++j )
        for ( size_t j = 0; (j < mDSPSettings.SrcChannelCount) && (j < XAUDIO2_MAX_AUDIO_CHANNELS); ++j )
        {
            matrix[j] = mDSPSettings.ReverbLevel;
        }
+6 −6
Original line number Diff line number Diff line
@@ -49,10 +49,10 @@ public:
        assert( engine != 0 );
        engine->RegisterNotify( this, false );

        char buff[64];
        char buff[64] = {};
        auto wfx = reinterpret_cast<WAVEFORMATEX*>( buff );
        assert( mWaveBank != 0 );
        mBase.Initialize( engine, mWaveBank->GetFormat( index, wfx, 64 ), flags );
        mBase.Initialize( engine, mWaveBank->GetFormat( index, wfx, sizeof(buff) ), flags );
    }

    virtual ~Impl()
@@ -120,9 +120,9 @@ void SoundEffectInstance::Impl::Play( bool loop )
    {
        if ( mWaveBank )
        {
            char buff[64];
            char buff[64] = {};
            auto wfx = reinterpret_cast<WAVEFORMATEX*>( buff );
            mBase.AllocateVoice( mWaveBank->GetFormat( mIndex, wfx, 64) );
            mBase.AllocateVoice( mWaveBank->GetFormat( mIndex, wfx, sizeof(buff) ) );
        }
        else
        {
@@ -195,8 +195,8 @@ void SoundEffectInstance::Impl::Play( bool loop )
#ifdef _DEBUG
        DebugTrace( "ERROR: SoundEffectInstance failed (%08X) when submitting buffer:\n", hr );

        char buff[64];
        auto wfx = ( mWaveBank ) ? mWaveBank->GetFormat( mIndex, reinterpret_cast<WAVEFORMATEX*>( buff ), 64 )
        char buff[64] = {};
        auto wfx = ( mWaveBank ) ? mWaveBank->GetFormat( mIndex, reinterpret_cast<WAVEFORMATEX*>( buff ), sizeof(buff) )
                                 : mEffect->GetFormat();

        size_t length = ( mWaveBank ) ? mWaveBank->GetSampleSizeInBytes( mIndex ) : mEffect->GetSampleSizeInBytes();
+4 −4
Original line number Diff line number Diff line
@@ -168,9 +168,9 @@ void WaveBank::Impl::Play( int index, float volume, float pitch, float pan )
        mPrepared = true;
    }

    char wfxbuff[64];
    char wfxbuff[64] = {};
    auto wfx = reinterpret_cast<WAVEFORMATEX*>( wfxbuff );
    HRESULT hr = mReader.GetFormat( index, wfx, 64 );
    HRESULT hr = mReader.GetFormat( index, wfx, sizeof(wfxbuff) );
    ThrowIfFailed( hr );

    IXAudio2SourceVoice* voice = nullptr;
@@ -434,9 +434,9 @@ size_t WaveBank::GetSampleDurationMS( int index ) const
    if ( index < 0 || uint32_t(index) >= pImpl->mReader.Count() )
        return 0;

    char buff[64];
    char buff[64] = {};
    auto wfx = reinterpret_cast<WAVEFORMATEX*>( buff );
    HRESULT hr = pImpl->mReader.GetFormat( index, wfx, 64 );
    HRESULT hr = pImpl->mReader.GetFormat( index, wfx, sizeof(buff) );
    ThrowIfFailed( hr );

    WaveBankReader::Metadata metadata;
+1 −1
Original line number Diff line number Diff line
@@ -696,7 +696,7 @@ HRESULT WaveBankReader::Impl::Open( const wchar_t* szFileName )
                DWORD n = m_data.dwEntryNameElementSize * j;

                char name[ 64 ] = {};
                strncpy_s( name, &temp[ n ], 64 );
                strncpy_s( name, &temp[ n ], sizeof(name) );

                m_names[ name ] = j;
            }
Loading