replaced hardcoded sounds with newly added element action sounds (MM engine)
authorHolger Schemel <info@artsoft.org>
Tue, 4 Apr 2017 18:49:46 +0000 (20:49 +0200)
committerHolger Schemel <info@artsoft.org>
Fri, 23 Mar 2018 22:21:12 +0000 (23:21 +0100)
16 files changed:
sounds/snd_classic/bong.wav [new file with mode: 0644]
sounds/snd_classic/holz.wav [new file with mode: 0644]
sounds/snd_classic/hui.wav [new file with mode: 0644]
sounds/snd_classic/kabumm.wav [new file with mode: 0644]
sounds/snd_classic/kink.wav [new file with mode: 0644]
sounds/snd_classic/kling.wav [new file with mode: 0644]
sounds/snd_classic/laser.wav [new file with mode: 0644]
sounds/snd_classic/quiek.wav [new file with mode: 0644]
sounds/snd_classic/slurp.wav [new file with mode: 0644]
sounds/snd_classic/warnton.wav [new file with mode: 0644]
sounds/snd_classic/whoosh.wav [new file with mode: 0644]
src/conf_snd.c
src/game_mm/export.h
src/game_mm/mm_game.c
src/game_mm/mm_main.h
src/tools.c

diff --git a/sounds/snd_classic/bong.wav b/sounds/snd_classic/bong.wav
new file mode 100644 (file)
index 0000000..9808fc1
Binary files /dev/null and b/sounds/snd_classic/bong.wav differ
diff --git a/sounds/snd_classic/holz.wav b/sounds/snd_classic/holz.wav
new file mode 100644 (file)
index 0000000..e382b2f
Binary files /dev/null and b/sounds/snd_classic/holz.wav differ
diff --git a/sounds/snd_classic/hui.wav b/sounds/snd_classic/hui.wav
new file mode 100644 (file)
index 0000000..d575ec4
Binary files /dev/null and b/sounds/snd_classic/hui.wav differ
diff --git a/sounds/snd_classic/kabumm.wav b/sounds/snd_classic/kabumm.wav
new file mode 100644 (file)
index 0000000..733e660
Binary files /dev/null and b/sounds/snd_classic/kabumm.wav differ
diff --git a/sounds/snd_classic/kink.wav b/sounds/snd_classic/kink.wav
new file mode 100644 (file)
index 0000000..4698de4
Binary files /dev/null and b/sounds/snd_classic/kink.wav differ
diff --git a/sounds/snd_classic/kling.wav b/sounds/snd_classic/kling.wav
new file mode 100644 (file)
index 0000000..9aea20c
Binary files /dev/null and b/sounds/snd_classic/kling.wav differ
diff --git a/sounds/snd_classic/laser.wav b/sounds/snd_classic/laser.wav
new file mode 100644 (file)
index 0000000..c117e7f
Binary files /dev/null and b/sounds/snd_classic/laser.wav differ
diff --git a/sounds/snd_classic/quiek.wav b/sounds/snd_classic/quiek.wav
new file mode 100644 (file)
index 0000000..9f549da
Binary files /dev/null and b/sounds/snd_classic/quiek.wav differ
diff --git a/sounds/snd_classic/slurp.wav b/sounds/snd_classic/slurp.wav
new file mode 100644 (file)
index 0000000..bdbda99
Binary files /dev/null and b/sounds/snd_classic/slurp.wav differ
diff --git a/sounds/snd_classic/warnton.wav b/sounds/snd_classic/warnton.wav
new file mode 100644 (file)
index 0000000..4da599d
Binary files /dev/null and b/sounds/snd_classic/warnton.wav differ
diff --git a/sounds/snd_classic/whoosh.wav b/sounds/snd_classic/whoosh.wav
new file mode 100644 (file)
index 0000000..96e4c37
Binary files /dev/null and b/sounds/snd_classic/whoosh.wav differ
index 957259b56669c15bbed6e363b6da88b44019a8f3..854fe05cad9d875887e2a591899c85ff28b89316 100644 (file)
@@ -38,7 +38,9 @@ struct ConfigInfo sound_config[] =
   { "[default].passing",               "gate.wav"                      },
   { "[default].dying",                 "autsch.wav"                    },
   { "[default].exploding",             "roaaar.wav"                    },
+  { "[default].hitting",               "kink.wav"                      },
   { "[sp_default].exploding",          "booom.wav"                     },
+  { "[mm_default].exploding",          "kabumm.wav"                    },
 
   /* sounds for Boulder Dash style elements and actions */
   { "bd_diamond.collecting",           "pong.wav"                      },
@@ -235,13 +237,56 @@ struct ConfigInfo sound_config[] =
   { "dragon.waiting",                  UNDEFINED_FILENAME              },
   { "dragon.attacking",                        UNDEFINED_FILENAME              },
 
+  /* sounds for Mirror Magic style elements and actions */
+  { "[mm_mcduffin].hitting",           "autsch.wav"                    },
+  { "[mm_mirror].hitting",             "laser.wav"                     },
+  { "[mm_mirror_fixed].hitting",       "laser.wav"                     },
+  { "[mm_prism].hitting",              "laser.wav"                     },
+  { "[mm_exit].hitting",               "holz.wav"                      },
+  { "[mm_exit].opening",               "kling.wav"                     },
+  { "mm_exit_open.hitting",            UNDEFINED_FILENAME              },
+  { "[df_mirror].hitting",             "laser.wav"                     },
+  { "[df_mirror_rotating].hitting",    "laser.wav"                     },
+  { "[df_refractor].hitting",          "laser.wav"                     },
+  { "[df_receiver].hitting",           "holz.wav"                      },
+  { "[df_receiver].opening",           "kling.wav"                     },
+  { "[mm_wooden_wall].hitting",                "holz.wav"                      },
+  { "[mm_wooden_block].hitting",       "holz.wav"                      },
+  { "[mm_wooden_block].pushing",       "bong.wav"                      },
+  { "[mm_wooden_lock].hitting",                "holz.wav"                      },
+  { "[mm_wooden_grid_fixed].hitting",  "holz.wav"                      },
+  { "[mm_fuse].hitting",               "holz.wav"                      },
+  { "[mm_ice_wall].hitting",           "holz.wav"                      },
+  { "[mm_ice_wall].shrinking",         "slurp.wav"                     },
+  { "[mm_amoeba_wall].hitting",                "holz.wav"                      },
+  { "[mm_amoeba_wall].growing",                "amoebe.wav"                    },
+  { "[mm_amoeba_wall].growing.mode_loop","false"                       },
+  { "[df_wooden_wall].hitting",                "holz.wav"                      },
+  { "[df_wooden_grid_fixed].hitting",  "holz.wav"                      },
+  { "[df_wooden_grid_rotating].hitting","holz.wav"                     },
+  { "[mm_steel_wall].hitting",         "hui.wav"                       },
+  { "[mm_steel_grid_fixed].hitting",   "hui.wav"                       },
+  { "[mm_steel_block].hitting",                "hui.wav"                       },
+  { "[mm_steel_block].pushing",                "bong.wav"                      },
+  { "[mm_steel_lock].hitting",         "hui.wav"                       },
+  { "[df_steel_wall].hitting",         "hui.wav"                       },
+  { "[df_steel_grid_fixed].hitting",   "hui.wav"                       },
+  { "[df_steel_grid_rotating].hitting",        "hui.wav"                       },
+
+  { "[mm_pacman].exploding",           "quiek.wav"                     },
+  { "[mm_mcduffin].exploding",         "roaaar.wav"                    },
+  { "[mm_bomb].exploding",             "roaaar.wav"                    },
+  { "[mm_key].exploding",              "kling.wav"                     },
+  { "[mm_steel_lock].exploding",       "whoosh.wav"                    },
+  { "[mm_wooden_lock].exploding",      "whoosh.wav"                    },
+
   /* sounds not associated to game elements (used for menu screens etc.) */
   /* keyword to stop parser: "NO_MORE_ELEMENT_SOUNDS" <-- do not change! */
 
   /* sounds for other game actions */
   { "game.starting",                   UNDEFINED_FILENAME              },
   { "game.leveltime_charging",         "fuel.wav"                      },
-  { "game.health_charging",            UNDEFINED_FILENAME              },
+  { "game.health_charging",            "warnton.wav"                   },
   { "game.running_out_of_time",                "gong.wav"                      },
   { "game.leveltime_bonus",            "sirr.wav"                      },
   { "game.health_bonus",               "sirr.wav"                      },
index 1ea220b43c492cf92d8062f19f4ad301c113edfd..d92dcdb2f8cf2c5e09aa41fb35512152349023f3 100644 (file)
@@ -52,6 +52,7 @@
 
 /* sounds */
 #define SND_MM_GAME_LEVELTIME_CHARGING 0
+#define SND_MM_GAME_HEALTH_CHARGING    1
 
 
 /* ------------------------------------------------------------------------- */
index ed84121dd2d75d463aeb4f6535e4ffa47d7d5e41..d282dfe110eccbb1db631072a13035ee07ce64c0 100644 (file)
@@ -1075,7 +1075,7 @@ boolean HitElement(int element, int hit_mask)
       ((element - EL_POLAR_START) % 2 ||
        (element - EL_POLAR_START) / 2 != laser.current_angle % 8))
   {
-    PlaySoundStereo(SND_KINK, ST(ELX));
+    PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_HITTING);
 
     laser.num_damages--;
 
@@ -1085,7 +1085,7 @@ boolean HitElement(int element, int hit_mask)
   if (IS_POLAR_CROSS(element) &&
       (element - EL_POLAR_CROSS_START) != laser.current_angle % 4)
   {
-    PlaySoundStereo(SND_KINK, ST(ELX));
+    PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_HITTING);
 
     laser.num_damages--;
 
@@ -1163,7 +1163,7 @@ boolean HitElement(int element, int hit_mask)
 
     if ((!IS_POLAR(element) && !IS_POLAR_CROSS(element)) &&
        current_angle != laser.current_angle)
-      PlaySoundStereo(SND_LASER, ST(ELX));
+      PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_HITTING);
 
     laser.overloaded =
       (get_opposite_angle(laser.current_angle) ==
@@ -1181,7 +1181,7 @@ boolean HitElement(int element, int hit_mask)
 
   if (element == EL_BOMB || element == EL_MINE)
   {
-    PlaySoundStereo(SND_KINK, ST(ELX));
+    PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_HITTING);
 
     if (element == EL_MINE)
       laser.overloaded = TRUE;
@@ -1209,6 +1209,7 @@ boolean HitElement(int element, int hit_mask)
 
       if (game_mm.kettles_still_needed == 0)
       {
+       int exit_element = (element == EL_KETTLE ? EL_EXIT_OPEN : EL_RECEIVER);
        int x, y;
        static int xy[4][2] =
        {
@@ -1218,7 +1219,7 @@ boolean HitElement(int element, int hit_mask)
          {  0, +1 }
        };
 
-        PlaySoundStereo(SND_KLING, ST(ELX));
+       PlayLevelSound_MM(ELX, ELY, exit_element, MM_ACTION_OPENING);
 
        for (y = 0; y < lev_fieldy; y++)
        {
@@ -1269,7 +1270,7 @@ boolean HitElement(int element, int hit_mask)
 
   if (element == EL_LIGHTBULB_OFF || element == EL_LIGHTBULB_ON)
   {
-    PlaySoundStereo(SND_KINK, ST(ELX));
+    PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_HITTING);
 
     DrawLaser(0, DL_LASER_ENABLED);
 
@@ -1626,13 +1627,14 @@ boolean HitBlock(int element, int hit_mask)
 
 boolean HitLaserSource(int element, int hit_mask)
 {
-   if (HitOnlyAnEdge(element, hit_mask))
-     return FALSE;
+  if (HitOnlyAnEdge(element, hit_mask))
+    return FALSE;
+
+  PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_HITTING);
 
-   PlaySoundStereo(SND_AUTSCH, ST(ELX));
-   laser.overloaded = TRUE;
+  laser.overloaded = TRUE;
 
-   return TRUE;
+  return TRUE;
 }
 
 boolean HitLaserDestination(int element, int hit_mask)
@@ -1645,7 +1647,8 @@ boolean HitLaserDestination(int element, int hit_mask)
        game_mm.kettles_still_needed == 0 &&
        laser.current_angle == get_opposite_angle(get_element_angle(element))))
   {
-    PlaySoundStereo(SND_HOLZ, ST(ELX));
+    PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_HITTING);
+
     return TRUE;
   }
 
@@ -1684,7 +1687,7 @@ boolean HitReflectingWalls(int element, int hit_mask)
                                            hit_mask == HIT_MASK_RIGHT ||
                                            hit_mask == HIT_MASK_BOTTOM))
   {
-    PlaySoundStereo(SND_HUI, ST(ELX));
+    PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_HITTING);
 
     LX -= XS;
     LY -= YS;
@@ -1783,7 +1786,7 @@ boolean HitReflectingWalls(int element, int hit_mask)
        (hit_mask == HIT_MASK_TOPRIGHT || hit_mask == HIT_MASK_BOTTOMLEFT ?
         ANG_MIRROR_135 : ANG_MIRROR_45);
 
-      PlaySoundStereo(SND_HUI, ST(ELX));
+      PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_HITTING);
 
       AddDamagedField(ELX, ELY);
       AddLaserEdge(LX, LY);
@@ -1819,7 +1822,7 @@ boolean HitReflectingWalls(int element, int hit_mask)
         hit_mask == (HIT_MASK_ALL ^ HIT_MASK_TOPRIGHT) ?
         ANG_MIRROR_135 : ANG_MIRROR_45);
 
-      PlaySoundStereo(SND_HUI, ST(ELX));
+      PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_HITTING);
 
       /*
       AddDamagedField(ELX, ELY);
@@ -1912,7 +1915,7 @@ boolean HitAbsorbingWalls(int element, int hit_mask)
       element == EL_BLOCK_WOOD ||
       element == EL_GATE_WOOD)
   {
-    PlaySoundStereo(SND_HOLZ, ST(ELX));
+    PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_HITTING);
 
     return TRUE;
   }
@@ -2265,13 +2268,13 @@ static void Bang_MM(int x, int y)
   }
 
   if (IS_PACMAN(element))
-    PlaySoundStereo(SND_QUIEK, ST(x));
+    PlayLevelSound_MM(x, y, element, MM_ACTION_EXPLODING);
   else if (element == EL_BOMB || IS_MCDUFFIN(element))
-    PlaySoundStereo(SND_ROAAAR, ST(x));
+    PlayLevelSound_MM(x, y, element, MM_ACTION_EXPLODING);
   else if (element == EL_KEY)
-    PlaySoundStereo(SND_KLING, ST(x));
+    PlayLevelSound_MM(x, y, element, MM_ACTION_EXPLODING);
   else
-    PlaySoundStereo((mode == EX_SHORT ? SND_WHOOSH : SND_KABUMM), ST(x));
+    PlayLevelSound_MM(x, y, element, MM_ACTION_EXPLODING);
 
   Explode_MM(x, y, EX_PHASE_START, mode);
 }
@@ -2851,7 +2854,7 @@ static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode)
        Delay(50);
       }
 
-      StopSound(SND_WARNTON);
+      StopSound_MM(SND_MM_GAME_HEALTH_CHARGING);
       FadeMusic();
 
       DrawLaser(0, DL_LASER_DISABLED);
@@ -2933,17 +2936,12 @@ static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode)
       BackToFront();
     }
 
-    if (laser.overloaded)
-    {
-      if (setup.sound_loops)
-       PlaySoundExt(SND_WARNTON, SOUND_MAX_VOLUME, SOUND_MAX_RIGHT,
-                    SND_CTRL_PLAY_LOOP);
-      else
-       PlaySoundStereo(SND_WARNTON, SOUND_MAX_RIGHT);
-    }
-
     if (!laser.overloaded)
-      StopSound(SND_WARNTON);
+      StopSound_MM(SND_MM_GAME_HEALTH_CHARGING);
+    else if (setup.sound_loops)
+      PlaySoundLoop_MM(SND_MM_GAME_HEALTH_CHARGING);
+    else
+      PlaySound_MM(SND_MM_GAME_HEALTH_CHARGING);
 
     if (laser.overloaded)
     {
@@ -3182,7 +3180,7 @@ static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode)
 
   if (IS_WALL_ICE(element) && CT > 1000)
   {
-    PlaySoundStereo(SND_SLURP, ST(ELX));
+    PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_SHRINKING);
 
     {
       Feld[ELX][ELY] = Feld[ELX][ELY] - EL_WALL_ICE + EL_WALL_CHANGING;
@@ -3320,7 +3318,7 @@ static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode)
       ScanLaser();
       DrawLaser(0, DL_LASER_ENABLED);
 
-      PlaySoundStereo(SND_AMOEBE, ST(dx));
+      PlayLevelSound_MM(dx, dy, element, MM_ACTION_GROWING);
 
       Feld[x][y] = Feld[x][y] - EL_WALL_AMOEBA + EL_WALL_CHANGING;
       Store[x][y] = EL_WALL_AMOEBA;
@@ -3334,7 +3332,7 @@ static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode)
     ScanLaser();
     DrawLaser(0, DL_LASER_ENABLED);
 
-    PlaySoundStereo(SND_AMOEBE, ST(dx));
+    PlayLevelSound_MM(dx, dy, element, MM_ACTION_GROWING);
 
     for (i = 4; i >= 0; i--)
     {
@@ -3388,7 +3386,7 @@ static void GameActions_MM_Ext(struct MouseActionInfo action, boolean warp_mode)
       return;
     }
 
-    PlaySoundStereo(SND_BONG, ST(ELX));
+    PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_PUSHING);
 
     Feld[ELX][ELY] = 0;
     Feld[x][y] = element;
index 6c2ae34c899fb2a00cdbd8d48475dd91b2ff659a..7688cca13c79394056f22fd9451d0ea608dd9c7b 100644 (file)
@@ -1008,6 +1008,61 @@ extern int               num_element_info;
 
 #define NUM_SOUNDS             20
 
+/* values for graphics/sounds action types */
+#define MM_ACTION_DEFAULT      0
+#define MM_ACTION_WAITING      1
+#define MM_ACTION_FALLING      2
+#define MM_ACTION_MOVING       3
+#define MM_ACTION_DIGGING      4
+#define MM_ACTION_SNAPPING     5
+#define MM_ACTION_COLLECTING   6
+#define MM_ACTION_DROPPING     7
+#define MM_ACTION_PUSHING      8
+#define MM_ACTION_WALKING      9
+#define MM_ACTION_PASSING      10
+#define MM_ACTION_IMPACT       11
+#define MM_ACTION_BREAKING     12
+#define MM_ACTION_ACTIVATING   13
+#define MM_ACTION_DEACTIVATING 14
+#define MM_ACTION_OPENING      15
+#define MM_ACTION_CLOSING      16
+#define MM_ACTION_ATTACKING    17
+#define MM_ACTION_GROWING      18
+#define MM_ACTION_SHRINKING    19
+#define MM_ACTION_ACTIVE       20
+#define MM_ACTION_FILLING      21
+#define MM_ACTION_EMPTYING     22
+#define MM_ACTION_CHANGING     23
+#define MM_ACTION_EXPLODING    24
+#define MM_ACTION_BORING       25
+#define MM_ACTION_BORING_1     26
+#define MM_ACTION_BORING_2     27
+#define MM_ACTION_BORING_3     28
+#define MM_ACTION_BORING_4     29
+#define MM_ACTION_BORING_5     30
+#define MM_ACTION_BORING_6     31
+#define MM_ACTION_BORING_7     32
+#define MM_ACTION_BORING_8     33
+#define MM_ACTION_BORING_9     34
+#define MM_ACTION_BORING_10    35
+#define MM_ACTION_SLEEPING     36
+#define MM_ACTION_SLEEPING_1   37
+#define MM_ACTION_SLEEPING_2   38
+#define MM_ACTION_SLEEPING_3   39
+#define MM_ACTION_AWAKENING    40
+#define MM_ACTION_DYING                41
+#define MM_ACTION_TURNING              42
+#define MM_ACTION_TURNING_FROM_LEFT    43
+#define MM_ACTION_TURNING_FROM_RIGHT   44
+#define MM_ACTION_TURNING_FROM_UP      45
+#define MM_ACTION_TURNING_FROM_DOWN    46
+#define MM_ACTION_SMASHED_BY_ROCK      47
+#define MM_ACTION_SMASHED_BY_SPRING    48
+#define MM_ACTION_EATING               49
+#define MM_ACTION_TWINKLING            50
+#define MM_ACTION_SPLASHING            51
+#define MM_ACTION_HITTING              52
+
 /* laser angles (directions) */
 #define ANG_RAY_RIGHT          0
 #define ANG_RAY_UP             4
index e1ff8140e3d56fbc44f8e30f050024072961a5d2..173c40aa658c7e28a3ea0808b8cc6749a6e5f618 100644 (file)
@@ -7409,6 +7409,9 @@ int map_sound_MM_to_RND(int sound_mm)
     case SND_MM_GAME_LEVELTIME_CHARGING:
       return SND_GAME_LEVELTIME_CHARGING;
 
+    case SND_MM_GAME_HEALTH_CHARGING:
+      return SND_GAME_HEALTH_CHARGING;
+
     default:
       return SND_UNDEFINED;
   }