diff options
author | Simon Howard | 2006-03-18 23:19:14 +0000 |
---|---|---|
committer | Simon Howard | 2006-03-18 23:19:14 +0000 |
commit | 00b50443326b087a2a947d7aa00b868856555130 (patch) | |
tree | 4c0cc48dff0f058833c340b2f4fc1c2e5e8b2eb7 /src | |
parent | f880f58ded09e7c0ab121f8e2a969f841512edf3 (diff) | |
download | chocolate-doom-00b50443326b087a2a947d7aa00b868856555130.tar.gz chocolate-doom-00b50443326b087a2a947d7aa00b868856555130.tar.bz2 chocolate-doom-00b50443326b087a2a947d7aa00b868856555130.zip |
Catch failures to initialise SDL_mixer properly, and fail gracefully
rather than crashing the game.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 425
Diffstat (limited to 'src')
-rw-r--r-- | src/i_sound.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/i_sound.c b/src/i_sound.c index 0935c95c..937e78da 100644 --- a/src/i_sound.c +++ b/src/i_sound.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: i_sound.c 338 2006-01-23 01:40:24Z fraggle $ +// $Id: i_sound.c 425 2006-03-18 23:19:14Z 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 338 2006-01-23 01:40:24Z fraggle $"; +rcsid[] = "$Id: i_sound.c 425 2006-03-18 23:19:14Z fraggle $"; #include <stdio.h> #include <stdlib.h> @@ -552,6 +552,7 @@ I_InitSound() if (Mix_OpenAudio(22050, AUDIO_S16LSB, 2, 1024) < 0) { fprintf(stderr, "Error initialising SDL_mixer: %s\n", SDL_GetError()); + return; } Mix_AllocateChannels(NUM_CHANNELS); |