diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-06-11 23:28:43 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-06-11 23:42:30 +0200 |
| commit | 324ac3b807181ecd24b8ac96a83dee101509e6fc (patch) | |
| tree | 8bb0f5c2a18ba519bd7fe76401dbcec508afeffe /src | |
| parent | 48428c2e4302e3f2fc566af565a31eacea06f0a5 (diff) | |
| download | jancity-324ac3b807181ecd24b8ac96a83dee101509e6fc.tar.gz | |
sdl-1.2/sound.c: use SDL_WasInit
Diffstat (limited to 'src')
| -rw-r--r-- | src/sfx/sdl-1.2/src/sound.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/sfx/sdl-1.2/src/sound.c b/src/sfx/sdl-1.2/src/sound.c index d2ee40a..c7ef240 100644 --- a/src/sfx/sdl-1.2/src/sound.c +++ b/src/sfx/sdl-1.2/src/sound.c @@ -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)) |
