X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fsound.c;h=4a4077d5744ec18e6649b60151358a44baa3c200;hb=a79a6e75633c38c64c7f0460f01216bf80703ad3;hp=cee95a9272077da13635fcd1169a57ad4d3a7ad2;hpb=2404cdef804cd358dda0ee7accc76cd3eea04b87;p=flatwaifu.git diff --git a/src/sound.c b/src/sound.c index cee95a9..4a4077d 100644 --- a/src/sound.c +++ b/src/sound.c @@ -21,8 +21,8 @@ */ #include "glob.h" -#include "files.h" #include "sound.h" +#include "error.h" #include #include @@ -31,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()); @@ -71,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(); @@ -80,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; @@ -149,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);