summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2021-03-01 13:18:05 +0300
committerAleksey Veresov <aleksey@veresov.pro>2021-03-01 13:18:05 +0300
commitbda9513f009aad0c47474942bd875932494da445 (patch)
tree37743dd6fafa6064490a1c510642d6d21b406306
parentc47781a9d908536ef3283d4a57c91003013f05d3 (diff)
downloadtakethis-bda9513f009aad0c47474942bd875932494da445.tar
takethis-bda9513f009aad0c47474942bd875932494da445.tar.xz
takethis-bda9513f009aad0c47474942bd875932494da445.zip
Stalin shout.
-rw-r--r--data/stalin.oggbin0 -> 16191 bytes
-rw-r--r--src/game.c5
-rw-r--r--src/globals.c1
-rw-r--r--src/globals.h1
-rw-r--r--src/main.c2
5 files changed, 9 insertions, 0 deletions
diff --git a/data/stalin.ogg b/data/stalin.ogg
new file mode 100644
index 0000000..05a7364
--- /dev/null
+++ b/data/stalin.ogg
Binary files 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();