diff options
-rw-r--r-- | data/coin.wav | bin | 0 -> 39824 bytes | |||
-rw-r--r-- | data/door.wav | bin | 0 -> 228766 bytes | |||
-rw-r--r-- | src/game.c | 3 | ||||
-rw-r--r-- | src/globals.c | 2 | ||||
-rw-r--r-- | src/globals.h | 2 | ||||
-rw-r--r-- | src/main.c | 3 |
6 files changed, 10 insertions, 0 deletions
diff --git a/data/coin.wav b/data/coin.wav Binary files differnew file mode 100644 index 0000000..c0dc31c --- /dev/null +++ b/data/coin.wav diff --git a/data/door.wav b/data/door.wav Binary files differnew file mode 100644 index 0000000..9256e0e --- /dev/null +++ b/data/door.wav @@ -297,6 +297,7 @@ static void togulag(tt_body *b) b->txrcol = 15; b->msg = 0; b->msglen = 0; + Mix_PlayChannel(-1, ttcoin, 0); ttplayer.money++; } @@ -322,6 +323,7 @@ static void keytake(tt_body *b) b->txrcol = 15; b->msg = 0; b->msglen = 0; + Mix_PlayChannel(-1, ttcoin, 0); } static void doorcol(tt_body *b) @@ -355,6 +357,7 @@ static void doorcol(tt_body *b) part->txrcol = 15; part->msg = 0; part->msglen = 0; + Mix_PlayChannel(-1, ttdoor, 0); } } diff --git a/src/globals.c b/src/globals.c index 7577c41..dbc322c 100644 --- a/src/globals.c +++ b/src/globals.c @@ -8,6 +8,8 @@ SDL_Texture *tttxr; SDL_Renderer *ttrdr; +Mix_Chunk *ttcoin; +Mix_Chunk *ttdoor; Mix_Music *grib; Mix_Music *ussr; Mix_Music *stalin; diff --git a/src/globals.h b/src/globals.h index bfd6c5e..05584a2 100644 --- a/src/globals.h +++ b/src/globals.h @@ -15,6 +15,8 @@ extern SDL_Texture *tttxr; extern SDL_Renderer *ttrdr; +extern Mix_Chunk *ttcoin; +extern Mix_Chunk *ttdoor; extern Mix_Music *grib; extern Mix_Music *ussr; extern Mix_Music *stalin; @@ -22,6 +22,7 @@ int main(int argc, char **argv) TTF_Init(); Mix_Init(MIX_INIT_OGG); Mix_OpenAudio(44100, AUDIO_S16SYS, 2, 4096); + Mix_AllocateChannels(4); ttwdw = SDL_CreateWindow("T A K E T H I S", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 950, 540, 0); ttrdr = SDL_CreateRenderer(ttwdw, -1, SDL_RENDERER_ACCELERATED); @@ -31,6 +32,8 @@ int main(int argc, char **argv) ussr = Mix_LoadMUS("data/ussr.ogg"); stalin = Mix_LoadMUS("data/stalin.ogg"); lenin = Mix_LoadMUS("data/lenin.ogg"); + ttcoin = Mix_LoadWAV("data/coin.wav"); + ttdoor = Mix_LoadWAV("data/door.wav"); curmus = 0; tt_map_load(); |