diff --git a/src/sound/i_sound.cpp b/src/sound/i_sound.cpp index 9d45ebc685..97267d62c1 100644 --- a/src/sound/i_sound.cpp +++ b/src/sound/i_sound.cpp @@ -574,18 +574,18 @@ SoundDecoder *SoundRenderer::CreateDecoder(FileReader *reader) // Default readAll implementation, for decoders that can't do anything better -std::vector SoundDecoder::readAll() +TArray SoundDecoder::readAll() { - std::vector output; + TArray output; size_t total = 0; size_t got; - output.resize(total+32768); - while((got=read(&output[total], output.size()-total)) > 0) + output.Resize(total+32768); + while((got=read(&output[total], output.Size()-total)) > 0) { total += got; - output.resize(total*2); + output.Resize(total*2); } - output.resize(total); + output.Resize(total); return output; } diff --git a/src/sound/i_soundinternal.h b/src/sound/i_soundinternal.h index 499fe80a6e..218c6724b9 100644 --- a/src/sound/i_soundinternal.h +++ b/src/sound/i_soundinternal.h @@ -6,6 +6,7 @@ #include "basictypes.h" #include "vectors.h" +#include "tarray.h" class FileReader; @@ -123,7 +124,7 @@ struct SoundDecoder virtual void getInfo(int *samplerate, ChannelConfig *chans, SampleType *type) = 0; virtual size_t read(char *buffer, size_t bytes) = 0; - virtual std::vector readAll(); + virtual TArray readAll(); virtual bool seek(size_t ms_offset) = 0; virtual size_t getSampleOffset() = 0; virtual size_t getSampleLength() { return 0; } diff --git a/src/sound/oalsound.cpp b/src/sound/oalsound.cpp index db4c459ebb..0b0dd5f590 100644 --- a/src/sound/oalsound.cpp +++ b/src/sound/oalsound.cpp @@ -1024,11 +1024,11 @@ SoundHandle OpenALSoundRenderer::LoadSound(BYTE *sfxdata, int length) return retval; } - std::vector data = decoder->readAll(); + TArray data = decoder->readAll(); ALuint buffer = 0; alGenBuffers(1, &buffer); - alBufferData(buffer, format, &data[0], data.size(), srate); + alBufferData(buffer, format, &data[0], data.Size(), srate); ALenum err; if((err=getALError()) != AL_NO_ERROR) diff --git a/src/sound/sndfile_decoder.cpp b/src/sound/sndfile_decoder.cpp index 26f9fd91da..0cf6a5fa84 100644 --- a/src/sound/sndfile_decoder.cpp +++ b/src/sound/sndfile_decoder.cpp @@ -100,17 +100,17 @@ size_t SndFileDecoder::read(char *buffer, size_t bytes) return total * SndInfo.channels * 2; } -std::vector SndFileDecoder::readAll() +TArray SndFileDecoder::readAll() { if(SndInfo.frames <= 0) return SoundDecoder::readAll(); int framesize = 2 * SndInfo.channels; - std::vector output; + TArray output; - output.resize(SndInfo.frames * framesize); - size_t got = read(&output[0], output.size()); - output.resize(got); + output.Resize(SndInfo.frames * framesize); + size_t got = read(&output[0], output.Size()); + output.Resize(got); return output; } diff --git a/src/sound/sndfile_decoder.h b/src/sound/sndfile_decoder.h index 6c4dd3edac..f53f7e52a3 100644 --- a/src/sound/sndfile_decoder.h +++ b/src/sound/sndfile_decoder.h @@ -12,7 +12,7 @@ struct SndFileDecoder : public SoundDecoder virtual void getInfo(int *samplerate, ChannelConfig *chans, SampleType *type); virtual size_t read(char *buffer, size_t bytes); - virtual std::vector readAll(); + virtual TArray readAll(); virtual bool seek(size_t ms_offset); virtual size_t getSampleOffset(); virtual size_t getSampleLength();