summaryrefslogtreecommitdiff
path: root/src/i_sound.c
diff options
context:
space:
mode:
authorSimon Howard2006-03-18 23:24:04 +0000
committerSimon Howard2006-03-18 23:24:04 +0000
commit3d1cf028d866c9fabce4cfdcaadbe87bba29256a (patch)
treeaebbf9f4fd480cb3a62ebbae0c3d2d73898c7360 /src/i_sound.c
parent00b50443326b087a2a947d7aa00b868856555130 (diff)
downloadchocolate-doom-3d1cf028d866c9fabce4cfdcaadbe87bba29256a.tar.gz
chocolate-doom-3d1cf028d866c9fabce4cfdcaadbe87bba29256a.tar.bz2
chocolate-doom-3d1cf028d866c9fabce4cfdcaadbe87bba29256a.zip
Fix music startup/shutdown
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 426
Diffstat (limited to 'src/i_sound.c')
-rw-r--r--src/i_sound.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/i_sound.c b/src/i_sound.c
index 937e78da..17f5e7d0 100644
--- a/src/i_sound.c
+++ b/src/i_sound.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: i_sound.c 425 2006-03-18 23:19:14Z fraggle $
+// $Id: i_sound.c 426 2006-03-18 23:24:04Z 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 425 2006-03-18 23:19:14Z fraggle $";
+rcsid[] = "$Id: i_sound.c 426 2006-03-18 23:24:04Z fraggle $";
#include <stdio.h>
#include <stdlib.h>
@@ -155,6 +155,8 @@ rcsid[] = "$Id: i_sound.c 425 2006-03-18 23:19:14Z fraggle $";
#define NUM_CHANNELS 16
static boolean sound_initialised = false;
+static boolean music_initialised = false;
+
static Mix_Chunk sound_chunks[NUMSFX];
static int channels_playing[NUM_CHANNELS];
@@ -510,7 +512,7 @@ I_UpdateSoundParams
void I_ShutdownSound(void)
{
- if (!sound_initialised)
+ if (!sound_initialised && !music_initialised)
return;
Mix_CloseAudio();
@@ -559,6 +561,8 @@ I_InitSound()
SDL_PauseAudio(0);
+ music_initialised = true;
+
if (M_CheckParm("-nosound") || M_CheckParm("-nosfx"))
return;
@@ -572,14 +576,8 @@ I_InitSound()
// MUSIC API.
//
-static int music_initialised;
-
void I_InitMusic(void)
{
- if (M_CheckParm("-nomusic") || M_CheckParm("-nosound"))
- return;
-
- music_initialised = true;
}
void I_ShutdownMusic(void)