added support for separate opening/closing sounds for game/tape doors
authorHolger Schemel <info@artsoft.org>
Wed, 1 Nov 2017 23:43:39 +0000 (00:43 +0100)
committerHolger Schemel <info@artsoft.org>
Fri, 23 Mar 2018 22:21:15 +0000 (23:21 +0100)
src/conf_snd.c
src/tools.c

index 854fe05cad9d875887e2a591899c85ff28b89316..ec7dd8cc4a593f88988cdeb84372b27633f35cf9 100644 (file)
@@ -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              },
index 6b817e85cf59cdbc8e012ea189b6c6c1249f8e19..a16135cc7926f2a03263daa105742adbf6b04fce 100644 (file)
@@ -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++)