mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
Sound: Changes to enable building xaudio2 driver on MinGW
This commit is contained in:
parent
651610cd2a
commit
14afaf8108
@ -27,7 +27,11 @@
|
||||
|
||||
#include <windows.h>
|
||||
#include <mmsystem.h>
|
||||
#ifdef _MSC_VER
|
||||
#include <wrl\client.h>
|
||||
#else
|
||||
#include <wrl/client.h>
|
||||
#endif
|
||||
#include <xaudio2.h>
|
||||
|
||||
using Microsoft::WRL::ComPtr;
|
||||
@ -121,12 +125,16 @@ static StreamingVoiceContext *_voice_context = nullptr;
|
||||
static HRESULT CreateXAudio(API_XAudio2Create xAudio2Create)
|
||||
{
|
||||
HRESULT hr;
|
||||
#ifdef _MSC_VER
|
||||
__try {
|
||||
#endif
|
||||
UINT32 flags = 0;
|
||||
hr = xAudio2Create(_xaudio2.GetAddressOf(), flags, XAUDIO2_DEFAULT_PROCESSOR);
|
||||
#ifdef _MSC_VER
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
hr = GetExceptionCode();
|
||||
}
|
||||
#endif
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user