From ea918df26dfbc3ddb2989fb415da2fc6b5e6bf50 Mon Sep 17 00:00:00 2001 From: skyjake Date: Tue, 20 Dec 2011 12:02:35 +0200 Subject: [PATCH] Use FMOD as the default audio driver If not present, falls back to SDL_mixer (and ultimately, dummy). --- doomsday/engine/portable/src/s_main.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/doomsday/engine/portable/src/s_main.c b/doomsday/engine/portable/src/s_main.c index 9e99d72c47..547dc46536 100644 --- a/doomsday/engine/portable/src/s_main.c +++ b/doomsday/engine/portable/src/s_main.c @@ -171,10 +171,10 @@ boolean S_Init(void) if(ArgExists("-nosound")) return true; - // First let's set up the drivers. First we much choose which one we - // want to use. + // First let's set up the drivers. First we must choose which one we want to use. if(isDedicated || ArgExists("-dummy")) { + // No audio output. ok = S_InitDriver(AUDIOD_DUMMY); } else if(ArgExists("-fmod")) @@ -194,18 +194,27 @@ boolean S_Init(void) { // Windows Multimedia. ok = S_InitDriver(AUDIOD_WINMM); } +#endif +#ifndef DENG_DISABLE_SDLMIXER + else if(ArgExists("-sdlmixer")) + { + ok = S_InitDriver(AUDIOD_SDL_MIXER); + } #endif else { // Use the default audio driver. + ok = S_InitDriver(AUDIOD_FMOD); + if(!ok) + { #ifndef DENG_DISABLE_SDLMIXER - ok = S_InitDriver(AUDIOD_SDL_MIXER); -#else - ok = S_InitDriver(AUDIOD_DUMMY); + // Fallback option for the default driver. + ok = S_InitDriver(AUDIOD_SDLMIXER); #endif + } } - // Did we succeed? + // Did we manage to load a driver? if(!ok) { Con_Message("S_Init: Driver init failed. Sound is disabled.\n"); @@ -218,8 +227,7 @@ boolean S_Init(void) sfxOK = Sfx_Init(); musOK = Mus_Init(); - Con_Message("S_Init: %s.\n", sfxOK && - musOK ? "OK" : "Errors during initialization."); + Con_Message("S_Init: %s.\n", (sfxOK && musOK? "OK" : "Errors during initialization.")); return (sfxOK && musOK); }