From b6a406176384203c28e3bc1a5ac18a090469a6b9 Mon Sep 17 00:00:00 2001 From: Rohit Nirmal Date: Fri, 17 Nov 2023 12:35:18 -0600 Subject: [PATCH] Fix building on Windows with OpenAL when DirectSound libraries are missing. --- runtime/client/CMakeLists.txt | 2 +- runtime/sound/src/soundmgr.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/client/CMakeLists.txt b/runtime/client/CMakeLists.txt index f553ba5b..3d727ad1 100644 --- a/runtime/client/CMakeLists.txt +++ b/runtime/client/CMakeLists.txt @@ -178,7 +178,6 @@ if(WIN32) ../kernel/src/sys/win/input.cpp ../kernel/src/sys/win/InputSim.cpp ../kernel/src/sys/win/load_pcx.cpp - ../kernel/src/sys/win/ltdirectmusicloader.cpp ../kernel/src/sys/win/lthread.cpp ../kernel/src/sys/win/ltlibraryloader.cpp ../kernel/src/sys/win/ltrendermgr_impl.cpp @@ -237,6 +236,7 @@ endif (ENABLE_OPENAL) if (ENABLE_DIRECTMUSIC) set(exec_src ${exec_src} ../kernel/src/sys/win/ltdirectmusic_impl.cpp + ../kernel/src/sys/win/ltdirectmusicloader.cpp ) else (ENABLE_DIRECTMUSIC) set(exec_src ${exec_src} diff --git a/runtime/sound/src/soundmgr.h b/runtime/sound/src/soundmgr.h index 5b36896d..a8f26ed2 100644 --- a/runtime/sound/src/soundmgr.h +++ b/runtime/sound/src/soundmgr.h @@ -54,7 +54,7 @@ extern ILTSoundSys* SoundSys( bool bTerminate = false ); #include "soundbuffer.h" #endif -#ifdef WIN32 +#if defined(WIN32) && !defined(USE_OPENAL) #ifndef __DMUSICI_H__ #include #define __DMUSICI_H__ @@ -176,13 +176,13 @@ class CSoundMgr : public ILTClientSoundMgr #ifdef USE_ABSTRACT_SOUND_INTERFACES // =========================================================================== -#ifdef _LINUX +#if defined(_LINUX) || defined(USE_OPENAL) #define LPDIRECTSOUND8 void* #define LPDIRECTSOUNDBUFFER void* #endif LPDIRECTSOUND8 GetDirectSound( ); -#ifdef WIN32 +#if defined(WIN32) && !defined(USE_OPENAL) IDirectMusicPerformance8* GetDirectMusicPerformance( ); IDirectMusic* GetDirectMusic(); #else