From bda9513f009aad0c47474942bd875932494da445 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Mon, 1 Mar 2021 13:18:05 +0300 Subject: Stalin shout. --- data/stalin.ogg | Bin 0 -> 16191 bytes src/game.c | 5 +++++ src/globals.c | 1 + src/globals.h | 1 + src/main.c | 2 ++ 5 files changed, 9 insertions(+) create mode 100644 data/stalin.ogg diff --git a/data/stalin.ogg b/data/stalin.ogg new file mode 100644 index 0000000..05a7364 Binary files /dev/null and b/data/stalin.ogg differ diff --git a/src/game.c b/src/game.c index 599fd50..db9d712 100644 --- a/src/game.c +++ b/src/game.c @@ -15,7 +15,12 @@ static void step(int d) if (xw || yw) { ttplayer.rem += d; } + static int first_gulag = 1; if (ttplayer.tobein_gulag && ttplayer.until_gulag > 0) { + if (first_gulag) { + first_gulag = 0; + Mix_PlayMusic(stalin, -1); + } ttplayer.until_gulag -= d; if (ttplayer.until_gulag <= 0) { ttplayer.room = ttmap + 'G'; diff --git a/src/globals.c b/src/globals.c index 79d9922..54c0adf 100644 --- a/src/globals.c +++ b/src/globals.c @@ -9,6 +9,7 @@ SDL_Renderer *ttrdr; Mix_Music *ponpon; Mix_Music *ussr; +Mix_Music *stalin; tt_room ttmap[256]; diff --git a/src/globals.h b/src/globals.h index f189be1..b44cddc 100644 --- a/src/globals.h +++ b/src/globals.h @@ -17,6 +17,7 @@ extern SDL_Renderer *ttrdr; extern Mix_Music *ponpon; extern Mix_Music *ussr; +extern Mix_Music *stalin; extern tt_room ttmap[256]; diff --git a/src/main.c b/src/main.c index a71312b..9bf2a27 100644 --- a/src/main.c +++ b/src/main.c @@ -32,6 +32,7 @@ int main(int argc, char **argv) ttfont = TTF_OpenFont("data/font.otf", 24); ponpon = Mix_LoadMUS("data/ponpon.ogg"); ussr = Mix_LoadMUS("data/ussr.ogg"); + stalin = Mix_LoadMUS("data/stalin.ogg"); tt_map_load(); srand(time(0)); @@ -45,6 +46,7 @@ int main(int argc, char **argv) SDL_DestroyRenderer(ttrdr); SDL_DestroyWindow(wdw); Mix_HaltMusic(); + Mix_FreeMusic(stalin); Mix_FreeMusic(ussr); Mix_FreeMusic(ponpon); Mix_CloseAudio(); -- cgit v1.2.3