X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fglut%2Faudio.c;h=6a7b96ce9416412c9d70db9f0b1321957ce3e2ff;hb=HEAD;hp=c776d3bb0c2123feb46af70373d115d93f7349c2;hpb=09e214b94e007964189222cca1e655f3aaefaf90;p=dosdemo diff --git a/src/glut/audio.c b/src/glut/audio.c index c776d3b..6a7b96c 100644 --- a/src/glut/audio.c +++ b/src/glut/audio.c @@ -9,6 +9,7 @@ #endif #include "mikmod.h" #include "audio.h" +#include "cfgopt.h" #ifdef _WIN32 #include @@ -37,6 +38,8 @@ int au_init(void) curmod = 0; vol_master = vol_mus = vol_sfx = 255; + if(!opt.music) return 0; + #if defined(__linux__) MikMod_RegisterDriver(&drv_alsa); #elif defined(__FreeBSD__) @@ -63,7 +66,7 @@ int au_init(void) { #ifdef _WIN32 HANDLE thr; - if((thr = CreateThread(0, 0, update, 0, 0, 0))) { + if((thr = CreateThread(0, 0, upd_thread, 0, 0, 0))) { CloseHandle(thr); } #else @@ -78,8 +81,10 @@ int au_init(void) void au_shutdown(void) { - curmod = 0; - MikMod_Exit(); + if(opt.music) { + curmod = 0; + MikMod_Exit(); + } } struct au_module *au_load_module(const char *fname) @@ -169,7 +174,7 @@ void au_update(void) } #ifdef _WIN32 -static DWORD WINAPI upd_thread(void *cls); +static DWORD WINAPI upd_thread(void *cls) #else static void *update(void *cls) #endif