X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fsound.c;h=4a4077d5744ec18e6649b60151358a44baa3c200;hb=a79a6e75633c38c64c7f0460f01216bf80703ad3;hp=12c5c7fe91948b6588075a1c0f70c994fe383a07;hpb=91ea1e7e7758f29cccbd837719eaae65779c7438;p=flatwaifu.git diff --git a/src/sound.c b/src/sound.c index 12c5c7f..4a4077d 100644 --- a/src/sound.c +++ b/src/sound.c @@ -21,7 +21,6 @@ */ #include "glob.h" -#include "files.h" #include "sound.h" #include "error.h" #include @@ -32,15 +31,14 @@ 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) { + logo("S_init: настройка звука\n"); if (!SDL_WasInit(SDL_INIT_AUDIO)) { if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) { fprintf(stderr, "\nUnable to initialize audio: %s\n", SDL_GetError()); @@ -72,8 +70,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(); @@ -81,8 +78,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; @@ -150,8 +142,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);