diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-11 20:21:09 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-11 20:21:09 +0200 |
commit | 9b23e33c36facdad4b6f669501dbee7fa82ef50a (patch) | |
tree | 3f81b31669c2187720881afa07e2ed3db93d6694 /src/audio/DMAudio.cpp | |
parent | Merge remote-tracking branch 'upstream/miami' into miami (diff) | |
parent | Merge remote-tracking branch 'origin/master' into miami (diff) | |
download | re3-9b23e33c36facdad4b6f669501dbee7fa82ef50a.tar re3-9b23e33c36facdad4b6f669501dbee7fa82ef50a.tar.gz re3-9b23e33c36facdad4b6f669501dbee7fa82ef50a.tar.bz2 re3-9b23e33c36facdad4b6f669501dbee7fa82ef50a.tar.lz re3-9b23e33c36facdad4b6f669501dbee7fa82ef50a.tar.xz re3-9b23e33c36facdad4b6f669501dbee7fa82ef50a.tar.zst re3-9b23e33c36facdad4b6f669501dbee7fa82ef50a.zip |
Diffstat (limited to 'src/audio/DMAudio.cpp')
-rw-r--r-- | src/audio/DMAudio.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/audio/DMAudio.cpp b/src/audio/DMAudio.cpp index 11c85dbd..f1b9707b 100644 --- a/src/audio/DMAudio.cpp +++ b/src/audio/DMAudio.cpp @@ -5,6 +5,7 @@ #include "AudioManager.h" #include "AudioScriptObject.h" #include "sampman.h" +#include "Text.h" cDMAudio DMAudio; @@ -104,6 +105,28 @@ cDMAudio::Get3DProviderName(uint8 id) return AudioManager.Get3DProviderName(id); } +int8 cDMAudio::AutoDetect3DProviders(void) +{ + for ( int32 i = 0; i < GetNum3DProvidersAvailable(); i++ ) + { + wchar buff[64]; + + char *name = Get3DProviderName(i); + AsciiToUnicode(name, buff); + char *providername = UnicodeToAscii(buff); + strupr(providername); +#if defined(AUDIO_MSS) + if ( !strcmp(providername, "MILES FAST 2D POSITIONAL AUDIO") ) + return i; +#elif defined(AUDIO_OAL) + if ( !strcmp(providername, "OPENAL SOFT") ) + return i; +#endif + } + + return -1; +} + int8 cDMAudio::GetCurrent3DProviderIndex(void) { |