Skip to content

Commit

Permalink
Use FMOD as the default audio driver
Browse files Browse the repository at this point in the history
If not present, falls back to SDL_mixer (and ultimately, dummy).
  • Loading branch information
skyjake committed Dec 20, 2011
1 parent d4770c7 commit ea918df
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions doomsday/engine/portable/src/s_main.c
Expand Up @@ -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"))
Expand All @@ -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");
Expand All @@ -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);
}

Expand Down

0 comments on commit ea918df

Please sign in to comment.