From d74844c6c12f8dacfd13cfd2934bdae0fb28601b Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Fri, 15 Sep 2006 23:47:12 +0000 Subject: Interpret the snd_sfxdevice and snd_musicdevice values in the configuration file and act the same as Vanilla Doom. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 606 --- src/i_sound.c | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) (limited to 'src/i_sound.c') diff --git a/src/i_sound.c b/src/i_sound.c index eb600cd6..2bbf9bba 100644 --- a/src/i_sound.c +++ b/src/i_sound.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: i_sound.c 603 2006-09-09 21:44:51Z fraggle $ +// $Id: i_sound.c 606 2006-09-15 23:47:12Z fraggle $ // // Copyright(C) 1993-1996 Id Software, Inc. // Copyright(C) 2005 Simon Howard @@ -128,7 +128,7 @@ //----------------------------------------------------------------------------- static const char -rcsid[] = "$Id: i_sound.c 603 2006-09-09 21:44:51Z fraggle $"; +rcsid[] = "$Id: i_sound.c 606 2006-09-15 23:47:12Z fraggle $"; #include #include @@ -157,6 +157,26 @@ rcsid[] = "$Id: i_sound.c 603 2006-09-09 21:44:51Z fraggle $"; #define MAXMIDLENGTH (96 * 1024) +enum +{ + SNDDEVICE_NONE = 0, + SNDDEVICE_PCSPEAKER = 1, + SNDDEVICE_ADLIB = 2, + SNDDEVICE_SB = 3, + SNDDEVICE_PAS = 4, + SNDDEVICE_GUS = 5, + SNDDEVICE_WAVEBLASTER = 6, + SNDDEVICE_SOUNDCANVAS = 7, + SNDDEVICE_GENMIDI = 8, + SNDDEVICE_AWE32 = 9, +}; + +extern int snd_sfxdevice; +extern int snd_musicdevice; + +static boolean nosfxparm; +static boolean nomusicparm; + static boolean sound_initialised = false; static boolean music_initialised = false; @@ -535,12 +555,18 @@ I_InitSound() { channels_playing[i] = sfx_None; } - + + nomusicparm = M_CheckParm("-nomusic") > 0 + || M_CheckParm("-nosound") > 0 + || snd_musicdevice < SNDDEVICE_ADLIB; + nosfxparm = M_CheckParm("-nosfx") > 0 + || M_CheckParm("-nosound") > 0 + || snd_sfxdevice < SNDDEVICE_SB; + // If music or sound is going to play, we need to at least // initialise SDL - if (M_CheckParm("-nosound") - || (M_CheckParm("-nosfx") && M_CheckParm("-nomusic"))) + if (nomusicparm && nosfxparm) return; if (SDL_Init(SDL_INIT_AUDIO) < 0) @@ -559,10 +585,10 @@ I_InitSound() SDL_PauseAudio(0); - if (M_CheckParm("-nomusic") == 0) + if (!nomusicparm) music_initialised = true; - if (M_CheckParm("-nosfx") == 0) + if (!nosfxparm) sound_initialised = true; } -- cgit v1.2.3