1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-31 17:45:35 +00:00

Merge branch 'sound_cleanup' into 'master'

Sound cleanup

See merge request OpenMW/openmw!567
This commit is contained in:
psi29a 2021-03-22 21:42:01 +00:00
commit 1af50b7e23
3 changed files with 5 additions and 10 deletions

View file

@ -69,15 +69,13 @@ namespace MWSound
FFmpeg_Decoder& operator=(const FFmpeg_Decoder &rhs); FFmpeg_Decoder& operator=(const FFmpeg_Decoder &rhs);
FFmpeg_Decoder(const FFmpeg_Decoder &rhs); FFmpeg_Decoder(const FFmpeg_Decoder &rhs);
FFmpeg_Decoder(const VFS::Manager* vfs);
public: public:
explicit FFmpeg_Decoder(const VFS::Manager* vfs);
virtual ~FFmpeg_Decoder(); virtual ~FFmpeg_Decoder();
friend class SoundManager; friend class SoundManager;
}; };
#ifndef DEFAULT_DECODER
#define DEFAULT_DECODER (::MWSound::FFmpeg_Decoder)
#endif
} }
#endif #endif

View file

@ -98,9 +98,6 @@ namespace MWSound
OpenAL_Output(SoundManager &mgr); OpenAL_Output(SoundManager &mgr);
virtual ~OpenAL_Output(); virtual ~OpenAL_Output();
}; };
#ifndef DEFAULT_OUTPUT
#define DEFAULT_OUTPUT(x) ::MWSound::OpenAL_Output((x))
#endif
} }
#endif #endif

View file

@ -54,7 +54,7 @@ namespace MWSound
SoundManager::SoundManager(const VFS::Manager* vfs, bool useSound) SoundManager::SoundManager(const VFS::Manager* vfs, bool useSound)
: mVFS(vfs) : mVFS(vfs)
, mOutput(new DEFAULT_OUTPUT(*this)) , mOutput(new OpenAL_Output(*this))
, mWaterSoundUpdater(makeWaterSoundUpdaterSettings()) , mWaterSoundUpdater(makeWaterSoundUpdaterSettings())
, mSoundBuffers(*vfs, *mOutput) , mSoundBuffers(*vfs, *mOutput)
, mListenerUnderwater(false) , mListenerUnderwater(false)
@ -109,7 +109,7 @@ namespace MWSound
SoundManager::~SoundManager() SoundManager::~SoundManager()
{ {
clear(); SoundManager::clear();
mSoundBuffers.clear(); mSoundBuffers.clear();
mOutput.reset(); mOutput.reset();
} }
@ -117,7 +117,7 @@ namespace MWSound
// Return a new decoder instance, used as needed by the output implementations // Return a new decoder instance, used as needed by the output implementations
DecoderPtr SoundManager::getDecoder() DecoderPtr SoundManager::getDecoder()
{ {
return DecoderPtr(new DEFAULT_DECODER (mVFS)); return std::make_shared<FFmpeg_Decoder>(mVFS);
} }
DecoderPtr SoundManager::loadVoice(const std::string &voicefile) DecoderPtr SoundManager::loadVoice(const std::string &voicefile)