From 51dcb2097c619c5f9ba924a7edb4a3bdd6a6986e Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Mon, 7 Mar 2005 00:22:32 +0100 Subject: [PATCH] rnd-20050307-1-src * fixed mapping of obsolete element token names in "editorsetup.conf" * fixed bug with sound "acid.splashing" treated as a loop sound * fixed some little sound bugs in native EM engine --- ChangeLog | 5 + src/conf_e2s.c | 20 ++++ src/conf_snd.c | 7 +- src/conf_snd.h | 178 +++++++++++++++--------------- src/conftime.h | 2 +- src/files.c | 14 ++- src/game.c | 41 +++++-- src/game_em/convert.c | 25 +++++ src/game_em/init.c | 6 + src/game_em/main_em.h | 9 +- src/game_em/sample.h | 9 +- src/game_em/sound.c | 7 +- src/game_em/synchro_1.c | 18 +-- src/game_em/synchro_2.c | 238 ++++++++++++++++++++-------------------- src/game_em/synchro_3.c | 2 +- src/init.c | 103 ++++++++++------- src/libgame/misc.c | 51 +++++---- src/libgame/misc.h | 2 + src/main.c | 1 + src/main.h | 5 +- src/screens.c | 2 + 21 files changed, 444 insertions(+), 301 deletions(-) diff --git a/ChangeLog b/ChangeLog index 177d856c..630b370a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-03-06 + * fixed mapping of obsolete element token names in "editorsetup.conf" + * fixed bug with sound "acid.splashing" treated as a loop sound + * fixed some little sound bugs in native EM engine + 2005-02-20 * fixed small bug when dragging scrollbars to end positions diff --git a/src/conf_e2s.c b/src/conf_e2s.c index ccb1060c..825dc7a6 100644 --- a/src/conf_e2s.c +++ b/src/conf_e2s.c @@ -388,6 +388,10 @@ element_to_sound[] = EL_AMOEBA_DEAD, TRUE, ACTION_DROPPING, SND_CLASS_AMOEBA_DROPPING }, + { + EL_ACID, FALSE, ACTION_SPLASHING, + SND_ACID_SPLASHING + }, { EL_QUICKSAND_EMPTY, TRUE, ACTION_FILLING, SND_CLASS_QUICKSAND_FILLING @@ -444,6 +448,22 @@ element_to_sound[] = EL_WALL, TRUE, ACTION_GROWING, SND_CLASS_WALL_GROWING }, + { + EL_EMC_ANDROID, FALSE, ACTION_PUSHING, + SND_EMC_ANDROID_PUSHING + }, + { + EL_EMC_ANDROID, FALSE, ACTION_MOVING, + SND_EMC_ANDROID_MOVING + }, + { + EL_EMC_ANDROID, FALSE, ACTION_DROPPING, + SND_EMC_ANDROID_DROPPING + }, + { + EL_EMC_MAGIC_BALL, FALSE, ACTION_DROPPING, + SND_EMC_MAGIC_BALL_DROPPING + }, { EL_PEARL, FALSE, ACTION_COLLECTING, SND_PEARL_COLLECTING diff --git a/src/conf_snd.c b/src/conf_snd.c index 222f43f9..8cdd4d7b 100644 --- a/src/conf_snd.c +++ b/src/conf_snd.c @@ -112,7 +112,7 @@ struct ConfigInfo sound_config[] = { "spaceship.waiting", "roehr.wav" }, { "yamyam.moving", UNDEFINED_FILENAME }, { "yamyam.waiting", "njam.wav" }, - { "yamyam.digging", UNDEFINED_FILENAME }, + { "yamyam.digging", "njam.wav" }, { "robot.moving", "schlurf.wav" }, { "robot.moving.mode_loop", "false" }, { "robot.waiting", UNDEFINED_FILENAME }, @@ -141,6 +141,11 @@ struct ConfigInfo sound_config[] = { "spring.pushing", "pusch.wav" }, { "spring.impact", "klopf.wav" }, { "[wall].growing", UNDEFINED_FILENAME }, + { "emc_android.pushing", "pusch.wav" }, + { "emc_android.moving", "roehr.wav" }, + { "emc_android.moving.mode_loop", "false" }, + { "emc_android.dropping", "deng.wav" }, + { "emc_magic_ball.dropping", "deng.wav" }, /* sounds for Diamond Caves style elements and actions */ { "pearl.collecting", "pong.wav" }, diff --git a/src/conf_snd.h b/src/conf_snd.h index 0c1b717c..91bb1291 100644 --- a/src/conf_snd.h +++ b/src/conf_snd.h @@ -116,93 +116,97 @@ #define SND_SPRING_PUSHING 95 #define SND_SPRING_IMPACT 96 #define SND_CLASS_WALL_GROWING 97 -#define SND_PEARL_COLLECTING 98 -#define SND_PEARL_BREAKING 99 -#define SND_PEARL_IMPACT 100 -#define SND_CRYSTAL_COLLECTING 101 -#define SND_CRYSTAL_IMPACT 102 -#define SND_CLASS_ENVELOPE_COLLECTING 103 -#define SND_CLASS_ENVELOPE_OPENING 104 -#define SND_CLASS_ENVELOPE_CLOSING 105 -#define SND_INVISIBLE_SAND_DIGGING 106 -#define SND_INVISIBLE_SAND_ACTIVE_DIGGING 107 -#define SND_SHIELD_NORMAL_COLLECTING 108 -#define SND_SHIELD_NORMAL_ACTIVE 109 -#define SND_SHIELD_DEADLY_COLLECTING 110 -#define SND_SHIELD_DEADLY_ACTIVE 111 -#define SND_EXTRA_TIME_COLLECTING 112 -#define SND_MOLE_MOVING 113 -#define SND_MOLE_WAITING 114 -#define SND_MOLE_DIGGING 115 -#define SND_CLASS_SWITCHGATE_SWITCH_ACTIVATING 116 -#define SND_CLASS_SWITCHGATE_OPENING 117 -#define SND_CLASS_SWITCHGATE_CLOSING 118 -#define SND_CLASS_SWITCHGATE_PASSING 119 -#define SND_TIMEGATE_SWITCH_ACTIVATING 120 -#define SND_TIMEGATE_SWITCH_ACTIVE 121 -#define SND_TIMEGATE_SWITCH_DEACTIVATING 122 -#define SND_TIMEGATE_OPENING 123 -#define SND_CLASS_TIMEGATE_CLOSING 124 -#define SND_CLASS_TIMEGATE_PASSING 125 -#define SND_CLASS_CONVEYOR_BELT_SWITCH_ACTIVATING 126 -#define SND_CLASS_CONVEYOR_BELT_ACTIVE 127 -#define SND_CLASS_CONVEYOR_BELT_SWITCH_DEACTIVATING 128 -#define SND_LIGHT_SWITCH_ACTIVATING 129 -#define SND_LIGHT_SWITCH_DEACTIVATING 130 -#define SND_DX_SUPABOMB_PUSHING 131 -#define SND_TRAP_DIGGING 132 -#define SND_TRAP_ACTIVATING 133 -#define SND_CLASS_TUBE_WALKING 134 -#define SND_AMOEBA_TURNING_TO_GEM 135 -#define SND_AMOEBA_TURNING_TO_ROCK 136 -#define SND_SPEED_PILL_COLLECTING 137 -#define SND_DYNABOMB_INCREASE_NUMBER_COLLECTING 138 -#define SND_DYNABOMB_INCREASE_SIZE_COLLECTING 139 -#define SND_DYNABOMB_INCREASE_POWER_COLLECTING 140 -#define SND_CLASS_DYNABOMB_DROPPING 141 -#define SND_CLASS_DYNABOMB_ACTIVE 142 -#define SND_SATELLITE_MOVING 143 -#define SND_SATELLITE_WAITING 144 -#define SND_SATELLITE_PUSHING 145 -#define SND_LAMP_ACTIVATING 146 -#define SND_LAMP_DEACTIVATING 147 -#define SND_TIME_ORB_FULL_COLLECTING 148 -#define SND_TIME_ORB_FULL_IMPACT 149 -#define SND_TIME_ORB_EMPTY_PUSHING 150 -#define SND_TIME_ORB_EMPTY_IMPACT 151 -#define SND_GAME_OF_LIFE_WAITING 152 -#define SND_GAME_OF_LIFE_GROWING 153 -#define SND_BIOMAZE_WAITING 154 -#define SND_BIOMAZE_GROWING 155 -#define SND_PACMAN_MOVING 156 -#define SND_PACMAN_WAITING 157 -#define SND_PACMAN_DIGGING 158 -#define SND_DARK_YAMYAM_MOVING 159 -#define SND_DARK_YAMYAM_WAITING 160 -#define SND_DARK_YAMYAM_DIGGING 161 -#define SND_PENGUIN_MOVING 162 -#define SND_PENGUIN_WAITING 163 -#define SND_PIG_MOVING 164 -#define SND_PIG_WAITING 165 -#define SND_PIG_DIGGING 166 -#define SND_DRAGON_MOVING 167 -#define SND_DRAGON_WAITING 168 -#define SND_DRAGON_ATTACKING 169 -#define SND_GAME_STARTING 170 -#define SND_GAME_RUNNING_OUT_OF_TIME 171 -#define SND_GAME_LEVELTIME_BONUS 172 -#define SND_GAME_LOSING 173 -#define SND_GAME_WINNING 174 -#define SND_GAME_SOKOBAN_SOLVING 175 -#define SND_DOOR_OPENING 176 -#define SND_DOOR_CLOSING 177 -#define SND_BACKGROUND_MAIN 178 -#define SND_BACKGROUND_LEVELS 179 -#define SND_BACKGROUND_SCORES 180 -#define SND_BACKGROUND_EDITOR 181 -#define SND_BACKGROUND_INFO 182 -#define SND_BACKGROUND_SETUP 183 +#define SND_EMC_ANDROID_PUSHING 98 +#define SND_EMC_ANDROID_MOVING 99 +#define SND_EMC_ANDROID_DROPPING 100 +#define SND_EMC_MAGIC_BALL_DROPPING 101 +#define SND_PEARL_COLLECTING 102 +#define SND_PEARL_BREAKING 103 +#define SND_PEARL_IMPACT 104 +#define SND_CRYSTAL_COLLECTING 105 +#define SND_CRYSTAL_IMPACT 106 +#define SND_CLASS_ENVELOPE_COLLECTING 107 +#define SND_CLASS_ENVELOPE_OPENING 108 +#define SND_CLASS_ENVELOPE_CLOSING 109 +#define SND_INVISIBLE_SAND_DIGGING 110 +#define SND_INVISIBLE_SAND_ACTIVE_DIGGING 111 +#define SND_SHIELD_NORMAL_COLLECTING 112 +#define SND_SHIELD_NORMAL_ACTIVE 113 +#define SND_SHIELD_DEADLY_COLLECTING 114 +#define SND_SHIELD_DEADLY_ACTIVE 115 +#define SND_EXTRA_TIME_COLLECTING 116 +#define SND_MOLE_MOVING 117 +#define SND_MOLE_WAITING 118 +#define SND_MOLE_DIGGING 119 +#define SND_CLASS_SWITCHGATE_SWITCH_ACTIVATING 120 +#define SND_CLASS_SWITCHGATE_OPENING 121 +#define SND_CLASS_SWITCHGATE_CLOSING 122 +#define SND_CLASS_SWITCHGATE_PASSING 123 +#define SND_TIMEGATE_SWITCH_ACTIVATING 124 +#define SND_TIMEGATE_SWITCH_ACTIVE 125 +#define SND_TIMEGATE_SWITCH_DEACTIVATING 126 +#define SND_TIMEGATE_OPENING 127 +#define SND_CLASS_TIMEGATE_CLOSING 128 +#define SND_CLASS_TIMEGATE_PASSING 129 +#define SND_CLASS_CONVEYOR_BELT_SWITCH_ACTIVATING 130 +#define SND_CLASS_CONVEYOR_BELT_ACTIVE 131 +#define SND_CLASS_CONVEYOR_BELT_SWITCH_DEACTIVATING 132 +#define SND_LIGHT_SWITCH_ACTIVATING 133 +#define SND_LIGHT_SWITCH_DEACTIVATING 134 +#define SND_DX_SUPABOMB_PUSHING 135 +#define SND_TRAP_DIGGING 136 +#define SND_TRAP_ACTIVATING 137 +#define SND_CLASS_TUBE_WALKING 138 +#define SND_AMOEBA_TURNING_TO_GEM 139 +#define SND_AMOEBA_TURNING_TO_ROCK 140 +#define SND_SPEED_PILL_COLLECTING 141 +#define SND_DYNABOMB_INCREASE_NUMBER_COLLECTING 142 +#define SND_DYNABOMB_INCREASE_SIZE_COLLECTING 143 +#define SND_DYNABOMB_INCREASE_POWER_COLLECTING 144 +#define SND_CLASS_DYNABOMB_DROPPING 145 +#define SND_CLASS_DYNABOMB_ACTIVE 146 +#define SND_SATELLITE_MOVING 147 +#define SND_SATELLITE_WAITING 148 +#define SND_SATELLITE_PUSHING 149 +#define SND_LAMP_ACTIVATING 150 +#define SND_LAMP_DEACTIVATING 151 +#define SND_TIME_ORB_FULL_COLLECTING 152 +#define SND_TIME_ORB_FULL_IMPACT 153 +#define SND_TIME_ORB_EMPTY_PUSHING 154 +#define SND_TIME_ORB_EMPTY_IMPACT 155 +#define SND_GAME_OF_LIFE_WAITING 156 +#define SND_GAME_OF_LIFE_GROWING 157 +#define SND_BIOMAZE_WAITING 158 +#define SND_BIOMAZE_GROWING 159 +#define SND_PACMAN_MOVING 160 +#define SND_PACMAN_WAITING 161 +#define SND_PACMAN_DIGGING 162 +#define SND_DARK_YAMYAM_MOVING 163 +#define SND_DARK_YAMYAM_WAITING 164 +#define SND_DARK_YAMYAM_DIGGING 165 +#define SND_PENGUIN_MOVING 166 +#define SND_PENGUIN_WAITING 167 +#define SND_PIG_MOVING 168 +#define SND_PIG_WAITING 169 +#define SND_PIG_DIGGING 170 +#define SND_DRAGON_MOVING 171 +#define SND_DRAGON_WAITING 172 +#define SND_DRAGON_ATTACKING 173 +#define SND_GAME_STARTING 174 +#define SND_GAME_RUNNING_OUT_OF_TIME 175 +#define SND_GAME_LEVELTIME_BONUS 176 +#define SND_GAME_LOSING 177 +#define SND_GAME_WINNING 178 +#define SND_GAME_SOKOBAN_SOLVING 179 +#define SND_DOOR_OPENING 180 +#define SND_DOOR_CLOSING 181 +#define SND_BACKGROUND_MAIN 182 +#define SND_BACKGROUND_LEVELS 183 +#define SND_BACKGROUND_SCORES 184 +#define SND_BACKGROUND_EDITOR 185 +#define SND_BACKGROUND_INFO 186 +#define SND_BACKGROUND_SETUP 187 -#define NUM_SOUND_FILES 184 +#define NUM_SOUND_FILES 188 #endif /* CONF_SND_H */ diff --git a/src/conftime.h b/src/conftime.h index 7ea708d6..35635325 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2005-02-21 00:38]" +#define COMPILE_DATE_STRING "[2005-03-06 23:19]" diff --git a/src/files.c b/src/files.c index 2ff37bc5..7af744ca 100644 --- a/src/files.c +++ b/src/files.c @@ -4688,7 +4688,19 @@ void LoadUserDefinedEditorElementList(int **elements, int *num_elements) { char *value = getHashEntry(element_hash, list->token); - if (value) + if (value == NULL) /* try to find obsolete token mapping */ + { + char *mapped_token = get_mapped_token(list->token); + + if (mapped_token != NULL) + { + value = getHashEntry(element_hash, mapped_token); + + free(mapped_token); + } + } + + if (value != NULL) { (*elements)[(*num_elements)++] = atoi(value); } diff --git a/src/game.c b/src/game.c index b8bf5f05..aa5d9001 100644 --- a/src/game.c +++ b/src/game.c @@ -12469,17 +12469,21 @@ void PlayLevelSound_EM(int x, int y, int element_em, int sample) break; case SAMPLE_bug: - PlayLevelSoundElementAction(x, y, EL_BUG, ACTION_MOVING); + PlayLevelSoundElementAction(x, y, element, ACTION_MOVING); break; case SAMPLE_tank: - PlayLevelSoundElementAction(x, y, EL_SPACESHIP, ACTION_MOVING); + PlayLevelSoundElementAction(x, y, element, ACTION_MOVING); break; - case SAMPLE_android: + case SAMPLE_android_clone: PlayLevelSoundElementAction(x, y, element, ACTION_DROPPING); break; + case SAMPLE_android_move: + PlayLevelSoundElementAction(x, y, element, ACTION_MOVING); + break; + case SAMPLE_spring: PlayLevelSoundElementAction(x, y, element, ACTION_IMPACT); break; @@ -12489,7 +12493,11 @@ void PlayLevelSound_EM(int x, int y, int element_em, int sample) break; case SAMPLE_eater: - PlayLevelSoundElementAction(x, y, EL_YAMYAM, ACTION_WAITING); + PlayLevelSoundElementAction(x, y, element, ACTION_WAITING); + break; + + case SAMPLE_eater_eat: + PlayLevelSoundElementAction(x, y, element, ACTION_DIGGING); break; case SAMPLE_alien: @@ -12505,11 +12513,16 @@ void PlayLevelSound_EM(int x, int y, int element_em, int sample) break; case SAMPLE_squash: + /* !!! CHECK THIS !!! */ +#if 1 + PlayLevelSoundElementAction(x, y, element, ACTION_BREAKING); +#else PlayLevelSoundElementAction(x, y, element, ACTION_SMASHED_BY_ROCK); +#endif break; case SAMPLE_wonderfall: - PlayLevelSoundElementAction(x, y, EL_MAGIC_WALL, ACTION_FILLING); + PlayLevelSoundElementAction(x, y, element, ACTION_FILLING); break; case SAMPLE_drip: @@ -12525,7 +12538,7 @@ void PlayLevelSound_EM(int x, int y, int element_em, int sample) break; case SAMPLE_acid: - PlayLevelSound(x, y, SND_ACID_SPLASHING); + PlayLevelSoundElementAction(x, y, element, ACTION_SPLASHING); break; case SAMPLE_ball: @@ -12544,7 +12557,11 @@ void PlayLevelSound_EM(int x, int y, int element_em, int sample) PlayLevelSoundElementAction(x, y, element, ACTION_PASSING); break; - case SAMPLE_exit: + case SAMPLE_exit_open: + PlayLevelSoundElementAction(x, y, element, ACTION_OPENING); + break; + + case SAMPLE_exit_leave: PlayLevelSoundElementAction(x, y, element, ACTION_PASSING); break; @@ -12561,21 +12578,21 @@ void PlayLevelSound_EM(int x, int y, int element_em, int sample) break; case SAMPLE_wheel: - PlayLevelSound(x, y, SND_ROBOT_WHEEL_ACTIVE); + PlayLevelSoundElementAction(x, y, element, ACTION_ACTIVE); break; case SAMPLE_boom: PlayLevelSoundElementAction(x, y, element, ACTION_EXPLODING); break; - case SAMPLE_time: - PlaySoundStereo(SND_GAME_RUNNING_OUT_OF_TIME, SOUND_MIDDLE); - break; - case SAMPLE_die: PlayLevelSoundElementAction(x, y, element, ACTION_DYING); break; + case SAMPLE_time: + PlaySoundStereo(SND_GAME_RUNNING_OUT_OF_TIME, SOUND_MIDDLE); + break; + default: PlayLevelSoundElementAction(x, y, element, ACTION_DEFAULT); break; diff --git a/src/game_em/convert.c b/src/game_em/convert.c index dc5d78c6..5a143a69 100644 --- a/src/game_em/convert.c +++ b/src/game_em/convert.c @@ -165,10 +165,35 @@ int cleanup_em_level(unsigned char *src, int length) for (i = 2112; i < 2148; i++) src[i] = src[i - 64]; } +#if 1 + else if (length >= 2106 && + src[0] == 245 && + src[1983] == 27) + { + unsigned char j = 94; + + /* ---------- this cave has V3 file format ---------- */ + file_version = FILE_VERSION_EM_V3; + + for (i = 0; i < 2106; i++) + src[i] = (src[i] ^ (j += 7)) - 0x11; + src[1] = 131; + for (i = 0; i < 2048; i++) + src[i] = remap_v4[src[i]]; + for (i = 2048; i < 2084; i++) + src[i] = remap_v4eater[src[i] >= 28 ? 0 : src[i]]; + for (i = 2112; i < 2148; i++) + src[i] = src[i - 64]; + } +#endif else { /* ---------- this cave has unknown file format ---------- */ +#if 1 + printf("::: %d, %d\n", src[0], src[1983]); +#endif + return 0; } diff --git a/src/game_em/init.c b/src/game_em/init.c index 42117321..c22c551d 100644 --- a/src/game_em/init.c +++ b/src/game_em/init.c @@ -61,9 +61,11 @@ static const char *sound_names[SAMPLE_MAX] = "05.bug.au", "06.tank.au", "07.android.au", + "06.tank.au", /* android moving */ "08.spring.au", "09.slurp.au", "10.eater.au", + "10.eater.au", /* eater eating */ "11.alien.au", "12.collect.au", "13.diamond.au", @@ -78,6 +80,7 @@ static const char *sound_names[SAMPLE_MAX] = "21.wonder.au", "22.door.au", "23.exit.au", + "23.exit.au", "24.dynamite.au", "25.tick.au", "26.press.au", @@ -96,9 +99,11 @@ static const int sound_volume[SAMPLE_MAX] = 20, 20, 100, + 20, 100, 100, 50, + 50, 100, 100, 100, @@ -116,6 +121,7 @@ static const int sound_volume[SAMPLE_MAX] = 100, 100, 100, + 100, 20, 100, 100, diff --git a/src/game_em/main_em.h b/src/game_em/main_em.h index 1cc7a5b5..345107ef 100644 --- a/src/game_em/main_em.h +++ b/src/game_em/main_em.h @@ -486,10 +486,12 @@ enum SAMPLE_crack, /* stone hits nut */ SAMPLE_bug, /* bug moves */ SAMPLE_tank, /* tank moves */ - SAMPLE_android, /* android places something */ + SAMPLE_android_clone, /* android places something */ + SAMPLE_android_move, /* android moves */ SAMPLE_spring, /* spring hits ground/wall/bumper, stone hits spring */ SAMPLE_slurp, /* spring kills alien */ - SAMPLE_eater, /* eater sits/eats diamond */ + SAMPLE_eater, /* eater sits */ + SAMPLE_eater_eat, /* eater eats diamond */ SAMPLE_alien, /* alien moves */ SAMPLE_collect, /* player collects object */ SAMPLE_diamond, /* diamond/emerald hits ground */ @@ -503,7 +505,8 @@ enum SAMPLE_grow, /* growing wall grows */ SAMPLE_wonder, /* wonderwall is active */ SAMPLE_door, /* player goes thru door (gate) */ - SAMPLE_exit, /* player goes into exit */ + SAMPLE_exit_open, /* exit opens */ + SAMPLE_exit_leave, /* player goes into exit */ SAMPLE_dynamite, /* player places dynamite */ SAMPLE_tick, /* dynamite ticks */ SAMPLE_press, /* player presses wheel/wind/switch */ diff --git a/src/game_em/sample.h b/src/game_em/sample.h index e19af75b..90c45a9b 100644 --- a/src/game_em/sample.h +++ b/src/game_em/sample.h @@ -15,10 +15,12 @@ enum SAMPLE_crack, /* stone hits nut */ SAMPLE_bug, /* bug moves */ SAMPLE_tank, /* tank moves */ - SAMPLE_android, /* android places something */ + SAMPLE_android_clone, /* android places something */ + SAMPLE_android_move, /* android moves */ SAMPLE_spring, /* spring hits ground/wall/bumper, stone hits spring */ SAMPLE_slurp, /* spring kills alien */ - SAMPLE_eater, /* eater sits/eats diamond */ + SAMPLE_eater, /* eater sits */ + SAMPLE_eater_eat, /* eater eats diamond */ SAMPLE_alien, /* alien moves */ SAMPLE_collect, /* player collects object */ SAMPLE_diamond, /* diamond/emerald hits ground */ @@ -32,7 +34,8 @@ enum SAMPLE_grow, /* growing wall grows */ SAMPLE_wonder, /* wonderwall moves (is active) */ SAMPLE_door, /* player goes thru door */ - SAMPLE_exit, /* player goes in exit */ + SAMPLE_exit_open, /* exit opens */ + SAMPLE_exit_leave, /* player goes into exit */ SAMPLE_dynamite, /* player places dynamite */ SAMPLE_tick, /* dynamite ticks */ SAMPLE_press, /* player presses wheel/wind/switch */ diff --git a/src/game_em/sound.c b/src/game_em/sound.c index 8fa45653..e230d992 100644 --- a/src/game_em/sound.c +++ b/src/game_em/sound.c @@ -27,7 +27,8 @@ static char audioname[] = "/dev/audio"; static const int sound_priority[SAMPLE_MAX] = { - SAMPLE_exit, + SAMPLE_exit_open, + SAMPLE_exit_leave, SAMPLE_die, SAMPLE_time, SAMPLE_boom, @@ -40,7 +41,8 @@ static const int sound_priority[SAMPLE_MAX] = SAMPLE_door, SAMPLE_dirt, SAMPLE_blank, - SAMPLE_android, + SAMPLE_android_clone, + SAMPLE_android_move, SAMPLE_ball, SAMPLE_grow, SAMPLE_squash, @@ -57,6 +59,7 @@ static const int sound_priority[SAMPLE_MAX] = SAMPLE_bug, SAMPLE_tank, SAMPLE_eater, + SAMPLE_eater_eat, SAMPLE_alien, SAMPLE_acid }; diff --git a/src/game_em/synchro_1.c b/src/game_em/synchro_1.c index 5107c0ff..f7404f04 100644 --- a/src/game_em/synchro_1.c +++ b/src/game_em/synchro_1.c @@ -337,7 +337,7 @@ static void kill_player(struct PLAYER *ply) case Xexit_1: case Xexit_2: case Xexit_3: - play_element_sound(x, y, SAMPLE_exit, Xexit_1); + play_element_sound(x, y, SAMPLE_exit_leave, Xexit_1); break; default: @@ -580,7 +580,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) Cave[y-1][x+1] = Yacid_splash_eB; if (Cave[y-1][x-1] == Xblank) Cave[y-1][x-1] = Yacid_splash_wB; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); case Xboom_android: case Xboom_1: @@ -760,7 +760,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) Cave[y-1][x+dx+1] = Yacid_splash_eB; if (Cave[y-1][x+dx-1] == Xblank) Cave[y-1][x+dx-1] = Yacid_splash_wB; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto stone_walk; case Xblank: @@ -798,7 +798,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) Cave[y-1][x+dx+1] = Yacid_splash_eB; if (Cave[y-1][x+dx-1] == Xblank) Cave[y-1][x+dx-1] = Yacid_splash_wB; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto bomb_walk; case Xblank: @@ -836,7 +836,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) Cave[y-1][x+dx+1] = Yacid_splash_eB; if (Cave[y-1][x+dx-1] == Xblank) Cave[y-1][x+dx-1] = Yacid_splash_wB; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto nut_walk; case Xblank: @@ -885,7 +885,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) Cave[y-1][x+dx+1] = Yacid_splash_eB; if (Cave[y-1][x+dx-1] == Xblank) Cave[y-1][x+dx-1] = Yacid_splash_wB; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto spring_walk; case Xblank: @@ -933,7 +933,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) Cave[y+dy-1][x+dx+1] = Yacid_splash_eB; if (Cave[y+dy-1][x+dx-1] == Xblank) Cave[y+dy-1][x+dx-1] = Yacid_splash_wB; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto balloon_walk; case Xblank: @@ -978,7 +978,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) Cave[y+dy-1][x+dx+1] = Yacid_splash_eB; if (Cave[y+dy-1][x+dx-1] == Xblank) Cave[y+dy-1][x+dx-1] = Yacid_splash_wB; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto android_walk; case Xblank: @@ -1124,7 +1124,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) case Xexit_1: case Xexit_2: case Xexit_3: - play_element_sound(x, y, SAMPLE_exit, Xexit_1); + play_element_sound(x, y, SAMPLE_exit_leave, Xexit_1); if (--lev.home == 0 && lev.time_initial > 0) /* game won */ lev.score += lev.time * lev.exit_score / 100; diff --git a/src/game_em/synchro_2.c b/src/game_em/synchro_2.c index 348cd72b..3ce1efeb 100644 --- a/src/game_em/synchro_2.c +++ b/src/game_em/synchro_2.c @@ -348,7 +348,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -489,7 +489,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -536,7 +536,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -794,7 +794,7 @@ void synchro_2(void) } Next[y][x] = Xblank; - play_element_sound(x, y, SAMPLE_wonderfall, Xstone); + play_element_sound(x, y, SAMPLE_wonderfall, Xwonderwall); goto loop; } @@ -824,7 +824,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -945,7 +945,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -982,7 +982,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -1029,7 +1029,7 @@ void synchro_2(void) case Zplayer: Cave[y][x] = Ybug_n_e; Next[y][x] = Xbug_goe; - play_sound(x, y, SAMPLE_bug); + play_element_sound(x, y, SAMPLE_bug, element); goto loop; default: @@ -1061,7 +1061,7 @@ void synchro_2(void) if (Cave[y-2][x-1] == Xblank) Cave[y-2][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -1074,13 +1074,13 @@ void synchro_2(void) Cave[y-1][x] = Ybug_n; Next[y][x] = Xblank; Next[y-1][x] = Xbug_n; - play_sound(x, y, SAMPLE_bug); + play_element_sound(x, y, SAMPLE_bug, element); goto loop; default: Cave[y][x] = Ybug_n_w; Next[y][x] = Xbug_gow; - play_sound(x, y, SAMPLE_bug); + play_element_sound(x, y, SAMPLE_bug, element); goto loop; } @@ -1111,7 +1111,7 @@ void synchro_2(void) case Zplayer: Cave[y][x] = Ybug_e_s; Next[y][x] = Xbug_gos; - play_sound(x, y, SAMPLE_bug); + play_element_sound(x, y, SAMPLE_bug, element); goto loop; default: @@ -1143,7 +1143,7 @@ void synchro_2(void) if (Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -1156,13 +1156,13 @@ void synchro_2(void) Cave[y][x+1] = Ybug_e; Next[y][x] = Xblank; Next[y][x+1] = Xbug_e; - play_sound(x, y, SAMPLE_bug); + play_element_sound(x, y, SAMPLE_bug, element); goto loop; default: Cave[y][x] = Ybug_e_n; Next[y][x] = Xbug_gon; - play_sound(x, y, SAMPLE_bug); + play_element_sound(x, y, SAMPLE_bug, element); goto loop; } @@ -1193,7 +1193,7 @@ void synchro_2(void) case Zplayer: Cave[y][x] = Ybug_s_w; Next[y][x] = Xbug_gow; - play_sound(x, y, SAMPLE_bug); + play_element_sound(x, y, SAMPLE_bug, element); goto loop; default: @@ -1225,7 +1225,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -1238,13 +1238,13 @@ void synchro_2(void) Cave[y+1][x] = Ybug_s; Next[y][x] = Xblank; Next[y+1][x] = Xbug_s; - play_sound(x, y, SAMPLE_bug); + play_element_sound(x, y, SAMPLE_bug, element); goto loop; default: Cave[y][x] = Ybug_s_e; Next[y][x] = Xbug_goe; - play_sound(x, y, SAMPLE_bug); + play_element_sound(x, y, SAMPLE_bug, element); goto loop; } @@ -1275,7 +1275,7 @@ void synchro_2(void) case Zplayer: Cave[y][x] = Ybug_w_n; Next[y][x] = Xbug_gon; - play_sound(x, y, SAMPLE_bug); + play_element_sound(x, y, SAMPLE_bug, element); goto loop; default: @@ -1307,7 +1307,7 @@ void synchro_2(void) if (Cave[y-1][x-2] == Xblank) Cave[y-1][x-2] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -1320,13 +1320,13 @@ void synchro_2(void) Cave[y][x-1] = Ybug_w; Next[y][x] = Xblank; Next[y][x-1] = Xbug_w; - play_sound(x, y, SAMPLE_bug); + play_element_sound(x, y, SAMPLE_bug, element); goto loop; default: Cave[y][x] = Ybug_w_s; Next[y][x] = Xbug_gos; - play_sound(x, y, SAMPLE_bug); + play_element_sound(x, y, SAMPLE_bug, element); goto loop; } @@ -1357,7 +1357,7 @@ void synchro_2(void) case Zplayer: Cave[y][x] = Ytank_n_w; Next[y][x] = Xtank_gow; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_tank, element); goto loop; default: @@ -1389,7 +1389,7 @@ void synchro_2(void) if (Cave[y-2][x-1] == Xblank) Cave[y-2][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -1402,13 +1402,13 @@ void synchro_2(void) Cave[y-1][x] = Ytank_n; Next[y][x] = Xblank; Next[y-1][x] = Xtank_n; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_tank, element); goto loop; default: Cave[y][x] = Ytank_n_e; Next[y][x] = Xtank_goe; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_tank, element); goto loop; } @@ -1439,7 +1439,7 @@ void synchro_2(void) case Zplayer: Cave[y][x] = Ytank_e_n; Next[y][x] = Xtank_gon; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_tank, element); goto loop; default: @@ -1471,7 +1471,7 @@ void synchro_2(void) if (Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -1484,13 +1484,13 @@ void synchro_2(void) Cave[y][x+1] = Ytank_e; Next[y][x] = Xblank; Next[y][x+1] = Xtank_e; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_tank, element); goto loop; default: Cave[y][x] = Ytank_e_s; Next[y][x] = Xtank_gos; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_tank, element); goto loop; } @@ -1521,7 +1521,7 @@ void synchro_2(void) case Zplayer: Cave[y][x] = Ytank_s_e; Next[y][x] = Xtank_goe; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_tank, element); goto loop; default: @@ -1553,7 +1553,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -1566,13 +1566,13 @@ void synchro_2(void) Cave[y+1][x] = Ytank_s; Next[y][x] = Xblank; Next[y+1][x] = Xtank_s; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_tank, element); goto loop; default: Cave[y][x] = Ytank_s_w; Next[y][x] = Xtank_gow; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_tank, element); goto loop; } @@ -1603,7 +1603,7 @@ void synchro_2(void) case Zplayer: Cave[y][x] = Ytank_w_s; Next[y][x] = Xtank_gos; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_tank, element); goto loop; default: @@ -1635,7 +1635,7 @@ void synchro_2(void) if (Cave[y-1][x-2] == Xblank) Cave[y-1][x-2] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -1648,13 +1648,13 @@ void synchro_2(void) Cave[y][x-1] = Ytank_w; Next[y][x] = Xblank; Next[y][x-1] = Xtank_w; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_tank, element); goto loop; default: Cave[y][x] = Ytank_w_n; Next[y][x] = Xtank_gon; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_tank, element); goto loop; } @@ -1769,8 +1769,8 @@ void synchro_2(void) goto android_move; } - Next[y][x] = temp; /* the item we chose to clone */ - play_element_sound(x, y, SAMPLE_android, temp); + Next[y][x] = temp; /* the item we chose to clone */ + play_element_sound(x, y, SAMPLE_android_clone, temp); switch (RANDOM & 7) { @@ -1911,7 +1911,7 @@ void synchro_2(void) dy = 0; } - Next[y][x] = Xblank; /* assume we will move */ + Next[y][x] = Xblank; /* assume we will move */ temp = ((x < dx) + 1 - (x > dx)) + ((y < dy) + 1 - (y > dy)) * 3; if (RANDOM & 1) @@ -2042,7 +2042,7 @@ void synchro_2(void) Cave[y][x] = Yandroid_nB; Cave[y-1][x] = Yandroid_n; Next[y-1][x] = Xandroid; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_android_move, element); goto loop; android_ne: @@ -2050,7 +2050,7 @@ void synchro_2(void) Cave[y][x] = Yandroid_neB; Cave[y-1][x+1] = Yandroid_ne; Next[y-1][x+1] = Xandroid; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_android_move, element); goto loop; android_e: @@ -2058,7 +2058,7 @@ void synchro_2(void) Cave[y][x] = Yandroid_eB; Cave[y][x+1] = Yandroid_e; Next[y][x+1] = Xandroid; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_android_move, element); goto loop; android_se: @@ -2066,7 +2066,7 @@ void synchro_2(void) Cave[y][x] = Yandroid_seB; Cave[y+1][x+1] = Yandroid_se; Next[y+1][x+1] = Xandroid; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_android_move, element); goto loop; android_s: @@ -2074,7 +2074,7 @@ void synchro_2(void) Cave[y][x] = Yandroid_sB; Cave[y+1][x] = Yandroid_s; Next[y+1][x] = Xandroid; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_android_move, element); goto loop; android_sw: @@ -2082,7 +2082,7 @@ void synchro_2(void) Cave[y][x] = Yandroid_swB; Cave[y+1][x-1] = Yandroid_sw; Next[y+1][x-1] = Xandroid; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_android_move, element); goto loop; android_w: @@ -2090,7 +2090,7 @@ void synchro_2(void) Cave[y][x] = Yandroid_wB; Cave[y][x-1] = Yandroid_w; Next[y][x-1] = Xandroid; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_android_move, element); goto loop; android_nw: @@ -2098,7 +2098,7 @@ void synchro_2(void) Cave[y][x] = Yandroid_nwB; Cave[y-1][x-1] = Yandroid_nw; Next[y-1][x-1] = Xandroid; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_android_move, element); goto loop; /* --------------------------------------------------------------------- */ @@ -2120,7 +2120,7 @@ void synchro_2(void) if (Cave[y-2][x-1] == Xblank) Cave[y-2][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -2130,7 +2130,7 @@ void synchro_2(void) Cave[y-1][x] = Yandroid_n; Next[y][x] = Xblank; Next[y-1][x] = Xandroid; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_android_move, element); goto loop; default: @@ -2154,7 +2154,7 @@ void synchro_2(void) if (Cave[y-2][x-1] == Xblank) Cave[y-2][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -2164,7 +2164,7 @@ void synchro_2(void) Cave[y-1][x] = Yandroid_n; Next[y][x] = Xblank; Next[y-1][x] = Xandroid_1_n; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_android_move, element); goto loop; default: @@ -2190,7 +2190,7 @@ void synchro_2(void) if (Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -2200,7 +2200,7 @@ void synchro_2(void) Cave[y][x+1] = Yandroid_e; Next[y][x] = Xblank; Next[y][x+1] = Xandroid; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_android_move, element); goto loop; default: @@ -2224,7 +2224,7 @@ void synchro_2(void) if (Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -2234,7 +2234,7 @@ void synchro_2(void) Cave[y][x+1] = Yandroid_e; Next[y][x] = Xblank; Next[y][x+1] = Xandroid_1_e; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_android_move, element); goto loop; default: @@ -2260,7 +2260,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -2270,7 +2270,7 @@ void synchro_2(void) Cave[y+1][x] = Yandroid_s; Next[y][x] = Xblank; Next[y+1][x] = Xandroid; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_android_move, element); goto loop; default: @@ -2294,7 +2294,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -2304,7 +2304,7 @@ void synchro_2(void) Cave[y+1][x] = Yandroid_s; Next[y][x] = Xblank; Next[y+1][x] = Xandroid_1_s; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_android_move, element); goto loop; default: @@ -2330,7 +2330,7 @@ void synchro_2(void) if (Cave[y-1][x-2] == Xblank) Cave[y-1][x-2] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -2340,7 +2340,7 @@ void synchro_2(void) Cave[y][x-1] = Yandroid_w; Next[y][x] = Xblank; Next[y][x-1] = Xandroid; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_android_move, element); goto loop; default: @@ -2364,7 +2364,7 @@ void synchro_2(void) if (Cave[y-1][x-2] == Xblank) Cave[y-1][x-2] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -2374,7 +2374,7 @@ void synchro_2(void) Cave[y][x-1] = Yandroid_w; Next[y][x] = Xblank; Next[y][x-1] = Xandroid_1_w; - play_sound(x, y, SAMPLE_tank); + play_element_sound(x, y, SAMPLE_android_move, element); goto loop; default: @@ -2400,7 +2400,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -2554,7 +2554,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -2591,7 +2591,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -2623,7 +2623,7 @@ void synchro_2(void) if (Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -2686,7 +2686,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -2718,7 +2718,7 @@ void synchro_2(void) if (Cave[y-1][x-2] == Xblank) Cave[y-1][x-2] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -2781,7 +2781,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -2921,7 +2921,7 @@ void synchro_2(void) { Cave[y][x+1] = Ydiamond_eat; Next[y][x+1] = Xblank; - play_element_sound(x, y, SAMPLE_eater, Xdiamond); + play_element_sound(x, y, SAMPLE_eater_eat, element); goto loop; } @@ -2929,7 +2929,7 @@ void synchro_2(void) { Cave[y+1][x] = Ydiamond_eat; Next[y+1][x] = Xblank; - play_element_sound(x, y, SAMPLE_eater, Xdiamond); + play_element_sound(x, y, SAMPLE_eater_eat, element); goto loop; } @@ -2937,7 +2937,7 @@ void synchro_2(void) { Cave[y][x-1] = Ydiamond_eat; Next[y][x-1] = Xblank; - play_element_sound(x, y, SAMPLE_eater, Xdiamond); + play_element_sound(x, y, SAMPLE_eater_eat, element); goto loop; } @@ -2945,7 +2945,7 @@ void synchro_2(void) { Cave[y-1][x] = Ydiamond_eat; Next[y-1][x] = Xblank; - play_element_sound(x, y, SAMPLE_eater, Xdiamond); + play_element_sound(x, y, SAMPLE_eater_eat, element); goto loop; } @@ -2965,7 +2965,7 @@ void synchro_2(void) if (Cave[y-2][x-1] == Xblank) Cave[y-2][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -2982,7 +2982,7 @@ void synchro_2(void) default: Next[y][x] = RANDOM & 1 ? Xeater_e : Xeater_w; - play_sound(x, y, SAMPLE_eater); + play_element_sound(x, y, SAMPLE_eater, element); goto loop; } @@ -2993,7 +2993,7 @@ void synchro_2(void) { Cave[y+1][x] = Ydiamond_eat; Next[y+1][x] = Xblank; - play_element_sound(x, y, SAMPLE_eater, Xdiamond); + play_element_sound(x, y, SAMPLE_eater_eat, element); goto loop; } @@ -3001,7 +3001,7 @@ void synchro_2(void) { Cave[y][x-1] = Ydiamond_eat; Next[y][x-1] = Xblank; - play_element_sound(x, y, SAMPLE_eater, Xdiamond); + play_element_sound(x, y, SAMPLE_eater_eat, element); goto loop; } @@ -3009,7 +3009,7 @@ void synchro_2(void) { Cave[y-1][x] = Ydiamond_eat; Next[y-1][x] = Xblank; - play_element_sound(x, y, SAMPLE_eater, Xdiamond); + play_element_sound(x, y, SAMPLE_eater_eat, element); goto loop; } @@ -3017,7 +3017,7 @@ void synchro_2(void) { Cave[y][x+1] = Ydiamond_eat; Next[y][x+1] = Xblank; - play_element_sound(x, y, SAMPLE_eater, Xdiamond); + play_element_sound(x, y, SAMPLE_eater_eat, element); goto loop; } @@ -3037,7 +3037,7 @@ void synchro_2(void) if (Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -3054,7 +3054,7 @@ void synchro_2(void) default: Next[y][x] = RANDOM & 1 ? Xeater_n : Xeater_s; - play_sound(x, y, SAMPLE_eater); + play_element_sound(x, y, SAMPLE_eater, element); goto loop; } @@ -3065,7 +3065,7 @@ void synchro_2(void) { Cave[y][x-1] = Ydiamond_eat; Next[y][x-1] = Xblank; - play_element_sound(x, y, SAMPLE_eater, Xdiamond); + play_element_sound(x, y, SAMPLE_eater_eat, element); goto loop; } @@ -3073,7 +3073,7 @@ void synchro_2(void) { Cave[y-1][x] = Ydiamond_eat; Next[y-1][x] = Xblank; - play_element_sound(x, y, SAMPLE_eater, Xdiamond); + play_element_sound(x, y, SAMPLE_eater_eat, element); goto loop; } @@ -3081,7 +3081,7 @@ void synchro_2(void) { Cave[y][x+1] = Ydiamond_eat; Next[y][x+1] = Xblank; - play_element_sound(x, y, SAMPLE_eater, Xdiamond); + play_element_sound(x, y, SAMPLE_eater_eat, element); goto loop; } @@ -3089,7 +3089,7 @@ void synchro_2(void) { Cave[y+1][x] = Ydiamond_eat; Next[y+1][x] = Xblank; - play_element_sound(x, y, SAMPLE_eater, Xdiamond); + play_element_sound(x, y, SAMPLE_eater_eat, element); goto loop; } @@ -3109,7 +3109,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -3126,7 +3126,7 @@ void synchro_2(void) default: Next[y][x] = RANDOM & 1 ? Xeater_e : Xeater_w; - play_sound(x, y, SAMPLE_eater); + play_element_sound(x, y, SAMPLE_eater, element); goto loop; } @@ -3137,7 +3137,7 @@ void synchro_2(void) { Cave[y-1][x] = Ydiamond_eat; Next[y-1][x] = Xblank; - play_element_sound(x, y, SAMPLE_eater, Xdiamond); + play_element_sound(x, y, SAMPLE_eater_eat, element); goto loop; } @@ -3145,7 +3145,7 @@ void synchro_2(void) { Cave[y][x+1] = Ydiamond_eat; Next[y][x+1] = Xblank; - play_element_sound(x, y, SAMPLE_eater, Xdiamond); + play_element_sound(x, y, SAMPLE_eater_eat, element); goto loop; } @@ -3153,7 +3153,7 @@ void synchro_2(void) { Cave[y+1][x] = Ydiamond_eat; Next[y+1][x] = Xblank; - play_element_sound(x, y, SAMPLE_eater, Xdiamond); + play_element_sound(x, y, SAMPLE_eater_eat, element); goto loop; } @@ -3161,7 +3161,7 @@ void synchro_2(void) { Cave[y][x-1] = Ydiamond_eat; Next[y][x-1] = Xblank; - play_element_sound(x, y, SAMPLE_eater, Xdiamond); + play_element_sound(x, y, SAMPLE_eater_eat, element); goto loop; } @@ -3181,7 +3181,7 @@ void synchro_2(void) if (Cave[y-1][x-2] == Xblank) Cave[y-1][x-2] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -3198,7 +3198,7 @@ void synchro_2(void) default: Next[y][x] = RANDOM & 1 ? Xeater_n : Xeater_s; - play_sound(x, y, SAMPLE_eater); + play_element_sound(x, y, SAMPLE_eater, element); goto loop; } @@ -3262,7 +3262,7 @@ void synchro_2(void) if (Cave[y-2][x-1] == Xblank) Cave[y-2][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -3297,7 +3297,7 @@ void synchro_2(void) Cave[y][x+1] = Yacid_splash_eB; if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -3335,7 +3335,7 @@ void synchro_2(void) if (Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -3370,7 +3370,7 @@ void synchro_2(void) if (Cave[y-1][x-2] == Xblank) Cave[y-1][x-2] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -3414,7 +3414,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -3549,7 +3549,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -3586,7 +3586,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -3611,7 +3611,7 @@ void synchro_2(void) } Next[y][x] = Xblank; - play_element_sound(x, y, SAMPLE_wonderfall, Xemerald); + play_element_sound(x, y, SAMPLE_wonderfall, Xwonderwall); goto loop; } @@ -3641,7 +3641,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -3776,7 +3776,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -3813,7 +3813,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -3838,7 +3838,7 @@ void synchro_2(void) } Next[y][x] = Xblank; - play_element_sound(x, y, SAMPLE_wonderfall, Xdiamond); + play_element_sound(x, y, SAMPLE_wonderfall, Xwonderwall); goto loop; } @@ -3868,7 +3868,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xdrip_stretchB; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -3960,7 +3960,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -4080,7 +4080,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -4117,7 +4117,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -4172,7 +4172,7 @@ void synchro_2(void) if (Cave[y-2][x-1] == Xblank) Cave[y-2][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -4205,7 +4205,7 @@ void synchro_2(void) if (Cave[y-1][x] == Xblank) Cave[y-1][x] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -4238,7 +4238,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -4271,7 +4271,7 @@ void synchro_2(void) if (Cave[y-1][x-2] == Xblank) Cave[y-1][x-2] = Yacid_splash_wB; Next[y][x] = Xblank; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: @@ -4590,6 +4590,8 @@ void synchro_2(void) Next[y][x] = Xexit_1; } + play_element_sound(x, y, SAMPLE_exit_open, Xexit); + goto loop; case Xexit_1: @@ -4668,7 +4670,7 @@ void synchro_2(void) if (Cave[y][x-1] == Xblank) Cave[y][x-1] = Yacid_splash_wB; Next[y][x] = Xsand_stonesand_4; - play_sound(x, y, SAMPLE_acid); + play_element_sound(x, y, SAMPLE_acid, Xacid_1); goto loop; case Xblank: diff --git a/src/game_em/synchro_3.c b/src/game_em/synchro_3.c index f094ceeb..570d4da8 100644 --- a/src/game_em/synchro_3.c +++ b/src/game_em/synchro_3.c @@ -55,7 +55,7 @@ void synchro_3(void) play_sound(-1, -1, SAMPLE_time); if (lev.wheel_cnt) - play_sound(-1, -1, SAMPLE_wheel); + play_element_sound(lev.wheel_x, lev.wheel_y, SAMPLE_wheel, Xwheel); /* grow amoeba */ diff --git a/src/init.c b/src/init.c index 988ab57e..dbecf851 100644 --- a/src/init.c +++ b/src/init.c @@ -37,8 +37,45 @@ #define CONFIG_TOKEN_FONT_INITIAL "font.initial" -struct FontBitmapInfo font_initial[NUM_INITIAL_FONTS]; +static struct FontBitmapInfo font_initial[NUM_INITIAL_FONTS]; +static int copy_properties[][5] = +{ + { + EL_BUG, + EL_BUG_LEFT, EL_BUG_RIGHT, + EL_BUG_UP, EL_BUG_DOWN + }, + { + EL_SPACESHIP, + EL_SPACESHIP_LEFT, EL_SPACESHIP_RIGHT, + EL_SPACESHIP_UP, EL_SPACESHIP_DOWN + }, + { + EL_BD_BUTTERFLY, + EL_BD_BUTTERFLY_LEFT, EL_BD_BUTTERFLY_RIGHT, + EL_BD_BUTTERFLY_UP, EL_BD_BUTTERFLY_DOWN + }, + { + EL_BD_FIREFLY, + EL_BD_FIREFLY_LEFT, EL_BD_FIREFLY_RIGHT, + EL_BD_FIREFLY_UP, EL_BD_FIREFLY_DOWN + }, + { + EL_PACMAN, + EL_PACMAN_LEFT, EL_PACMAN_RIGHT, + EL_PACMAN_UP, EL_PACMAN_DOWN + }, + { + EL_MOLE, + EL_MOLE_LEFT, EL_MOLE_RIGHT, + EL_MOLE_UP, EL_MOLE_DOWN + }, + { + -1, + -1, -1, -1, -1 + } +}; static void InitTileClipmasks() { @@ -1504,6 +1541,16 @@ static void InitElementSoundInfo() element_info[i].sound[act] = default_action_sound; } } + +#if 1 + /* copy sound settings to some elements that are only stored in level file + in native R'n'D levels, but are used by game engine in native EM levels */ + for (i = 0; copy_properties[i][0] != -1; i++) + for (j = 1; j <= 4; j++) + for (act = 0; act < NUM_ACTIONS; act++) + element_info[copy_properties[i][j]].sound[act] = + element_info[copy_properties[i][0]].sound[act]; +#endif } static void InitGameModeSoundInfo() @@ -1640,6 +1687,22 @@ static void InitSoundInfo() free(sound_effect_properties); +#if 0 + /* !!! MOVED TO "InitElementSoundInfo()" !!! */ + /* !!! everything defined here gets overwritten there !!! */ + + /* copy sound settings to some elements that are only stored in level file + in native R'n'D levels, but are used by game engine in native EM levels */ + for (i = 0; i < NUM_ACTIONS; i++) + for (j = 0; copy_properties[j][0] != -1; j++) + for (k = 1; k <= 4; k++) + element_info[copy_properties[j][k]].sound[i] = + element_info[copy_properties[j][0]].sound[i]; + + printf("::: bug -> %d\n", element_info[EL_BUG].sound[ACTION_MOVING]); + printf("::: bug_r -> %d\n", element_info[EL_BUG_RIGHT].sound[ACTION_MOVING]); +#endif + #if 0 /* !!! now handled in InitElementSoundInfo() !!! */ /* initialize element/sound mapping from dynamic configuration */ @@ -3599,44 +3662,6 @@ void InitElementPropertiesStatic() { NULL, -1 } }; - static int copy_properties[][5] = - { - { - EL_BUG, - EL_BUG_LEFT, EL_BUG_RIGHT, - EL_BUG_UP, EL_BUG_DOWN - }, - { - EL_SPACESHIP, - EL_SPACESHIP_LEFT, EL_SPACESHIP_RIGHT, - EL_SPACESHIP_UP, EL_SPACESHIP_DOWN - }, - { - EL_BD_BUTTERFLY, - EL_BD_BUTTERFLY_LEFT, EL_BD_BUTTERFLY_RIGHT, - EL_BD_BUTTERFLY_UP, EL_BD_BUTTERFLY_DOWN - }, - { - EL_BD_FIREFLY, - EL_BD_FIREFLY_LEFT, EL_BD_FIREFLY_RIGHT, - EL_BD_FIREFLY_UP, EL_BD_FIREFLY_DOWN - }, - { - EL_PACMAN, - EL_PACMAN_LEFT, EL_PACMAN_RIGHT, - EL_PACMAN_UP, EL_PACMAN_DOWN - }, - { - EL_MOLE, - EL_MOLE_LEFT, EL_MOLE_RIGHT, - EL_MOLE_UP, EL_MOLE_DOWN - }, - { - -1, - -1, -1, -1, -1 - } - }; - int i, j, k; /* always start with reliable default values (element has no properties) */ diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 2a132858..59a273e1 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -1615,6 +1615,27 @@ boolean FileIsArtworkType(char *basename, int type) /* functions for loading artwork configuration information */ /* ------------------------------------------------------------------------- */ +char *get_mapped_token(char *token) +{ + /* !!! make this dynamically configurable (init.c:InitArtworkConfig) !!! */ + static char *map_token_prefix[][2] = + { + { "char_procent", "char_percent" }, + { NULL, } + }; + int i; + + for (i = 0; map_token_prefix[i][0] != NULL; i++) + { + int len_token_prefix = strlen(map_token_prefix[i][0]); + + if (strncmp(token, map_token_prefix[i][0], len_token_prefix) == 0) + return getStringCat2(map_token_prefix[i][1], &token[len_token_prefix]); + } + + return NULL; +} + /* This function checks if a string of the format "string1, string2, ..." exactly contains a string . */ @@ -2000,34 +2021,20 @@ static void LoadArtworkConfigFromFilename(struct ArtworkListInfo *artwork_info, /* map deprecated to current tokens (using prefix match and replace) */ BEGIN_HASH_ITERATION(valid_file_hash, itr) { - /* !!! make this dynamically configurable (init.c:InitArtworkConfig) !!! */ - static char *map_token_prefix[][2] = - { /* old prefix -> new prefix */ - { "char_procent", "char_percent" }, - { NULL, NULL } - }; char *token = HASH_ITERATION_TOKEN(itr); + char *mapped_token = get_mapped_token(token); - for (i = 0; map_token_prefix[i][0] != NULL; i++) + if (mapped_token != NULL) { - int token_prefix_length = strlen(map_token_prefix[i][0]); - - if (strncmp(token, map_token_prefix[i][0], token_prefix_length) == 0) - { - char *value = HASH_ITERATION_VALUE(itr); - char *mapped_token = getStringCat2(map_token_prefix[i][1], - &token[token_prefix_length]); - - /* add mapped token */ - setHashEntry(valid_file_hash, mapped_token, value); + char *value = HASH_ITERATION_VALUE(itr); - /* ignore old token (by setting it to "known" keyword) */ - setHashEntry(valid_file_hash, token, known_token_value); + /* add mapped token */ + setHashEntry(valid_file_hash, mapped_token, value); - free(mapped_token); + /* ignore old token (by setting it to "known" keyword) */ + setHashEntry(valid_file_hash, token, known_token_value); - break; - } + free(mapped_token); } } END_HASH_ITERATION(valid_file_hash, itr) diff --git a/src/libgame/misc.h b/src/libgame/misc.h index 3c0619fb..db836823 100644 --- a/src/libgame/misc.h +++ b/src/libgame/misc.h @@ -162,6 +162,8 @@ boolean FileIsSound(char *); boolean FileIsMusic(char *); boolean FileIsArtworkType(char *, int); +char *get_mapped_token(char *); + int get_parameter_value(char *, char *, int); int get_auto_parameter_value(char *, char *); diff --git a/src/main.c b/src/main.c index e382071e..8c47e61c 100644 --- a/src/main.c +++ b/src/main.c @@ -4192,6 +4192,7 @@ struct ElementActionInfo element_action_info[NUM_ACTIONS + 1 + 1] = { ".smashed_by_spring", ACTION_SMASHED_BY_SPRING, FALSE }, { ".slurped_by_spring", ACTION_SLURPED_BY_SPRING, FALSE }, { ".twinkling", ACTION_TWINKLING, FALSE }, + { ".splashing", ACTION_SPLASHING, FALSE }, { ".other", ACTION_OTHER, FALSE }, /* empty suffix always matches -- check as last entry in InitSoundInfo() */ diff --git a/src/main.h b/src/main.h index e16c8b67..414ff7fc 100644 --- a/src/main.h +++ b/src/main.h @@ -1213,9 +1213,10 @@ #define ACTION_SMASHED_BY_SPRING 48 #define ACTION_SLURPED_BY_SPRING 49 #define ACTION_TWINKLING 50 -#define ACTION_OTHER 51 +#define ACTION_SPLASHING 51 +#define ACTION_OTHER 52 -#define NUM_ACTIONS 52 +#define NUM_ACTIONS 53 #define ACTION_BORING_LAST ACTION_BORING_10 #define ACTION_SLEEPING_LAST ACTION_SLEEPING_3 diff --git a/src/screens.c b/src/screens.c index 5f93823b..e4b28035 100644 --- a/src/screens.c +++ b/src/screens.c @@ -346,6 +346,7 @@ void DrawMainMenu() OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2); } +#if 0 static void gotoTopLevelDir() { /* move upwards to top level directory */ @@ -374,6 +375,7 @@ static void gotoTopLevelDir() leveldir_current = leveldir_current->node_parent; } } +#endif void HandleMainMenu(int mx, int my, int dx, int dy, int button) { -- 2.34.1