From 891c39ca37c4fea5f6cc4ca40f913a56c68ef495 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Mon, 24 Nov 2003 02:27:31 +0100 Subject: [PATCH] rnd-20031124-1-src * added "copy" and "exchange" functions for custom elements to editor * added configurable element animations for info screen * added configurable music credits for info screen * added "editorsetup.conf" for editor element list configuration * added "musicinfo.conf" for menu and level music configuration --- ChangeLog | 16 ++ src/conf_gfx.c | 67 ++++--- src/conf_mus.c | 20 +-- src/conf_snd.c | 418 ++++++++++++++++++++++---------------------- src/conftime.h | 2 +- src/editor.c | 29 +++ src/editor.h | 1 + src/game.c | 72 +++++++- src/init.c | 43 ++++- src/libgame/misc.c | 33 +--- src/libgame/misc.h | 2 +- src/libgame/setup.c | 13 +- src/libgame/setup.h | 1 + src/main.c | 50 +++++- src/main.h | 58 ++++-- src/tools.c | 28 ++- 16 files changed, 548 insertions(+), 305 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6e736355..f9943b36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ + +2003-11-22 + * added "copy" and "exchange" functions for custom elements to editor + +2003-11-21 + * added configurable element animations for info screen + +2003-11-20 + * added configurable music credits for info screen + +2003-11-18 + * added "editorsetup.conf" for editor element list configuration + +2003-11-16 + * added "musicinfo.conf" for menu and level music configuration + 2003-11-14 * fixed a very nasty bug in dragon turning code in TurnRoundExt() (that only showed up on Linux, but not on Windows systems) diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 36d9ddbf..1bca3da1 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -21,35 +21,39 @@ struct ConfigInfo image_config_suffix[] = { - { ".x", ARG_UNDEFINED, TYPE_INTEGER }, - { ".y", ARG_UNDEFINED, TYPE_INTEGER }, - { ".xpos", ARG_UNDEFINED, TYPE_INTEGER }, - { ".ypos", ARG_UNDEFINED, TYPE_INTEGER }, - { ".width", ARG_UNDEFINED, TYPE_INTEGER }, - { ".height", ARG_UNDEFINED, TYPE_INTEGER }, - { ".offset", ARG_UNDEFINED, TYPE_INTEGER }, - { ".vertical", "false", TYPE_BOOLEAN }, - { ".xoffset", ARG_UNDEFINED, TYPE_INTEGER }, - { ".yoffset", ARG_UNDEFINED, TYPE_INTEGER }, - { ".frames", ARG_UNDEFINED, TYPE_INTEGER }, - { ".frames_per_line", ARG_UNDEFINED, TYPE_INTEGER }, - { ".start_frame", ARG_UNDEFINED, TYPE_INTEGER }, - { ".delay", "1", TYPE_INTEGER }, - { ".anim_mode", ARG_UNDEFINED, TYPE_STRING }, - { ".global_sync", "false", TYPE_BOOLEAN }, - { ".crumbled_like", ARG_UNDEFINED, TYPE_TOKEN }, - { ".diggable_like", ARG_UNDEFINED, TYPE_TOKEN }, - { ".border_size", ARG_UNDEFINED, TYPE_INTEGER }, - { ".step_offset", "4", TYPE_INTEGER }, - { ".step_delay", "1", TYPE_INTEGER }, - { ".direction", ARG_UNDEFINED, TYPE_STRING }, - { ".position", ARG_UNDEFINED, TYPE_STRING }, - { ".draw_xoffset", "0", TYPE_INTEGER }, - { ".draw_yoffset", "0", TYPE_INTEGER }, - { ".draw_masked", "false", TYPE_BOOLEAN }, - { ".name", ARG_UNDEFINED, TYPE_STRING }, - - { NULL, NULL, 0 } + { ".x", ARG_UNDEFINED, TYPE_INTEGER }, + { ".y", ARG_UNDEFINED, TYPE_INTEGER }, + { ".xpos", ARG_UNDEFINED, TYPE_INTEGER }, + { ".ypos", ARG_UNDEFINED, TYPE_INTEGER }, + { ".width", ARG_UNDEFINED, TYPE_INTEGER }, + { ".height", ARG_UNDEFINED, TYPE_INTEGER }, + { ".offset", ARG_UNDEFINED, TYPE_INTEGER }, + { ".vertical", "false", TYPE_BOOLEAN }, + { ".xoffset", ARG_UNDEFINED, TYPE_INTEGER }, + { ".yoffset", ARG_UNDEFINED, TYPE_INTEGER }, + { ".frames", ARG_UNDEFINED, TYPE_INTEGER }, + { ".frames_per_line", ARG_UNDEFINED, TYPE_INTEGER }, + { ".start_frame", ARG_UNDEFINED, TYPE_INTEGER }, + { ".delay", "1", TYPE_INTEGER }, + { ".anim_mode", ARG_UNDEFINED, TYPE_STRING }, + { ".global_sync", "false", TYPE_BOOLEAN }, + { ".crumbled_like", ARG_UNDEFINED, TYPE_TOKEN }, + { ".diggable_like", ARG_UNDEFINED, TYPE_TOKEN }, + { ".border_size", ARG_UNDEFINED, TYPE_INTEGER }, + { ".step_offset", "4", TYPE_INTEGER }, + { ".step_delay", "1", TYPE_INTEGER }, + { ".direction", ARG_UNDEFINED, TYPE_STRING }, + { ".position", ARG_UNDEFINED, TYPE_STRING }, + { ".draw_xoffset", "0", TYPE_INTEGER }, + { ".draw_yoffset", "0", TYPE_INTEGER }, + { ".draw_masked", "false", TYPE_BOOLEAN }, + { ".anim_delay_fixed", ARG_UNDEFINED, TYPE_INTEGER }, + { ".anim_delay_random", ARG_UNDEFINED, TYPE_INTEGER }, + { ".post_delay_fixed", ARG_UNDEFINED, TYPE_INTEGER }, + { ".post_delay_random", ARG_UNDEFINED, TYPE_INTEGER }, + { ".name", ARG_UNDEFINED, TYPE_STRING }, + + { NULL, NULL, 0 } }; struct ConfigInfo image_config[] = @@ -3704,5 +3708,10 @@ struct ConfigInfo image_config[] = { "door_2.step_delay", "10" }, { "door_2.anim_mode", "default" }, + { "[player].boring_delay_fixed", "0" }, + { "[player].boring_delay_random", "0" }, + { "[player].sleeping_delay_fixed", "0" }, + { "[player].sleeping_delay_random", "0" }, + { NULL, NULL } }; diff --git a/src/conf_mus.c b/src/conf_mus.c index 469c7ed9..1c29c617 100644 --- a/src/conf_mus.c +++ b/src/conf_mus.c @@ -21,24 +21,24 @@ struct ConfigInfo music_config_suffix[] = { - { ".mode_loop", ARG_UNDEFINED, TYPE_BOOLEAN }, + { ".mode_loop", ARG_UNDEFINED, TYPE_BOOLEAN }, - { NULL, NULL, 0 } + { NULL, NULL, 0 } }; struct ConfigInfo music_config[] = { - { "background", UNDEFINED_FILENAME }, - { "background.MAIN", UNDEFINED_FILENAME }, - { "background.LEVELS", UNDEFINED_FILENAME }, - { "background.SCORES", UNDEFINED_FILENAME }, - { "background.EDITOR", UNDEFINED_FILENAME }, - { "background.INFO", "rhythmloop.wav" }, - { "background.SETUP", UNDEFINED_FILENAME }, + { "background", UNDEFINED_FILENAME }, + { "background.MAIN", UNDEFINED_FILENAME }, + { "background.LEVELS", UNDEFINED_FILENAME }, + { "background.SCORES", UNDEFINED_FILENAME }, + { "background.EDITOR", UNDEFINED_FILENAME }, + { "background.INFO", "rhythmloop.wav" }, + { "background.SETUP", UNDEFINED_FILENAME }, /* there is no definition for "background.PLAYING", because this would prevent selecting music from music directory that is not defined in "musicinfo.conf", when no default music is defined here */ - { NULL, NULL } + { NULL, NULL } }; diff --git a/src/conf_snd.c b/src/conf_snd.c index 9d028a5a..deb105e2 100644 --- a/src/conf_snd.c +++ b/src/conf_snd.c @@ -21,247 +21,247 @@ struct ConfigInfo sound_config_suffix[] = { - { ".mode_loop", ARG_UNDEFINED, TYPE_BOOLEAN }, + { ".mode_loop", ARG_UNDEFINED, TYPE_BOOLEAN }, - { NULL, NULL, 0 } + { NULL, NULL, 0 } }; struct ConfigInfo sound_config[] = { /* some default sounds */ - { "[default].digging", "schlurf.wav" }, - { "[default].collecting", "pong.wav" }, - { "[default].snapping", "pong.wav" }, - { "[default].pushing", "pusch.wav" }, - { "[default].impact", "klopf.wav" }, - { "[default].walking", "empty.wav" }, - { "[default].passing", "gate.wav" }, - { "[default].dying", "autsch.wav" }, - { "[default].exploding", "roaaar.wav" }, - { "[sp_default].exploding", "booom.wav" }, + { "[default].digging", "schlurf.wav" }, + { "[default].collecting", "pong.wav" }, + { "[default].snapping", "pong.wav" }, + { "[default].pushing", "pusch.wav" }, + { "[default].impact", "klopf.wav" }, + { "[default].walking", "empty.wav" }, + { "[default].passing", "gate.wav" }, + { "[default].dying", "autsch.wav" }, + { "[default].exploding", "roaaar.wav" }, + { "[sp_default].exploding", "booom.wav" }, /* sounds for Boulder Dash style elements and actions */ - { "bd_diamond.collecting", "pong.wav" }, - { "bd_diamond.impact", "pling.wav" }, - { "bd_rock.pushing", "pusch.wav" }, - { "bd_rock.impact", "klopf.wav" }, - { "bd_magic_wall.activating", "quirk.wav" }, - { "bd_magic_wall.active", "miep.wav" }, - { "bd_magic_wall.filling", "quirk.wav" }, - { "bd_amoeba.waiting", UNDEFINED_FILENAME }, - { "bd_amoeba.growing", "amoebe.wav" }, - { "bd_amoeba.turning_to_gem", "pling.wav" }, - { "bd_amoeba.turning_to_rock", "klopf.wav" }, - { "bd_butterfly.moving", "klapper.wav" }, - { "bd_butterfly.waiting", "klapper.wav" }, - { "bd_firefly.moving", "roehr.wav" }, - { "bd_firefly.waiting", "roehr.wav" }, + { "bd_diamond.collecting", "pong.wav" }, + { "bd_diamond.impact", "pling.wav" }, + { "bd_rock.pushing", "pusch.wav" }, + { "bd_rock.impact", "klopf.wav" }, + { "bd_magic_wall.activating", "quirk.wav" }, + { "bd_magic_wall.active", "miep.wav" }, + { "bd_magic_wall.filling", "quirk.wav" }, + { "bd_amoeba.waiting", UNDEFINED_FILENAME }, + { "bd_amoeba.growing", "amoebe.wav" }, + { "bd_amoeba.turning_to_gem", "pling.wav" }, + { "bd_amoeba.turning_to_rock", "klopf.wav" }, + { "bd_butterfly.moving", "klapper.wav" }, + { "bd_butterfly.waiting", "klapper.wav" }, + { "bd_firefly.moving", "roehr.wav" }, + { "bd_firefly.waiting", "roehr.wav" }, /* sounds for Supaplex style elements and actions */ - { "sp_base.digging", "base.wav" }, - { "sp_buggy_base.digging", "base.wav" }, - { "sp_buggy_base.active", "bug.wav" }, - { "sp_infotron.collecting", "infotron.wav" }, - { "sp_infotron.impact", "pling.wav" }, - { "sp_zonk.pushing", "zonkpush.wav" }, - { "sp_zonk.impact", "zonkdown.wav" }, - { "sp_disk_red.collecting", "infotron.wav" }, - { "sp_disk_orange.pushing", "zonkpush.wav" }, - { "sp_disk_yellow.pushing", "pusch.wav" }, - { "[sp_port].passing", "gate.wav" }, - { "[sp_exit].passing", "exit.wav" }, - { "[sp_exit].opening", UNDEFINED_FILENAME }, - { "[sp_exit].closing", UNDEFINED_FILENAME }, - { "sp_sniksnak.moving", UNDEFINED_FILENAME }, - { "sp_sniksnak.waiting", UNDEFINED_FILENAME }, - { "sp_electron.moving", UNDEFINED_FILENAME }, - { "sp_electron.waiting", UNDEFINED_FILENAME }, - { "sp_terminal.activating", UNDEFINED_FILENAME }, - { "sp_terminal.active", UNDEFINED_FILENAME }, + { "sp_base.digging", "base.wav" }, + { "sp_buggy_base.digging", "base.wav" }, + { "sp_buggy_base.active", "bug.wav" }, + { "sp_infotron.collecting", "infotron.wav" }, + { "sp_infotron.impact", "pling.wav" }, + { "sp_zonk.pushing", "zonkpush.wav" }, + { "sp_zonk.impact", "zonkdown.wav" }, + { "sp_disk_red.collecting", "infotron.wav" }, + { "sp_disk_orange.pushing", "zonkpush.wav" }, + { "sp_disk_yellow.pushing", "pusch.wav" }, + { "[sp_port].passing", "gate.wav" }, + { "[sp_exit].passing", "exit.wav" }, + { "[sp_exit].opening", UNDEFINED_FILENAME }, + { "[sp_exit].closing", UNDEFINED_FILENAME }, + { "sp_sniksnak.moving", UNDEFINED_FILENAME }, + { "sp_sniksnak.waiting", UNDEFINED_FILENAME }, + { "sp_electron.moving", UNDEFINED_FILENAME }, + { "sp_electron.waiting", UNDEFINED_FILENAME }, + { "sp_terminal.activating", UNDEFINED_FILENAME }, + { "sp_terminal.active", UNDEFINED_FILENAME }, /* sounds for Sokoban style elements and actions */ - { "[sokoban].pushing", "pusch.wav" }, - { "[sokoban].filling", "deng.wav" }, - { "[sokoban].emptying", UNDEFINED_FILENAME }, + { "[sokoban].pushing", "pusch.wav" }, + { "[sokoban].filling", "deng.wav" }, + { "[sokoban].emptying", UNDEFINED_FILENAME }, /* sounds for Emerald Mine style elements and actions */ - { "[player].moving", "empty.wav" }, - { "[player].moving.mode_loop", "false" }, - { "sand.digging", "schlurf.wav" }, - { "emerald.collecting", "pong.wav" }, - { "emerald.impact", "pling.wav" }, - { "diamond.collecting", "pong.wav" }, - { "diamond.impact", "pling.wav" }, - { "diamond.breaking", "quirk.wav" }, - { "rock.pushing", "pusch.wav" }, - { "rock.impact", "klopf.wav" }, - { "bomb.pushing", "pusch.wav" }, - { "nut.pushing", "knurk.wav" }, - { "nut.breaking", "knack.wav" }, - { "nut.impact", "klumpf.wav" }, - { "[dynamite].collecting", "pong.wav" }, - { "[dynamite].dropping", "deng.wav" }, - { "[dynamite].active", "zisch.wav" }, - { "[key].collecting", "pong.wav" }, - { "[gate].passing", "gate.wav" }, - { "bug.moving", "klapper.wav" }, - { "bug.waiting", "klapper.wav" }, - { "spaceship.moving", "roehr.wav" }, - { "spaceship.waiting", "roehr.wav" }, - { "yamyam.moving", UNDEFINED_FILENAME }, - { "yamyam.waiting", "njam.wav" }, - { "yamyam.digging", UNDEFINED_FILENAME }, - { "robot.moving", "schlurf.wav" }, - { "robot.moving.mode_loop", "false" }, - { "robot.waiting", UNDEFINED_FILENAME }, - { "robot_wheel.activating", "deng.wav" }, - { "robot_wheel.active", "miep.wav" }, - { "magic_wall.activating", "quirk.wav" }, - { "magic_wall.active", "miep.wav" }, - { "magic_wall.filling", "quirk.wav" }, - { "[amoeba].waiting", UNDEFINED_FILENAME }, - { "[amoeba].growing", "amoebe.wav" }, - { "[amoeba].dropping", UNDEFINED_FILENAME }, - { "acid.splashing", "blurb.wav" }, - { "[quicksand].filling", UNDEFINED_FILENAME }, - { "[quicksand].emptying", UNDEFINED_FILENAME }, - { "[exit].opening", "oeffnen.wav" }, - { "[exit].closing", "oeffnen.wav" }, - { "[exit].passing", "buing.wav" }, - { "penguin.passing", "buing.wav" }, + { "[player].moving", "empty.wav" }, + { "[player].moving.mode_loop", "false" }, + { "sand.digging", "schlurf.wav" }, + { "emerald.collecting", "pong.wav" }, + { "emerald.impact", "pling.wav" }, + { "diamond.collecting", "pong.wav" }, + { "diamond.impact", "pling.wav" }, + { "diamond.breaking", "quirk.wav" }, + { "rock.pushing", "pusch.wav" }, + { "rock.impact", "klopf.wav" }, + { "bomb.pushing", "pusch.wav" }, + { "nut.pushing", "knurk.wav" }, + { "nut.breaking", "knack.wav" }, + { "nut.impact", "klumpf.wav" }, + { "[dynamite].collecting", "pong.wav" }, + { "[dynamite].dropping", "deng.wav" }, + { "[dynamite].active", "zisch.wav" }, + { "[key].collecting", "pong.wav" }, + { "[gate].passing", "gate.wav" }, + { "bug.moving", "klapper.wav" }, + { "bug.waiting", "klapper.wav" }, + { "spaceship.moving", "roehr.wav" }, + { "spaceship.waiting", "roehr.wav" }, + { "yamyam.moving", UNDEFINED_FILENAME }, + { "yamyam.waiting", "njam.wav" }, + { "yamyam.digging", UNDEFINED_FILENAME }, + { "robot.moving", "schlurf.wav" }, + { "robot.moving.mode_loop", "false" }, + { "robot.waiting", UNDEFINED_FILENAME }, + { "robot_wheel.activating", "deng.wav" }, + { "robot_wheel.active", "miep.wav" }, + { "magic_wall.activating", "quirk.wav" }, + { "magic_wall.active", "miep.wav" }, + { "magic_wall.filling", "quirk.wav" }, + { "[amoeba].waiting", UNDEFINED_FILENAME }, + { "[amoeba].growing", "amoebe.wav" }, + { "[amoeba].dropping", UNDEFINED_FILENAME }, + { "acid.splashing", "blurb.wav" }, + { "[quicksand].filling", UNDEFINED_FILENAME }, + { "[quicksand].emptying", UNDEFINED_FILENAME }, + { "[exit].opening", "oeffnen.wav" }, + { "[exit].closing", "oeffnen.wav" }, + { "[exit].passing", "buing.wav" }, + { "penguin.passing", "buing.wav" }, /* sounds for Emerald Mine Club style elements and actions */ - { "balloon.moving", UNDEFINED_FILENAME }, - { "balloon.waiting", UNDEFINED_FILENAME }, - { "balloon.pushing", "schlurf.wav" }, - { "[balloon_switch].activating", UNDEFINED_FILENAME }, - { "spring.moving", UNDEFINED_FILENAME }, - { "spring.pushing", "pusch.wav" }, - { "spring.impact", "klopf.wav" }, - { "[wall].growing", UNDEFINED_FILENAME }, + { "balloon.moving", UNDEFINED_FILENAME }, + { "balloon.waiting", UNDEFINED_FILENAME }, + { "balloon.pushing", "schlurf.wav" }, + { "[balloon_switch].activating", UNDEFINED_FILENAME }, + { "spring.moving", UNDEFINED_FILENAME }, + { "spring.pushing", "pusch.wav" }, + { "spring.impact", "klopf.wav" }, + { "[wall].growing", UNDEFINED_FILENAME }, /* sounds for Diamond Caves style elements and actions */ - { "pearl.collecting", "pong.wav" }, - { "pearl.breaking", "knack.wav" }, - { "pearl.impact", "pling.wav" }, - { "crystal.collecting", "pong.wav" }, - { "crystal.impact", "pling.wav" }, - { "[envelope].collecting", "pong.wav" }, - { "[envelope].opening", UNDEFINED_FILENAME }, - { "[envelope].closing", UNDEFINED_FILENAME }, - { "invisible_sand.digging", "schlurf.wav" }, - { "shield_normal.collecting", "pong.wav" }, - { "shield_normal.active", UNDEFINED_FILENAME }, - { "shield_deadly.collecting", "pong.wav" }, - { "shield_deadly.active", UNDEFINED_FILENAME }, - { "extra_time.collecting", "gong.wav" }, - { "mole.moving", UNDEFINED_FILENAME }, - { "mole.waiting", UNDEFINED_FILENAME }, - { "mole.digging", "blurb.wav" }, - { "[switchgate_switch].activating", UNDEFINED_FILENAME }, - { "[switchgate].opening", "oeffnen.wav" }, - { "[switchgate].closing", "oeffnen.wav" }, - { "[switchgate].passing", "gate.wav" }, - { "timegate_switch.activating", "deng.wav" }, - { "timegate_switch.active", "miep.wav" }, - { "timegate_switch.deactivating", UNDEFINED_FILENAME }, - { "timegate.opening", "oeffnen.wav" }, - { "[timegate].closing", "oeffnen.wav" }, - { "[timegate].passing", "gate.wav" }, - { "[conveyor_belt_switch].activating",UNDEFINED_FILENAME }, - { "[conveyor_belt].active", UNDEFINED_FILENAME }, - { "[conveyor_belt_switch].deactivating",UNDEFINED_FILENAME }, - { "light_switch.activating", UNDEFINED_FILENAME }, - { "light_switch.deactivating", UNDEFINED_FILENAME }, + { "pearl.collecting", "pong.wav" }, + { "pearl.breaking", "knack.wav" }, + { "pearl.impact", "pling.wav" }, + { "crystal.collecting", "pong.wav" }, + { "crystal.impact", "pling.wav" }, + { "[envelope].collecting", "pong.wav" }, + { "[envelope].opening", UNDEFINED_FILENAME }, + { "[envelope].closing", UNDEFINED_FILENAME }, + { "invisible_sand.digging", "schlurf.wav" }, + { "shield_normal.collecting", "pong.wav" }, + { "shield_normal.active", UNDEFINED_FILENAME }, + { "shield_deadly.collecting", "pong.wav" }, + { "shield_deadly.active", UNDEFINED_FILENAME }, + { "extra_time.collecting", "gong.wav" }, + { "mole.moving", UNDEFINED_FILENAME }, + { "mole.waiting", UNDEFINED_FILENAME }, + { "mole.digging", "blurb.wav" }, + { "[switchgate_switch].activating", UNDEFINED_FILENAME }, + { "[switchgate].opening", "oeffnen.wav" }, + { "[switchgate].closing", "oeffnen.wav" }, + { "[switchgate].passing", "gate.wav" }, + { "timegate_switch.activating", "deng.wav" }, + { "timegate_switch.active", "miep.wav" }, + { "timegate_switch.deactivating", UNDEFINED_FILENAME }, + { "timegate.opening", "oeffnen.wav" }, + { "[timegate].closing", "oeffnen.wav" }, + { "[timegate].passing", "gate.wav" }, + { "[conveyor_belt_switch].activating",UNDEFINED_FILENAME }, + { "[conveyor_belt].active", UNDEFINED_FILENAME }, + { "[conveyor_belt_switch].deactivating",UNDEFINED_FILENAME }, + { "light_switch.activating", UNDEFINED_FILENAME }, + { "light_switch.deactivating", UNDEFINED_FILENAME }, /* sounds for DX Boulderdash style elements and actions */ - { "dx_supabomb.pushing", "pusch.wav" }, - { "trap.digging", "schlurf.wav" }, - { "trap.activating", UNDEFINED_FILENAME }, - { "[tube].walking", UNDEFINED_FILENAME }, + { "dx_supabomb.pushing", "pusch.wav" }, + { "trap.digging", "schlurf.wav" }, + { "trap.activating", UNDEFINED_FILENAME }, + { "[tube].walking", UNDEFINED_FILENAME }, /* sounds for Rocks'n'Diamonds style elements and actions */ - { "amoeba.turning_to_gem", "pling.wav" }, - { "amoeba.turning_to_rock", "klopf.wav" }, - { "speed_pill.collecting", "pong.wav" }, - { "dynabomb_increase_number.collecting","pong.wav" }, - { "dynabomb_increase_size.collecting","pong.wav" }, - { "dynabomb_increase_power.collecting","pong.wav" }, - { "[dynabomb].dropping", "deng.wav" }, - { "[dynabomb].active", "zisch.wav" }, - { "satellite.moving", UNDEFINED_FILENAME }, - { "satellite.waiting", UNDEFINED_FILENAME }, - { "satellite.pushing", "pusch.wav" }, - { "lamp.activating", "deng.wav" }, - { "lamp.deactivating", "deng.wav" }, - { "time_orb_full.collecting", "gong.wav" }, - { "time_orb_full.impact", "deng.wav" }, - { "time_orb_empty.pushing", "pusch.wav" }, - { "time_orb_empty.impact", "deng.wav" }, - { "game_of_life.waiting", UNDEFINED_FILENAME }, - { "game_of_life.growing", "amoebe.wav" }, - { "biomaze.waiting", UNDEFINED_FILENAME }, - { "biomaze.growing", "amoebe.wav" }, - { "pacman.moving", UNDEFINED_FILENAME }, - { "pacman.waiting", UNDEFINED_FILENAME }, - { "pacman.digging", UNDEFINED_FILENAME }, - { "dark_yamyam.moving", UNDEFINED_FILENAME }, - { "dark_yamyam.waiting", "njam.wav" }, - { "dark_yamyam.digging", UNDEFINED_FILENAME }, - { "penguin.moving", UNDEFINED_FILENAME }, - { "penguin.waiting", UNDEFINED_FILENAME }, - { "pig.moving", UNDEFINED_FILENAME }, - { "pig.waiting", UNDEFINED_FILENAME }, - { "pig.digging", UNDEFINED_FILENAME }, - { "dragon.moving", UNDEFINED_FILENAME }, - { "dragon.waiting", UNDEFINED_FILENAME }, - { "dragon.attacking", UNDEFINED_FILENAME }, + { "amoeba.turning_to_gem", "pling.wav" }, + { "amoeba.turning_to_rock", "klopf.wav" }, + { "speed_pill.collecting", "pong.wav" }, + { "dynabomb_increase_number.collecting","pong.wav" }, + { "dynabomb_increase_size.collecting","pong.wav" }, + { "dynabomb_increase_power.collecting","pong.wav" }, + { "[dynabomb].dropping", "deng.wav" }, + { "[dynabomb].active", "zisch.wav" }, + { "satellite.moving", UNDEFINED_FILENAME }, + { "satellite.waiting", UNDEFINED_FILENAME }, + { "satellite.pushing", "pusch.wav" }, + { "lamp.activating", "deng.wav" }, + { "lamp.deactivating", "deng.wav" }, + { "time_orb_full.collecting", "gong.wav" }, + { "time_orb_full.impact", "deng.wav" }, + { "time_orb_empty.pushing", "pusch.wav" }, + { "time_orb_empty.impact", "deng.wav" }, + { "game_of_life.waiting", UNDEFINED_FILENAME }, + { "game_of_life.growing", "amoebe.wav" }, + { "biomaze.waiting", UNDEFINED_FILENAME }, + { "biomaze.growing", "amoebe.wav" }, + { "pacman.moving", UNDEFINED_FILENAME }, + { "pacman.waiting", UNDEFINED_FILENAME }, + { "pacman.digging", UNDEFINED_FILENAME }, + { "dark_yamyam.moving", UNDEFINED_FILENAME }, + { "dark_yamyam.waiting", "njam.wav" }, + { "dark_yamyam.digging", UNDEFINED_FILENAME }, + { "penguin.moving", UNDEFINED_FILENAME }, + { "penguin.waiting", UNDEFINED_FILENAME }, + { "pig.moving", UNDEFINED_FILENAME }, + { "pig.waiting", UNDEFINED_FILENAME }, + { "pig.digging", UNDEFINED_FILENAME }, + { "dragon.moving", UNDEFINED_FILENAME }, + { "dragon.waiting", UNDEFINED_FILENAME }, + { "dragon.attacking", UNDEFINED_FILENAME }, /* 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.running_out_of_time", "gong.wav" }, - { "game.leveltime_bonus", "sirr.wav" }, - { "game.losing", "lachen.wav" }, - { "game.winning", UNDEFINED_FILENAME }, - { "game.sokoban_solving", "buing.wav" }, + { "game.starting", UNDEFINED_FILENAME }, + { "game.running_out_of_time", "gong.wav" }, + { "game.leveltime_bonus", "sirr.wav" }, + { "game.losing", "lachen.wav" }, + { "game.winning", UNDEFINED_FILENAME }, + { "game.sokoban_solving", "buing.wav" }, /* sounds for other non-game actions */ - { "door.opening", "oeffnen.wav" }, - { "door.closing", "oeffnen.wav" }, + { "door.opening", "oeffnen.wav" }, + { "door.closing", "oeffnen.wav" }, - { "background.MAIN", UNDEFINED_FILENAME }, - { "background.LEVELS", UNDEFINED_FILENAME }, - { "background.SCORES", "halloffame.wav" }, - { "background.SCORES.mode_loop", "false" }, - { "background.EDITOR", UNDEFINED_FILENAME }, - { "background.INFO", UNDEFINED_FILENAME }, - { "background.SETUP", UNDEFINED_FILENAME }, + { "background.MAIN", UNDEFINED_FILENAME }, + { "background.LEVELS", UNDEFINED_FILENAME }, + { "background.SCORES", "halloffame.wav" }, + { "background.SCORES.mode_loop", "false" }, + { "background.EDITOR", UNDEFINED_FILENAME }, + { "background.INFO", UNDEFINED_FILENAME }, + { "background.SETUP", UNDEFINED_FILENAME }, #if 0 - { "[not used]", "antigrav.wav" }, - { "[not used]", "bong.wav" }, - { "[not used]", "fuel.wav" }, - { "[not used]", "holz.wav" }, - { "[not used]", "hui.wav" }, - { "[not used]", "kabumm.wav" }, - { "[not used]", "kink.wav" }, - { "[not used]", "kling.wav" }, - { "[not used]", "krach.wav" }, - { "[not used]", "laser.wav" }, - { "[not used]", "quiek.wav" }, - { "[not used]", "rumms.wav" }, - { "[not used]", "schlopp.wav" }, - { "[not used]", "schrff.wav" }, - { "[not used]", "schwirr.wav" }, - { "[not used]", "slurp.wav" }, - { "[not used]", "sproing.wav" }, - { "[not used]", "warnton.wav" }, - { "[not used]", "whoosh.wav" }, - { "[not used]", "boom.wav" }, + { "[not used]", "antigrav.wav" }, + { "[not used]", "bong.wav" }, + { "[not used]", "fuel.wav" }, + { "[not used]", "holz.wav" }, + { "[not used]", "hui.wav" }, + { "[not used]", "kabumm.wav" }, + { "[not used]", "kink.wav" }, + { "[not used]", "kling.wav" }, + { "[not used]", "krach.wav" }, + { "[not used]", "laser.wav" }, + { "[not used]", "quiek.wav" }, + { "[not used]", "rumms.wav" }, + { "[not used]", "schlopp.wav" }, + { "[not used]", "schrff.wav" }, + { "[not used]", "schwirr.wav" }, + { "[not used]", "slurp.wav" }, + { "[not used]", "sproing.wav" }, + { "[not used]", "warnton.wav" }, + { "[not used]", "whoosh.wav" }, + { "[not used]", "boom.wav" }, #endif - { NULL, NULL } + { NULL, NULL } }; diff --git a/src/conftime.h b/src/conftime.h index 59183376..9f4d9c1a 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-11-22 20:08]" +#define COMPILE_DATE_STRING "[2003-11-24 02:22]" diff --git a/src/editor.c b/src/editor.c index 26ec5f72..cb202d16 100644 --- a/src/editor.c +++ b/src/editor.c @@ -3136,6 +3136,35 @@ static void ReinitializeElementList() element_shift = num_editor_elements - ED_NUM_ELEMENTLIST_BUTTONS; } +void PrintEditorElementList() +{ + boolean *stop = &setup.editor.el_user_defined; + int i, j; + + for (i=0; editor_elements_info[i].setup_value != stop; i++) + { + for (j=0; j < *editor_elements_info[i].headline_list_size; j++) + { + int element = (*editor_elements_info[i].headline_list)[j]; + + printf("# %s\n", element_info[element].token_name); + } + + if (j > 0) + printf("#\n"); + + for (j=0; j < *editor_elements_info[i].element_list_size; j++) + { + int element = (*editor_elements_info[i].element_list)[j]; + + printf("# %s\n", element_info[element].token_name); + } + + if (j > 0) + printf("#\n"); + } +} + static void ReinitializeElementListButtons() { static boolean last_setup_value_headlines = FALSE; diff --git a/src/editor.h b/src/editor.h index 3213c452..3844a2c8 100644 --- a/src/editor.h +++ b/src/editor.h @@ -32,5 +32,6 @@ void HandleLevelEditorKeyInput(Key); void HandleLevelEditorIdle(); void HandleEditorGadgetInfoText(void *ptr); void RequestExitLevelEditor(boolean); +void PrintEditorElementList(); #endif diff --git a/src/game.c b/src/game.c index e8709415..3e8a721b 100644 --- a/src/game.c +++ b/src/game.c @@ -186,6 +186,7 @@ static void PlayLevelSound(int, int, int); static void PlayLevelSoundNearest(int, int, int); static void PlayLevelSoundAction(int, int, int); static void PlayLevelSoundElementAction(int, int, int, int); +static void PlayLevelSoundElementActionIfLoop(int, int, int, int); static void PlayLevelSoundActionIfLoop(int, int, int); static void StopLevelSoundActionIfLoop(int, int, int); static void PlayLevelMusic(); @@ -1059,6 +1060,12 @@ void InitGame() player->is_pushing = FALSE; player->is_switching = FALSE; + player->is_bored = FALSE; + player->is_sleeping = FALSE; + + player->frame_counter_bored = -1; + player->frame_counter_sleeping = -1; + player->switch_x = -1; player->switch_y = -1; @@ -5944,6 +5951,58 @@ static boolean CheckElementChange(int x, int y, int element, int trigger_event) return CheckElementSideChange(x, y, element, CH_SIDE_ANY, trigger_event, -1); } +static void SetPlayerWaiting(struct PlayerInfo *player, boolean is_waiting) +{ + boolean was_waiting = player->is_waiting; + + if (is_waiting) + { + int jx = player->jx, jy = player->jy; + int element = player->element_nr; + int action; + + if (!was_waiting) /* not waiting -> waiting */ + { + player->is_waiting = TRUE; + player->is_bored = FALSE; + player->is_sleeping = FALSE; + + player->frame_counter_bored = + (FrameCounter + + game.player_boring_delay_fixed + + SimpleRND(game.player_boring_delay_random)); + player->frame_counter_sleeping = + (FrameCounter + + game.player_sleeping_delay_fixed + + SimpleRND(game.player_sleeping_delay_random)); + + InitPlayerGfxAnimation(player, ACTION_WAITING, player->MovDir); + } + + if (FrameCounter >= player->frame_counter_bored) + player->is_bored = TRUE; + if (FrameCounter >= player->frame_counter_sleeping) + player->is_sleeping = TRUE; + + action = (player->is_sleeping ? ACTION_SLEEPING : + player->is_bored ? ACTION_BORING : ACTION_WAITING); + + if (!was_waiting) + PlayLevelSoundElementAction(jx, jy, element, action); + else + PlayLevelSoundElementActionIfLoop(jx, jy, element, action); + } + else if (was_waiting) /* waiting -> not waiting */ + { + player->is_waiting = FALSE; + player->is_bored = FALSE; + player->is_sleeping = FALSE; + + player->frame_counter_bored = -1; + player->frame_counter_sleeping = -1; + } +} + #if 1 static byte PlayerActions(struct PlayerInfo *player, byte player_action) { @@ -5998,6 +6057,8 @@ static byte PlayerActions(struct PlayerInfo *player, byte player_action) } } + SetPlayerWaiting(player, FALSE); + #if 1 return player_action; #else @@ -6017,7 +6078,7 @@ static byte PlayerActions(struct PlayerInfo *player, byte player_action) CheckGravityMovement(player); if (player->MovPos == 0) - InitPlayerGfxAnimation(player, ACTION_DEFAULT, player->MovDir); + SetPlayerWaiting(player, TRUE); if (player->MovPos == 0) /* needed for tape.playing */ player->is_moving = FALSE; @@ -8594,6 +8655,15 @@ static void PlayLevelSoundElementAction(int x, int y, int element, int action) PlayLevelSound(x, y, sound_effect); } +static void PlayLevelSoundElementActionIfLoop(int x, int y, int element, + int action) +{ + int sound_effect = element_info[element].sound[action]; + + if (sound_effect != SND_UNDEFINED && IS_LOOP_SOUND(sound_effect)) + PlayLevelSound(x, y, sound_effect); +} + static void PlayLevelSoundActionIfLoop(int x, int y, int action) { int sound_effect = element_info[Feld[x][y]].sound[action]; diff --git a/src/init.c b/src/init.c index c0e3fce0..2f5bd60d 100644 --- a/src/init.c +++ b/src/init.c @@ -826,6 +826,10 @@ static void set_graphic_parameters(int graphic, char **parameter_raw) graphic_info[graphic].crumbled_like = -1; /* do not use clone element */ graphic_info[graphic].diggable_like = -1; /* do not use clone element */ graphic_info[graphic].border_size = TILEX / 8; /* "CRUMBLED" border size */ + graphic_info[graphic].anim_delay_fixed = 0; + graphic_info[graphic].anim_delay_random = 0; + graphic_info[graphic].post_delay_fixed = 0; + graphic_info[graphic].post_delay_random = 0; /* optional x and y tile position of animation frame sequence */ if (parameter[GFX_ARG_XPOS] != ARG_UNDEFINED_VALUE) @@ -921,6 +925,20 @@ static void set_graphic_parameters(int graphic, char **parameter_raw) if (parameter[GFX_ARG_BORDER_SIZE] != ARG_UNDEFINED_VALUE) graphic_info[graphic].border_size = parameter[GFX_ARG_BORDER_SIZE]; + /* this is only used for player "boring" and "sleeping" actions */ + if (parameter[GFX_ARG_ANIM_DELAY_FIXED] != ARG_UNDEFINED_VALUE) + graphic_info[graphic].anim_delay_fixed = + parameter[GFX_ARG_ANIM_DELAY_FIXED]; + if (parameter[GFX_ARG_ANIM_DELAY_RANDOM] != ARG_UNDEFINED_VALUE) + graphic_info[graphic].anim_delay_fixed = + parameter[GFX_ARG_ANIM_DELAY_RANDOM]; + if (parameter[GFX_ARG_POST_DELAY_FIXED] != ARG_UNDEFINED_VALUE) + graphic_info[graphic].anim_delay_fixed = + parameter[GFX_ARG_POST_DELAY_FIXED]; + if (parameter[GFX_ARG_POST_DELAY_RANDOM] != ARG_UNDEFINED_VALUE) + graphic_info[graphic].anim_delay_fixed = + parameter[GFX_ARG_POST_DELAY_RANDOM]; + /* this is only used for toon animations */ graphic_info[graphic].step_offset = parameter[GFX_ARG_STEP_OFFSET]; graphic_info[graphic].step_delay = parameter[GFX_ARG_STEP_DELAY]; @@ -3179,7 +3197,7 @@ void Execute_Command(char *command) int i; printf("# You can configure additional/alternative image files here.\n"); - printf("# (The images below are default and therefore commented out.)\n"); + printf("# (The entries below are default and therefore commented out.)\n"); printf("\n"); printf("%s\n", getFormattedSetupEntry("name", "Classic Graphics")); printf("\n"); @@ -3198,7 +3216,7 @@ void Execute_Command(char *command) int i; printf("# You can configure additional/alternative sound files here.\n"); - printf("# (The sounds below are default and therefore commented out.)\n"); + printf("# (The entries below are default and therefore commented out.)\n"); printf("\n"); printf("%s\n", getFormattedSetupEntry("name", "Classic Sounds")); printf("\n"); @@ -3214,11 +3232,30 @@ void Execute_Command(char *command) } else if (strcmp(command, "print musicinfo.conf") == 0) { - printf("# (Currently only \"name\" and \"sort_priority\" recognized.)\n"); + int i; + + printf("# You can configure additional/alternative music files here.\n"); + printf("# (The entries below are default and therefore commented out.)\n"); printf("\n"); printf("%s\n", getFormattedSetupEntry("name", "Classic Music")); printf("\n"); printf("%s\n", getFormattedSetupEntry("sort_priority", "100")); + printf("\n"); + + for (i=0; music_config[i].token != NULL; i++) + printf("# %s\n", + getFormattedSetupEntry(music_config[i].token, + music_config[i].value)); + + exit(0); + } + else if (strcmp(command, "print editorsetup.conf") == 0) + { + printf("# You can configure your personal editor element list here.\n"); + printf("# (The entries below are default and therefore commented out.)\n"); + printf("\n"); + + PrintEditorElementList(); exit(0); } diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 948304ce..9b3f6633 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -550,36 +550,7 @@ void setString(char **old_value, char *new_value) /* command line option handling functions */ /* ------------------------------------------------------------------------- */ -static void printUsage() -{ - printf("\n" - "Usage: %s [OPTION]... [HOSTNAME [PORT]]\n" - "\n" - "Options:\n" - " -d, --display HOSTNAME[:SCREEN] specify X server display\n" - " -b, --basepath DIRECTORY alternative base DIRECTORY\n" - " -l, --level DIRECTORY alternative level DIRECTORY\n" - " -g, --graphics DIRECTORY alternative graphics DIRECTORY\n" - " -s, --sounds DIRECTORY alternative sounds DIRECTORY\n" - " -m, --music DIRECTORY alternative music DIRECTORY\n" - " -n, --network network multiplayer game\n" - " --serveronly only start network server\n" - " -v, --verbose verbose mode\n" - " --debug display debugging information\n" - " -e, --execute COMMAND execute batch COMMAND:\n" - "\n" - "Valid commands for '--execute' option:\n" - " \"print graphicsinfo.conf\" print default graphics config\n" - " \"print soundsinfo.conf\" print default sounds config\n" - " \"print musicinfo.conf\" print default music config\n" - " \"dump level FILE\" dump level data from FILE\n" - " \"dump tape FILE\" dump tape data from FILE\n" - " \"autoplay LEVELDIR\" play level tapes for LEVELDIR\n" - "\n", - program.command_basename); -} - -void GetOptions(char *argv[]) +void GetOptions(char *argv[], void (*print_usage_function)(void)) { char **options_left = &argv[1]; @@ -641,7 +612,7 @@ void GetOptions(char *argv[]) Error(ERR_EXIT_HELP, "unrecognized option '%s'", option); else if (strncmp(option, "-help", option_len) == 0) { - printUsage(); + print_usage_function(); exit(0); } diff --git a/src/libgame/misc.h b/src/libgame/misc.h index 71c0d7fe..266efa28 100644 --- a/src/libgame/misc.h +++ b/src/libgame/misc.h @@ -99,7 +99,7 @@ char *getStringCopy(char *); char *getStringToLower(char *); void setString(char **, char *); -void GetOptions(char **); +void GetOptions(char **, void (*print_usage_function)(void)); void SetError(char *, ...); char *GetError(void); diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 446fb1e4..00168642 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -1234,6 +1234,17 @@ SetupFileList *setListEntry(SetupFileList *list, char *token, char *value) return setListEntry(list->next, token, value); } +SetupFileList *addListEntry(SetupFileList *list, char *token, char *value) +{ + if (list == NULL) + return NULL; + + if (list->next == NULL) + return (list->next = newSetupFileList(token, value)); + else + return addListEntry(list->next, token, value); +} + #ifdef DEBUG static void printSetupFileList(SetupFileList *list) { @@ -1430,7 +1441,7 @@ static void *loadSetupFileData(char *filename, boolean use_hash) if (use_hash) setHashEntry((SetupFileHash *)setup_file_data, token, value); else - insert_ptr = setListEntry((SetupFileList *)insert_ptr, token, value); + insert_ptr = addListEntry((SetupFileList *)insert_ptr, token, value); } } diff --git a/src/libgame/setup.h b/src/libgame/setup.h index 85ec5db1..8f1bffef 100644 --- a/src/libgame/setup.h +++ b/src/libgame/setup.h @@ -243,6 +243,7 @@ SetupFileList *newSetupFileList(char *, char *); void freeSetupFileList(SetupFileList *); char *getListEntry(SetupFileList *, char *); SetupFileList *setListEntry(SetupFileList *, char *, char *); +SetupFileList *addListEntry(SetupFileList *, char *, char *); SetupFileList *loadSetupFileList(char *); SetupFileHash *newSetupFileHash(); diff --git a/src/main.c b/src/main.c index f7b2a41e..ee4271d0 100644 --- a/src/main.c +++ b/src/main.c @@ -3714,7 +3714,18 @@ struct ElementActionInfo element_action_info[NUM_ACTIONS + 1 + 1] = { ".changing", ACTION_CHANGING, FALSE }, { ".exploding", ACTION_EXPLODING, FALSE }, { ".boring", ACTION_BORING, FALSE }, - { ".sleeping", ACTION_SLEEPING, TRUE }, + { ".boring:1", ACTION_BORING_1, FALSE }, + { ".boring:2", ACTION_BORING_2, FALSE }, + { ".boring:3", ACTION_BORING_3, FALSE }, + { ".boring:4", ACTION_BORING_4, FALSE }, + { ".boring:5", ACTION_BORING_5, FALSE }, + { ".boring:6", ACTION_BORING_6, FALSE }, + { ".boring:7", ACTION_BORING_7, FALSE }, + { ".boring:8", ACTION_BORING_8, FALSE }, + { ".sleeping", ACTION_SLEEPING, FALSE }, + { ".sleeping:1", ACTION_SLEEPING_1, FALSE }, + { ".sleeping:2", ACTION_SLEEPING_2, FALSE }, + { ".sleeping:3", ACTION_SLEEPING_3, FALSE }, { ".dying", ACTION_DYING, FALSE }, { ".turning", ACTION_TURNING, FALSE }, { ".turning_from_left", ACTION_TURNING_FROM_LEFT, FALSE }, @@ -3792,6 +3803,11 @@ struct TokenIntPtrInfo image_config_vars[] = { "door_2.step_delay", &door_2.step_delay }, { "door_2.anim_mode", &door_2.anim_mode }, + { "[player].boring_delay_fixed", &game.player_boring_delay_fixed }, + { "[player].boring_delay_random", &game.player_boring_delay_random }, + { "[player].sleeping_delay_fixed", &game.player_sleeping_delay_fixed }, + { "[player].sleeping_delay_random", &game.player_sleeping_delay_random }, + { NULL, NULL, } }; @@ -3856,6 +3872,36 @@ struct MusicPrefixInfo music_prefix_info[NUM_MUSIC_PREFIXES + 1] = /* main() */ /* ========================================================================= */ +static void print_usage() +{ + printf("\n" + "Usage: %s [OPTION]... [HOSTNAME [PORT]]\n" + "\n" + "Options:\n" + " -d, --display HOSTNAME[:SCREEN] specify X server display\n" + " -b, --basepath DIRECTORY alternative base DIRECTORY\n" + " -l, --level DIRECTORY alternative level DIRECTORY\n" + " -g, --graphics DIRECTORY alternative graphics DIRECTORY\n" + " -s, --sounds DIRECTORY alternative sounds DIRECTORY\n" + " -m, --music DIRECTORY alternative music DIRECTORY\n" + " -n, --network network multiplayer game\n" + " --serveronly only start network server\n" + " -v, --verbose verbose mode\n" + " --debug display debugging information\n" + " -e, --execute COMMAND execute batch COMMAND:\n" + "\n" + "Valid commands for '--execute' option:\n" + " \"print graphicsinfo.conf\" print default graphics config\n" + " \"print soundsinfo.conf\" print default sounds config\n" + " \"print musicinfo.conf\" print default music config\n" + " \"print editorsetup.conf\" print default editor config\n" + " \"dump level FILE\" dump level data from FILE\n" + " \"dump tape FILE\" dump tape data from FILE\n" + " \"autoplay LEVELDIR\" play level tapes for LEVELDIR\n" + "\n", + program.command_basename); +} + int main(int argc, char *argv[]) { InitProgramInfo(argv[0], USERDATA_DIRECTORY, @@ -3867,7 +3913,7 @@ int main(int argc, char *argv[]) InitExitFunction(CloseAllAndExit); InitPlatformDependentStuff(); - GetOptions(argv); + GetOptions(argv, print_usage); OpenAll(); EventLoop(); diff --git a/src/main.h b/src/main.h index 627d5291..3c6527ab 100644 --- a/src/main.h +++ b/src/main.h @@ -919,16 +919,27 @@ #define ACTION_CHANGING 23 #define ACTION_EXPLODING 24 #define ACTION_BORING 25 -#define ACTION_SLEEPING 26 -#define ACTION_DYING 27 -#define ACTION_TURNING 28 -#define ACTION_TURNING_FROM_LEFT 29 -#define ACTION_TURNING_FROM_RIGHT 30 -#define ACTION_TURNING_FROM_UP 31 -#define ACTION_TURNING_FROM_DOWN 32 -#define ACTION_OTHER 33 - -#define NUM_ACTIONS 34 +#define ACTION_BORING_1 26 +#define ACTION_BORING_2 27 +#define ACTION_BORING_3 28 +#define ACTION_BORING_4 29 +#define ACTION_BORING_5 30 +#define ACTION_BORING_6 31 +#define ACTION_BORING_7 32 +#define ACTION_BORING_8 33 +#define ACTION_SLEEPING 34 +#define ACTION_SLEEPING_1 35 +#define ACTION_SLEEPING_2 36 +#define ACTION_SLEEPING_3 37 +#define ACTION_DYING 38 +#define ACTION_TURNING 39 +#define ACTION_TURNING_FROM_LEFT 40 +#define ACTION_TURNING_FROM_RIGHT 41 +#define ACTION_TURNING_FROM_UP 42 +#define ACTION_TURNING_FROM_DOWN 43 +#define ACTION_OTHER 44 + +#define NUM_ACTIONS 45 /* values for special image configuration suffixes (must match game mode) */ #define GFX_SPECIAL_ARG_DEFAULT 0 @@ -973,9 +984,13 @@ #define GFX_ARG_DRAW_XOFFSET 23 #define GFX_ARG_DRAW_YOFFSET 24 #define GFX_ARG_DRAW_MASKED 25 -#define GFX_ARG_NAME 26 +#define GFX_ARG_ANIM_DELAY_FIXED 26 +#define GFX_ARG_ANIM_DELAY_RANDOM 27 +#define GFX_ARG_POST_DELAY_FIXED 28 +#define GFX_ARG_POST_DELAY_RANDOM 29 +#define GFX_ARG_NAME 30 -#define NUM_GFX_ARGS 27 +#define NUM_GFX_ARGS 31 /* values for sound configuration suffixes */ @@ -1158,7 +1173,7 @@ struct PlayerInfo byte programmed_action; /* action forced by game itself (like moving through doors); overrides other actions */ - int jx,jy, last_jx,last_jy; + int jx, jy, last_jx, last_jy; int MovDir, MovPos, GfxDir, GfxPos; int Frame, StepFrame; @@ -1178,6 +1193,12 @@ struct PlayerInfo boolean is_pushing; boolean is_switching; + boolean is_bored; + boolean is_sleeping; + + int frame_counter_bored; + int frame_counter_sleeping; + int switch_x, switch_y; int show_envelope; @@ -1304,6 +1325,12 @@ struct GameInfo boolean gravity; boolean explosions_delayed; boolean envelope_active; + + /* values for player idle animation (no effect on engine) */ + int player_boring_delay_fixed; + int player_boring_delay_random; + int player_sleeping_delay_fixed; + int player_sleeping_delay_random; }; struct GlobalInfo @@ -1456,6 +1483,11 @@ struct GraphicInfo int diggable_like; /* element for cloning digging graphics */ int border_size; /* border size for "crumbled" graphics */ + int anim_delay_fixed; /* optional delay values for bored and */ + int anim_delay_random; /* sleeping player animations (animation */ + int post_delay_fixed; /* intervall and following pause before */ + int post_delay_random; /* next intervall (bored animation only) */ + int step_offset; /* optional step offset of toon animations */ int step_delay; /* optional step delay of toon animations */ diff --git a/src/tools.c b/src/tools.c index fbb30793..e28f068e 100644 --- a/src/tools.c +++ b/src/tools.c @@ -553,6 +553,19 @@ static int getPlayerGraphic(struct PlayerInfo *player, int move_dir) return el_act_dir2img(player->element_nr, player->GfxAction, move_dir); } +static boolean equalGraphics(int graphic1, int graphic2) +{ + struct GraphicInfo *g1 = &graphic_info[graphic1]; + struct GraphicInfo *g2 = &graphic_info[graphic2]; + + return (g1->bitmap == g2->bitmap && + g1->src_x == g2->src_x && + g1->src_y == g2->src_y && + g1->anim_frames == g2->anim_frames && + g1->anim_delay == g2->anim_delay && + g1->anim_mode == g2->anim_mode); +} + void DrawAllPlayers() { int i; @@ -615,11 +628,19 @@ void DrawPlayer(struct PlayerInfo *player) if (element == EL_EXPLOSION) return; - action = (player->is_pushing ? ACTION_PUSHING : + action = (player->is_pushing ? ACTION_PUSHING : player->is_digging ? ACTION_DIGGING : player->is_collecting ? ACTION_COLLECTING : player->is_moving ? ACTION_MOVING : - player->is_snapping ? ACTION_SNAPPING : ACTION_DEFAULT); + player->is_snapping ? ACTION_SNAPPING : + player->is_sleeping ? ACTION_SLEEPING : + player->is_bored ? ACTION_BORING : + player->is_waiting ? ACTION_WAITING : ACTION_DEFAULT); + + if (player->is_bored || player->is_sleeping) + { + /* ... */ + } #if 0 printf("::: '%s'\n", element_action_info[action].suffix); @@ -704,8 +725,7 @@ void DrawPlayer(struct PlayerInfo *player) /* in the case of changed player action or direction, prevent the current animation frame from being restarted for identical animations */ - if (player->Frame == 0 && - graphic_info[graphic].bitmap == graphic_info[last_player_graphic].bitmap) + if (player->Frame == 0 && equalGraphics(graphic, last_player_graphic)) player->Frame = last_player_frame; #else -- 2.34.1