X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fsound.c;h=2fe510b4115479f815d32e3a4d347df286dc9989;hb=b7c39e0d9229a7616c63cf545cdd9576b9bf3e2c;hp=de334340c50f820be2065c5339790bd586cae71e;hpb=82abbc606cc5e3d9c26e2ab6d36e093ed86ae1bf;p=flatwaifu.git diff --git a/src/sound.c b/src/sound.c index de33434..2fe510b 100644 --- a/src/sound.c +++ b/src/sound.c @@ -31,15 +31,13 @@ short snd_vol = 50; -int snddisabled = 1; - -struct { +static int snddisabled = 1; +static struct { snd_t *s; Mix_Chunk *c; } chunks[NUM_CHUNKS]; -void S_init(void) -{ +void S_init (void) { if (!SDL_WasInit(SDL_INIT_AUDIO)) { if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) { fprintf(stderr, "\nUnable to initialize audio: %s\n", SDL_GetError()); @@ -71,8 +69,7 @@ void S_init(void) S_volume(snd_vol); } -void S_done(void) -{ +void S_done (void) { free_chunks(); if (SDL_WasInit(SDL_INIT_AUDIO)) { Mix_CloseAudio(); @@ -80,8 +77,7 @@ void S_done(void) } } -Mix_Chunk * get_chunk(snd_t *s, int r, int v) -{ +static Mix_Chunk *get_chunk (snd_t *s, int r, int v) { int i, fi = -1; for(i=0; i128) snd_vol=128; @@ -149,8 +141,7 @@ void S_volume(int v) Mix_Volume(-1, snd_vol); } -void S_wait() -{ +void S_wait (void) { if (snddisabled) return; while (Mix_Playing(-1)) { SDL_Delay(10);