diff --git a/src/common/audio/sound/oalsound.cpp b/src/common/audio/sound/oalsound.cpp index 96809e7be..511a89fbd 100644 --- a/src/common/audio/sound/oalsound.cpp +++ b/src/common/audio/sound/oalsound.cpp @@ -1141,7 +1141,7 @@ SoundHandle OpenALSoundRenderer::LoadSound(uint8_t *sfxdata, int length, int def return retval; } - std::vector data; + TArray data; unsigned total = 0; unsigned got; diff --git a/src/common/audio/sound/s_soundinternal.h b/src/common/audio/sound/s_soundinternal.h index cb38386a3..9212e997f 100644 --- a/src/common/audio/sound/s_soundinternal.h +++ b/src/common/audio/sound/s_soundinternal.h @@ -216,7 +216,7 @@ private: // Checks if a copy of this sound is already playing. bool CheckSingular(FSoundID sound_id); - virtual std::vector ReadSound(int lumpnum) = 0; + virtual TArray ReadSound(int lumpnum) = 0; protected: virtual bool CheckSoundLimit(sfxinfo_t* sfx, const FVector3& pos, int near_limit, float limit_range, int sourcetype, const void* actor, int channel, float attenuation); diff --git a/src/sound/s_doomsound.cpp b/src/sound/s_doomsound.cpp index 9000f958b..c94ee4aba 100644 --- a/src/sound/s_doomsound.cpp +++ b/src/sound/s_doomsound.cpp @@ -81,7 +81,7 @@ class DoomSoundEngine : public SoundEngine void CalcPosVel(int type, const void* source, const float pt[3], int channum, int chanflags, FSoundID soundid, FVector3* pos, FVector3* vel, FSoundChan *) override; bool ValidatePosVel(int sourcetype, const void* source, const FVector3& pos, const FVector3& vel); - std::vector ReadSound(int lumpnum); + TArray ReadSound(int lumpnum); FSoundID PickReplacement(FSoundID refid); FSoundID ResolveSound(const void *ent, int type, FSoundID soundid, float &attenuation) override; void CacheSound(sfxinfo_t* sfx) override; @@ -1166,10 +1166,13 @@ bool DoomSoundEngine::ValidatePosVel(int sourcetype, const void* source, const F // //========================================================================== -std::vector DoomSoundEngine::ReadSound(int lumpnum) +TArray DoomSoundEngine::ReadSound(int lumpnum) { auto wlump = fileSystem.OpenFileReader(lumpnum); - return wlump.Read(); + TArray buffer(wlump.GetLength(), true); + auto len = wlump.Read(buffer.data(), buffer.size()); + buffer.Resize(len); + return buffer; } //==========================================================================