From 00b50443326b087a2a947d7aa00b868856555130 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 18 Mar 2006 23:19:14 +0000 Subject: Catch failures to initialise SDL_mixer properly, and fail gracefully rather than crashing the game. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 425 --- src/i_sound.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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 #include @@ -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); -- cgit v1.2.3