summaryrefslogtreecommitdiff
path: root/src/s_sound.c
diff options
context:
space:
mode:
authorSimon Howard2010-03-08 01:14:23 +0000
committerSimon Howard2010-03-08 01:14:23 +0000
commit448adb31d703afed9e9cc2bfd109c1fcd34447c4 (patch)
treeca987d9f677ec93263840477bc1eebc9a01fecab /src/s_sound.c
parentc4fe7aa8b6962edf79e0ccec469970618a92b0ef (diff)
parentb9e18229624500d6d2a6112a5c00882d7b7051de (diff)
downloadchocolate-doom-448adb31d703afed9e9cc2bfd109c1fcd34447c4.tar.gz
chocolate-doom-448adb31d703afed9e9cc2bfd109c1fcd34447c4.tar.bz2
chocolate-doom-448adb31d703afed9e9cc2bfd109c1fcd34447c4.zip
Merge opl-branch to trunk.
OPL support still isn't perfect, and it certainly isn't complete. However, for now, it's good enough. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1878
Diffstat (limited to 'src/s_sound.c')
-rw-r--r--src/s_sound.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/s_sound.c b/src/s_sound.c
index 1c56efb2..6c18f65e 100644
--- a/src/s_sound.c
+++ b/src/s_sound.c
@@ -128,6 +128,7 @@ int snd_sfxdevice = SNDDEVICE_SB;
extern sound_module_t sound_sdl_module;
extern sound_module_t sound_pcsound_module;
extern music_module_t music_sdl_module;
+extern music_module_t music_opl_module;
// Compiled-in sound modules:
@@ -146,6 +147,7 @@ static music_module_t *music_modules[] =
{
#ifdef FEATURE_SOUND
&music_sdl_module,
+ &music_opl_module,
#endif
NULL,
};
@@ -794,6 +796,15 @@ void S_ChangeMusic(int musicnum, int looping)
char namebuf[9];
void *handle;
+ // The Doom IWAD file has two versions of the intro music: d_intro
+ // and d_introa. The latter is used for OPL playback.
+
+ if (musicnum == mus_intro && (snd_musicdevice == SNDDEVICE_ADLIB
+ || snd_musicdevice == SNDDEVICE_SB))
+ {
+ musicnum = mus_introa;
+ }
+
if (musicnum <= mus_None || musicnum >= NUMMUSIC)
{
I_Error("Bad music number %d", musicnum);