From: Holger Schemel Date: Tue, 4 Apr 2017 18:49:46 +0000 (+0200) Subject: replaced hardcoded sounds with newly added element action sounds (MM engine) X-Git-Tag: 4.1.0.0~140 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=55961e9ba1fe67292a41fdcca0056b43bf960a93;p=rocksndiamonds.git replaced hardcoded sounds with newly added element action sounds (MM engine) --- diff --git a/sounds/snd_classic/bong.wav b/sounds/snd_classic/bong.wav new file mode 100644 index 00000000..9808fc1a 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 index 00000000..e382b2f3 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 index 00000000..d575ec49 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 index 00000000..733e660d 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 index 00000000..4698de41 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 index 00000000..9aea20cd 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 index 00000000..c117e7f4 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 index 00000000..9f549da4 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 index 00000000..bdbda99c 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 index 00000000..4da599de 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 index 00000000..96e4c374 Binary files /dev/null and b/sounds/snd_classic/whoosh.wav differ diff --git a/src/conf_snd.c b/src/conf_snd.c index 957259b5..854fe05c 100644 --- a/src/conf_snd.c +++ b/src/conf_snd.c @@ -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" }, diff --git a/src/game_mm/export.h b/src/game_mm/export.h index 1ea220b4..d92dcdb2 100644 --- a/src/game_mm/export.h +++ b/src/game_mm/export.h @@ -52,6 +52,7 @@ /* sounds */ #define SND_MM_GAME_LEVELTIME_CHARGING 0 +#define SND_MM_GAME_HEALTH_CHARGING 1 /* ------------------------------------------------------------------------- */ diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index ed84121d..d282dfe1 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -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; diff --git a/src/game_mm/mm_main.h b/src/game_mm/mm_main.h index 6c2ae34c..7688cca1 100644 --- a/src/game_mm/mm_main.h +++ b/src/game_mm/mm_main.h @@ -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 diff --git a/src/tools.c b/src/tools.c index e1ff8140..173c40aa 100644 --- a/src/tools.c +++ b/src/tools.c @@ -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; }