sdl-1.2/sound.c: use SDL_WasInit
This commit is contained in:
parent
3f6bf6aa1a
commit
a826c2364d
|
@ -7,7 +7,7 @@
|
|||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static bool subsystem_init, mixer_init;
|
||||
static bool mixer_init;
|
||||
|
||||
void sfx_free(struct sound *const s)
|
||||
{
|
||||
|
@ -73,7 +73,7 @@ void sfx_deinit(void)
|
|||
if (mixer_init)
|
||||
Mix_CloseAudio();
|
||||
|
||||
if (subsystem_init)
|
||||
if (SDL_WasInit(SDL_INIT_AUDIO) & SDL_INIT_AUDIO)
|
||||
SDL_QuitSubSystem(SDL_INIT_AUDIO);
|
||||
}
|
||||
|
||||
|
@ -87,8 +87,6 @@ int sfx_init(void)
|
|||
fprintf(stderr, "SDL_InitSubSystem: %s\n", SDL_GetError());
|
||||
goto failure;
|
||||
}
|
||||
else
|
||||
subsystem_init = true;
|
||||
|
||||
if (Mix_OpenAudio(MIX_DEFAULT_FREQUENCY,
|
||||
MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, CHUNK_SZ))
|
||||
|
|
Loading…
Reference in New Issue