From b7760a567448e28aa5d8f35cea9a861057f76716 Mon Sep 17 00:00:00 2001 From: hnt_ts Date: Sat, 23 Aug 2008 17:02:52 +0000 Subject: [PATCH] Fixed OpenAL git-svn-id: https://svn.eduke32.com/eduke32@1008 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/game.c | 2 +- polymer/eduke32/source/jaudiolib/dsoundout.c | 6 ++++++ polymer/eduke32/source/jaudiolib/music.c | 3 --- polymer/eduke32/source/jaudiolib/openal.c | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 85b56929a..70167dbc2 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -54,8 +54,8 @@ extern int getversionfromwebsite(char *buffer); #define UPDATEINTERVAL 604800 // 1w #else static int usecwd = 0; -int checkCON = 1; #endif /* _WIN32 */ +int checkCON = 1; #define IDFSIZE 479985668 #define IDFILENAME "DUKE3D.IDF" diff --git a/polymer/eduke32/source/jaudiolib/dsoundout.c b/polymer/eduke32/source/jaudiolib/dsoundout.c index 850db79ed..2d3779a3e 100644 --- a/polymer/eduke32/source/jaudiolib/dsoundout.c +++ b/polymer/eduke32/source/jaudiolib/dsoundout.c @@ -33,6 +33,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include "dsound.h" +#ifdef USE_OPENAL +#include "openal.h" +#endif #include "compat.h" #include "winlayer.h" @@ -424,6 +427,9 @@ static DWORD WINAPI isr(LPVOID parm) while (1) { +#ifdef USE_OPENAL + AL_Update(); +#endif rv = WaitForMultipleObjects(1+_DSOUND_NumBuffers, handles, FALSE, INFINITE); if (!(rv >= WAIT_OBJECT_0 && rv <= WAIT_OBJECT_0+1+_DSOUND_NumBuffers)) return -1; diff --git a/polymer/eduke32/source/jaudiolib/music.c b/polymer/eduke32/source/jaudiolib/music.c index 20fee2eca..e26d2ba2e 100644 --- a/polymer/eduke32/source/jaudiolib/music.c +++ b/polymer/eduke32/source/jaudiolib/music.c @@ -630,8 +630,5 @@ void MUSIC_RegisterTimbreBank void MUSIC_Update(void) { MIDI_UpdateMusic(); -#ifdef USE_OPENAL - AL_Update(); -#endif } diff --git a/polymer/eduke32/source/jaudiolib/openal.c b/polymer/eduke32/source/jaudiolib/openal.c index 9dfd13bd2..65bb40ce9 100644 --- a/polymer/eduke32/source/jaudiolib/openal.c +++ b/polymer/eduke32/source/jaudiolib/openal.c @@ -345,11 +345,13 @@ int AL_Init() return 0; } +void AL_Stop(); void AL_Shutdown() { if (openal_disabled)return; initprintf("Uninitializing OpenAL...\n"); + AL_Stop(); ALdoing="Shut"; balcMakeContextCurrent(NULL); check(1); @@ -364,7 +366,6 @@ int AL_MusicVolume; extern int Musicsize; -void AL_Stop(); int update(); int stream(ALuint buffer); void open1(char *ptr,int sizef,char loop);