From: Holger Schemel Date: Wed, 1 Nov 2017 23:43:39 +0000 (+0100) Subject: added support for separate opening/closing sounds for game/tape doors X-Git-Tag: 4.1.0.0~75 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=99bfb768ebcf81fe1026fff8492824175e4dd903;p=rocksndiamonds.git added support for separate opening/closing sounds for game/tape doors --- 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++)