From 99bfb768ebcf81fe1026fff8492824175e4dd903 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Thu, 2 Nov 2017 00:43:39 +0100 Subject: [PATCH] added support for separate opening/closing sounds for game/tape doors --- src/conf_snd.c | 4 ++++ src/tools.c | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/conf_snd.c b/src/conf_snd.c index 854fe05c..ec7dd8cc 100644 --- a/src/conf_snd.c +++ b/src/conf_snd.c @@ -297,6 +297,10 @@ struct ConfigInfo sound_config[] = /* sounds for other non-game actions */ { "door.opening", "door.wav" }, { "door.closing", "door.wav" }, + { "door_1.opening", UNDEFINED_FILENAME }, + { "door_1.closing", UNDEFINED_FILENAME }, + { "door_2.opening", UNDEFINED_FILENAME }, + { "door_2.closing", UNDEFINED_FILENAME }, { "request.opening", UNDEFINED_FILENAME }, { "request.closing", UNDEFINED_FILENAME }, diff --git a/src/tools.c b/src/tools.c index 6b817e85..a16135cc 100644 --- a/src/tools.c +++ b/src/tools.c @@ -4862,9 +4862,23 @@ unsigned int MoveDoor(unsigned int door_state) { /* opening door sound has priority over simultaneously closing door */ if (door_state & (DOOR_OPEN_1 | DOOR_OPEN_2)) + { PlayMenuSoundStereo(SND_DOOR_OPENING, SOUND_MIDDLE); + + if (door_state & DOOR_OPEN_1) + PlayMenuSoundStereo(SND_DOOR_1_OPENING, SOUND_MIDDLE); + if (door_state & DOOR_OPEN_2) + PlayMenuSoundStereo(SND_DOOR_2_OPENING, SOUND_MIDDLE); + } else if (door_state & (DOOR_CLOSE_1 | DOOR_CLOSE_2)) + { PlayMenuSoundStereo(SND_DOOR_CLOSING, SOUND_MIDDLE); + + if (door_state & DOOR_CLOSE_1) + PlayMenuSoundStereo(SND_DOOR_1_CLOSING, SOUND_MIDDLE); + if (door_state & DOOR_CLOSE_2) + PlayMenuSoundStereo(SND_DOOR_2_CLOSING, SOUND_MIDDLE); + } } for (k = start; k < num_move_steps; k++) -- 2.34.1