From 05ca3ceb489c27197cf846441c1464536479a5cb Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 7 Jan 2003 03:53:54 +0100 Subject: [PATCH] rnd-20030107-2-src --- src/conf_gfx.c | 156 +++++++++++++++++++++---------------------- src/conf_snd.c | 4 +- src/conftime.h | 2 +- src/libgame/misc.c | 73 +++++++++++++++++++- src/libgame/misc.h | 3 + src/libgame/setup.c | 56 +--------------- src/libgame/system.h | 1 + 7 files changed, 158 insertions(+), 137 deletions(-) diff --git a/src/conf_gfx.c b/src/conf_gfx.c index fbfeae93..0a6beead 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -17,23 +17,23 @@ struct ConfigInfo image_config_suffix[] = { - { ".xpos", "0" }, - { ".ypos", "0" }, - { ".offset", "32" }, - { ".vertical", "0" }, - { ".xoffset", GFX_ARG_UNDEFINED }, - { ".yoffset", GFX_ARG_UNDEFINED }, - { ".frames", "1" }, - { ".start_frame", GFX_ARG_UNDEFINED }, - { ".delay", "1" }, - { ".mode_loop", "0" }, - { ".mode_linear", "0" }, - { ".mode_pingpong", "0" }, - { ".mode_pingpong2", "0" }, - { ".mode_reverse", "0" }, - { ".global_sync", GFX_ARG_UNDEFINED }, - - { NULL, NULL } + { ".xpos", "0", TYPE_INTEGER }, + { ".ypos", "0", TYPE_INTEGER }, + { ".offset", "32", TYPE_INTEGER }, + { ".vertical", "false", TYPE_BOOLEAN }, + { ".xoffset", GFX_ARG_UNDEFINED, TYPE_INTEGER }, + { ".yoffset", GFX_ARG_UNDEFINED, TYPE_INTEGER }, + { ".frames", "1", TYPE_INTEGER }, + { ".start_frame", GFX_ARG_UNDEFINED, TYPE_INTEGER }, + { ".delay", "1", TYPE_INTEGER }, + { ".mode_loop", "false", TYPE_BOOLEAN }, + { ".mode_linear", "false", TYPE_BOOLEAN }, + { ".mode_pingpong", "false", TYPE_BOOLEAN }, + { ".mode_pingpong2", "false", TYPE_BOOLEAN }, + { ".mode_reverse", "false", TYPE_BOOLEAN }, + { ".global_sync", GFX_ARG_UNDEFINED, TYPE_BOOLEAN }, + + { NULL, NULL, 0 } }; struct ConfigInfo image_config[] = @@ -58,7 +58,7 @@ struct ConfigInfo image_config[] = { "bd_rock.moving_left.ypos", "10" }, { "bd_rock.moving_left.frames", "4" }, { "bd_rock.moving_left.delay", "2" }, - { "bd_rock.moving_left.mode_reverse", "1" }, + { "bd_rock.moving_left.mode_reverse", "true" }, { "bd_rock.moving_right", "RocksDC.pcx" }, { "bd_rock.moving_right.xpos", "12" }, { "bd_rock.moving_right.ypos", "10" }, @@ -71,7 +71,7 @@ struct ConfigInfo image_config[] = { "bd_diamond.ypos", "10" }, { "bd_diamond.frames", "4" }, { "bd_diamond.delay", "4" }, - { "bd_diamond.mode_reverse", "1" }, + { "bd_diamond.mode_reverse", "true" }, { "bd_diamond.moving", "RocksElements.pcx" }, { "bd_diamond.moving.xpos", "3" }, { "bd_diamond.moving.ypos", "10" }, @@ -91,25 +91,25 @@ struct ConfigInfo image_config[] = { "bd_magic_wall.active.xpos", "12" }, { "bd_magic_wall.active.ypos", "10" }, { "bd_magic_wall.active.frames", "4" }, - { "bd_magic_wall.active.mode_reverse", "1" }, + { "bd_magic_wall.active.mode_reverse", "true" }, { "bd_magic_wall.active.delay", "4" }, { "bd_magic_wall.filling", "RocksElements.pcx" }, { "bd_magic_wall.filling.xpos", "12" }, { "bd_magic_wall.filling.ypos", "10" }, { "bd_magic_wall.filling.frames", "4" }, - { "bd_magic_wall.filling.mode_reverse", "1" }, + { "bd_magic_wall.filling.mode_reverse", "true" }, { "bd_magic_wall.filling.delay", "4" }, { "bd_magic_wall.full", "RocksElements.pcx" }, { "bd_magic_wall.full.xpos", "12" }, { "bd_magic_wall.full.ypos", "10" }, { "bd_magic_wall.full.frames", "4" }, - { "bd_magic_wall.full.mode_reverse", "1" }, + { "bd_magic_wall.full.mode_reverse", "true" }, { "bd_magic_wall.full.delay", "4" }, { "bd_magic_wall.emptying", "RocksElements.pcx" }, { "bd_magic_wall.emptying.xpos", "12" }, { "bd_magic_wall.emptying.ypos", "10" }, { "bd_magic_wall.emptying.frames", "4" }, - { "bd_magic_wall.emptying.mode_reverse", "1" }, + { "bd_magic_wall.emptying.mode_reverse", "true" }, { "bd_magic_wall.emptying.delay", "4" }, { "bd_magic_wall.dead", "RocksElements.pcx" }, { "bd_magic_wall.dead.xpos", "12" }, @@ -141,13 +141,13 @@ struct ConfigInfo image_config[] = { "bd_butterfly.xpos", "4" }, { "bd_butterfly.ypos", "12" }, { "bd_butterfly.frames", "2" }, - { "bd_butterfly.mode_pingpong", "1" }, + { "bd_butterfly.mode_pingpong", "true" }, { "bd_butterfly.delay", "4" }, { "bd_butterfly.moving", "RocksElements.pcx" }, { "bd_butterfly.moving.xpos", "4" }, { "bd_butterfly.moving.ypos", "12" }, { "bd_butterfly.moving.frames", "2" }, - { "bd_butterfly.moving.mode_pingpong", "1" }, + { "bd_butterfly.moving.mode_pingpong", "true" }, { "bd_butterfly.moving.delay", "4" }, { "bd_butterfly_right", "RocksElements.pcx" }, { "bd_butterfly_right.xpos", "8" }, @@ -170,13 +170,13 @@ struct ConfigInfo image_config[] = { "bd_firefly.xpos", "6" }, { "bd_firefly.ypos", "12" }, { "bd_firefly.frames", "2" }, - { "bd_firefly.mode_pingpong", "1" }, + { "bd_firefly.mode_pingpong", "true" }, { "bd_firefly.delay", "4" }, { "bd_firefly.moving", "RocksElements.pcx" }, { "bd_firefly.moving.xpos", "6" }, { "bd_firefly.moving.ypos", "12" }, { "bd_firefly.moving.frames", "2" }, - { "bd_firefly.moving.mode_pingpong", "1" }, + { "bd_firefly.moving.mode_pingpong", "true" }, { "bd_firefly.moving.delay", "4" }, { "bd_firefly_right", "RocksElements.pcx" }, { "bd_firefly_right.xpos", "12" }, @@ -215,7 +215,7 @@ struct ConfigInfo image_config[] = { "sp_zonk.moving_left.ypos", "6" }, { "sp_zonk.moving_left.frames", "4" }, { "sp_zonk.moving_left.delay", "2" }, - { "sp_zonk.moving_left.mode_reverse", "1" }, + { "sp_zonk.moving_left.mode_reverse", "true" }, { "sp_zonk.moving_right", "RocksSP.pcx" }, { "sp_zonk.moving_right.xpos", "0" }, { "sp_zonk.moving_right.ypos", "6" }, @@ -240,13 +240,13 @@ struct ConfigInfo image_config[] = { "sp_murphy_left.moving.xpos", "8" }, { "sp_murphy_left.moving.ypos", "0" }, { "sp_murphy_left.moving.frames", "3" }, - { "sp_murphy_left.moving.mode_pingpong", "1" }, + { "sp_murphy_left.moving.mode_pingpong", "true" }, { "sp_murphy_left.moving.delay", "2" }, { "sp_murphy_left.digging", "RocksSP.pcx" }, { "sp_murphy_left.digging.xpos", "8" }, { "sp_murphy_left.digging.ypos", "0" }, { "sp_murphy_left.digging.frames", "3" }, - { "sp_murphy_left.digging.mode_pingpong", "1" }, + { "sp_murphy_left.digging.mode_pingpong", "true" }, { "sp_murphy_left.digging.delay", "2" }, { "sp_murphy_left.pushing", "RocksSP.pcx" }, { "sp_murphy_left.pushing.xpos", "11" }, @@ -265,13 +265,13 @@ struct ConfigInfo image_config[] = { "sp_murphy_right.moving.xpos", "11" }, { "sp_murphy_right.moving.ypos", "0" }, { "sp_murphy_right.moving.frames", "3" }, - { "sp_murphy_right.moving.mode_pingpong", "1" }, + { "sp_murphy_right.moving.mode_pingpong", "true" }, { "sp_murphy_right.moving.delay", "2" }, { "sp_murphy_right.digging", "RocksSP.pcx" }, { "sp_murphy_right.digging.xpos", "11" }, { "sp_murphy_right.digging.ypos", "0" }, { "sp_murphy_right.digging.frames", "3" }, - { "sp_murphy_right.digging.mode_pingpong", "1" }, + { "sp_murphy_right.digging.mode_pingpong", "true" }, { "sp_murphy_right.digging.delay", "2" }, { "sp_murphy_right.pushing", "RocksSP.pcx" }, { "sp_murphy_right.pushing.xpos", "10" }, @@ -449,22 +449,22 @@ struct ConfigInfo image_config[] = { "sp_sniksnak_left.xpos", "8" }, { "sp_sniksnak_left.ypos", "8" }, { "sp_sniksnak_left.frames", "4" }, - { "sp_sniksnak_left.mode_pingpong2", "1" }, + { "sp_sniksnak_left.mode_pingpong2", "true" }, { "sp_sniksnak_right", "RocksSP.pcx" }, { "sp_sniksnak_right.xpos", "12" }, { "sp_sniksnak_right.ypos", "8" }, { "sp_sniksnak_right.frames", "4" }, - { "sp_sniksnak_right.mode_pingpong2", "1" }, + { "sp_sniksnak_right.mode_pingpong2", "true" }, { "sp_sniksnak_up", "RocksSP.pcx" }, { "sp_sniksnak_up.xpos", "8" }, { "sp_sniksnak_up.ypos", "9" }, { "sp_sniksnak_up.frames", "4" }, - { "sp_sniksnak_up.mode_pingpong2", "1" }, + { "sp_sniksnak_up.mode_pingpong2", "true" }, { "sp_sniksnak_down", "RocksSP.pcx" }, { "sp_sniksnak_down.xpos", "12" }, { "sp_sniksnak_down.ypos", "9" }, { "sp_sniksnak_down.frames", "4" }, - { "sp_sniksnak_down.mode_pingpong2", "1" }, + { "sp_sniksnak_down.mode_pingpong2", "true" }, { "sp_electron", "RocksSP.pcx" }, { "sp_electron.xpos", "8" }, @@ -586,7 +586,7 @@ struct ConfigInfo image_config[] = { "rock.moving_left.ypos", "0" }, { "rock.moving_left.frames", "4" }, { "rock.moving_left.delay", "2" }, - { "rock.moving_left.mode_reverse", "1" }, + { "rock.moving_left.mode_reverse", "true" }, { "rock.moving_right", "RocksElements.pcx" }, { "rock.moving_right.xpos", "12" }, { "rock.moving_right.ypos", "0" }, @@ -650,7 +650,7 @@ struct ConfigInfo image_config[] = { "nut.cracking.ypos", "1" }, { "nut.cracking.frames", "3" }, { "nut.cracking.delay", "2" }, - { "nut.cracking.mode_linear", "1" }, + { "nut.cracking.mode_linear", "true" }, { "dynamite", "RocksElements.pcx" }, { "dynamite.xpos", "0" }, @@ -661,7 +661,7 @@ struct ConfigInfo image_config[] = { "dynamite.active.ypos", "3" }, { "dynamite.active.frames", "7" }, { "dynamite.active.delay", "12" }, - { "dynamite.active.mode_linear", "1" }, + { "dynamite.active.mode_linear", "true" }, { "wall_emerald", "RocksElements.pcx" }, { "wall_emerald.xpos", "4" }, @@ -727,7 +727,7 @@ struct ConfigInfo image_config[] = { "yamyam.xpos", "0" }, { "yamyam.ypos", "5" }, { "yamyam.frames", "4" }, - { "yamyam.mode_pingpong2", "1" }, + { "yamyam.mode_pingpong2", "true" }, { "yamyam.moving", "RocksElements.pcx" }, { "yamyam.moving.xpos", "0" }, { "yamyam.moving.ypos", "5" }, @@ -737,7 +737,7 @@ struct ConfigInfo image_config[] = { "robot.xpos", "4" }, { "robot.ypos", "5" }, { "robot.frames", "4" }, - { "robot.mode_pingpong2", "1" }, + { "robot.mode_pingpong2", "true" }, { "robot.moving", "RocksElements.pcx" }, { "robot.moving.xpos", "4" }, { "robot.moving.ypos", "5" }, @@ -760,25 +760,25 @@ struct ConfigInfo image_config[] = { "magic_wall.active.xpos", "0" }, { "magic_wall.active.ypos", "8" }, { "magic_wall.active.frames", "4" }, - { "magic_wall.active.mode_reverse", "1" }, + { "magic_wall.active.mode_reverse", "true" }, { "magic_wall.active.delay", "4" }, { "magic_wall.filling", "RocksElements.pcx" }, { "magic_wall.filling.xpos", "0" }, { "magic_wall.filling.ypos", "8" }, { "magic_wall.filling.frames", "4" }, - { "magic_wall.filling.mode_reverse", "1" }, + { "magic_wall.filling.mode_reverse", "true" }, { "magic_wall.filling.delay", "4" }, { "magic_wall.full", "RocksElements.pcx" }, { "magic_wall.full.xpos", "0" }, { "magic_wall.full.ypos", "8" }, { "magic_wall.full.frames", "4" }, - { "magic_wall.full.mode_reverse", "1" }, + { "magic_wall.full.mode_reverse", "true" }, { "magic_wall.full.delay", "4" }, { "magic_wall.emptying", "RocksElements.pcx" }, { "magic_wall.emptying.xpos", "0" }, { "magic_wall.emptying.ypos", "8" }, { "magic_wall.emptying.frames", "4" }, - { "magic_wall.emptying.mode_reverse", "1" }, + { "magic_wall.emptying.mode_reverse", "true" }, { "magic_wall.emptying.delay", "4" }, { "magic_wall.dead", "RocksElements.pcx" }, { "magic_wall.dead.xpos", "0" }, @@ -834,13 +834,13 @@ struct ConfigInfo image_config[] = { "acid_splash_left.ypos", "10" }, { "acid_splash_left.frames", "4" }, { "acid_splash_left.delay", "2" }, - { "acid_splash_left.mode_linear", "1" }, + { "acid_splash_left.mode_linear", "true" }, { "acid_splash_right", "RocksHeroes.pcx" }, { "acid_splash_right.xpos", "12" }, { "acid_splash_right.ypos", "10" }, { "acid_splash_right.frames", "4" }, { "acid_splash_right.delay", "2" }, - { "acid_splash_right.mode_linear", "1" }, + { "acid_splash_right.mode_linear", "true" }, { "amoeba_drop", "RocksElements.pcx" }, { "amoeba_drop.xpos", "5" }, @@ -851,14 +851,14 @@ struct ConfigInfo image_config[] = { "amoeba.creating.ypos", "6" }, { "amoeba.creating.frames", "3" }, { "amoeba.creating.delay", "2" }, - { "amoeba.creating.mode_linear", "1" }, + { "amoeba.creating.mode_linear", "true" }, { "amoeba.shrinking", "RocksElements.pcx" }, { "amoeba.shrinking.xpos", "5" }, { "amoeba.shrinking.ypos", "6" }, { "amoeba.shrinking.frames", "3" }, { "amoeba.shrinking.delay", "2" }, - { "amoeba.shrinking.mode_linear", "1" }, - { "amoeba.shrinking.mode_reverse", "1" }, + { "amoeba.shrinking.mode_linear", "true" }, + { "amoeba.shrinking.mode_reverse", "true" }, { "amoeba_wet", "RocksElements.pcx" }, { "amoeba_wet.xpos", "8" }, { "amoeba_wet.ypos", "6" }, @@ -999,13 +999,13 @@ struct ConfigInfo image_config[] = { "exit.opening.ypos", "11" }, { "exit.opening.frames", "5" }, { "exit.opening.delay", "6" }, - { "exit.opening.mode_linear", "1" }, + { "exit.opening.mode_linear", "true" }, { "exit_open", "RocksElements.pcx" }, { "exit_open.xpos", "4" }, { "exit_open.ypos", "11" }, { "exit_open.frames", "4" }, { "exit_open.delay", "4" }, - { "exit_open.mode_pingpong", "1" }, + { "exit_open.mode_pingpong", "true" }, /* images for Emerald Mine Club style elements and actions */ @@ -1017,7 +1017,7 @@ struct ConfigInfo image_config[] = { "balloon.moving.xpos", "12" }, { "balloon.moving.ypos", "7" }, { "balloon.moving.frames", "4" }, - { "balloon.moving.mode_pingpong", "1" }, + { "balloon.moving.mode_pingpong", "true" }, { "balloon.moving.delay", "2" }, { "balloon_send_left", "RocksDC.pcx" }, @@ -1365,14 +1365,14 @@ struct ConfigInfo image_config[] = { "shield_normal.active.ypos", "13" }, { "shield_normal.active.frames", "3" }, { "shield_normal.active.delay", "8" }, - { "shield_normal.active.mode_pingpong", "1" }, + { "shield_normal.active.mode_pingpong", "true" }, { "shield_deadly.active", "RocksHeroes.pcx" }, { "shield_deadly.active.xpos", "5" }, { "shield_deadly.active.ypos", "13" }, { "shield_deadly.active.frames", "3" }, { "shield_deadly.active.delay", "8" }, - { "shield_deadly.active.mode_pingpong", "1" }, + { "shield_deadly.active.mode_pingpong", "true" }, { "switchgate_closed", "RocksDC.pcx" }, { "switchgate_closed.xpos", "8" }, @@ -1392,7 +1392,7 @@ struct ConfigInfo image_config[] = { "switchgate.closing.ypos", "5" }, { "switchgate.closing.frames", "5" }, { "switchgate.closing.delay", "6" }, - { "switchgate.closing.mode_reverse", "1" }, + { "switchgate.closing.mode_reverse", "true" }, { "timegate_closed", "RocksDC.pcx" }, { "timegate_closed.xpos", "8" }, @@ -1412,7 +1412,7 @@ struct ConfigInfo image_config[] = { "timegate.closing.ypos", "6" }, { "timegate.closing.frames", "5" }, { "timegate.closing.delay", "6" }, - { "timegate.closing.mode_reverse", "1" }, + { "timegate.closing.mode_reverse", "true" }, { "pearl", "RocksDC.pcx" }, { "pearl.xpos", "8" }, @@ -1506,7 +1506,7 @@ struct ConfigInfo image_config[] = { "trap.active.ypos", "8" }, { "trap.active.frames", "4" }, { "trap.active.delay", "4" }, - { "trap.active.mode_pingpong2", "1" }, + { "trap.active.mode_pingpong2", "true" }, { "dx_supabomb", "RocksDC.pcx" }, { "dx_supabomb.xpos", "15" }, @@ -1579,28 +1579,28 @@ struct ConfigInfo image_config[] = { "pacman_right.xpos", "8" }, { "pacman_right.ypos", "5" }, { "pacman_right.frames", "2" }, - { "pacman_right.mode_reverse", "1" }, + { "pacman_right.mode_reverse", "true" }, { "pacman_right.delay", "4" }, { "pacman_right.offset", "128" }, { "pacman_up", "RocksElements.pcx" }, { "pacman_up.xpos", "9" }, { "pacman_up.ypos", "5" }, { "pacman_up.frames", "2" }, - { "pacman_up.mode_reverse", "1" }, + { "pacman_up.mode_reverse", "true" }, { "pacman_up.delay", "4" }, { "pacman_up.offset", "128" }, { "pacman_left", "RocksElements.pcx" }, { "pacman_left.xpos", "10" }, { "pacman_left.ypos", "5" }, { "pacman_left.frames", "2" }, - { "pacman_left.mode_reverse", "1" }, + { "pacman_left.mode_reverse", "true" }, { "pacman_left.delay", "4" }, { "pacman_left.offset", "128" }, { "pacman_down", "RocksElements.pcx" }, { "pacman_down.xpos", "11" }, { "pacman_down.ypos", "5" }, { "pacman_down.frames", "2" }, - { "pacman_down.mode_reverse", "1" }, + { "pacman_down.mode_reverse", "true" }, { "pacman_down.delay", "4" }, { "pacman_down.offset", "128" }, @@ -1704,25 +1704,25 @@ struct ConfigInfo image_config[] = { "wall_growing_active_left.ypos", "10" }, { "wall_growing_active_left.frames", "3" }, { "wall_growing_active_left.delay", "6" }, - { "wall_growing_active_left.mode_linear", "1" }, + { "wall_growing_active_left.mode_linear", "true" }, { "wall_growing_active_right", "RocksElements.pcx" }, { "wall_growing_active_right.xpos", "5" }, { "wall_growing_active_right.ypos", "10" }, { "wall_growing_active_right.frames", "3" }, { "wall_growing_active_right.delay", "6" }, - { "wall_growing_active_right.mode_linear", "1" }, + { "wall_growing_active_right.mode_linear", "true" }, { "wall_growing_active_up", "RocksHeroes.pcx" }, { "wall_growing_active_up.xpos", "3" }, { "wall_growing_active_up.ypos", "12" }, { "wall_growing_active_up.frames", "3" }, { "wall_growing_active_up.delay", "6" }, - { "wall_growing_active_up.mode_linear", "1" }, + { "wall_growing_active_up.mode_linear", "true" }, { "wall_growing_active_down", "RocksHeroes.pcx" }, { "wall_growing_active_down.xpos", "0" }, { "wall_growing_active_down.ypos", "12" }, { "wall_growing_active_down.frames", "3" }, { "wall_growing_active_down.delay", "6" }, - { "wall_growing_active_down.mode_linear", "1" }, + { "wall_growing_active_down.mode_linear", "true" }, { "black_orb", "RocksElements.pcx" }, { "black_orb.xpos", "13" }, @@ -1738,38 +1738,38 @@ struct ConfigInfo image_config[] = { "dark_yamyam.xpos", "8" }, { "dark_yamyam.ypos", "11" }, { "dark_yamyam.frames", "4" }, - { "dark_yamyam.mode_pingpong2", "1" }, + { "dark_yamyam.mode_pingpong2", "true" }, { "dynabomb.active", "RocksElements.pcx" }, { "dynabomb.active.xpos", "12" }, { "dynabomb.active.ypos", "11" }, { "dynabomb.active.frames", "4" }, { "dynabomb.active.delay", "6" }, - { "dynabomb.active.mode_pingpong", "1" }, + { "dynabomb.active.mode_pingpong", "true" }, { "dynabomb_player1.active", "RocksElements.pcx" }, { "dynabomb_player1.active.xpos", "12" }, { "dynabomb_player1.active.ypos", "11" }, { "dynabomb_player1.active.frames", "4" }, { "dynabomb_player1.active.delay", "6" }, - { "dynabomb_player1.active.mode_pingpong", "1" }, + { "dynabomb_player1.active.mode_pingpong", "true" }, { "dynabomb_player2.active", "RocksElements.pcx" }, { "dynabomb_player2.active.xpos", "12" }, { "dynabomb_player2.active.ypos", "11" }, { "dynabomb_player2.active.frames", "4" }, { "dynabomb_player2.active.delay", "6" }, - { "dynabomb_player2.active.mode_pingpong", "1" }, + { "dynabomb_player2.active.mode_pingpong", "true" }, { "dynabomb_player3.active", "RocksElements.pcx" }, { "dynabomb_player3.active.xpos", "12" }, { "dynabomb_player3.active.ypos", "11" }, { "dynabomb_player3.active.frames", "4" }, { "dynabomb_player3.active.delay", "6" }, - { "dynabomb_player3.active.mode_pingpong", "1" }, + { "dynabomb_player3.active.mode_pingpong", "true" }, { "dynabomb_player4.active", "RocksElements.pcx" }, { "dynabomb_player4.active.xpos", "12" }, { "dynabomb_player4.active.ypos", "11" }, { "dynabomb_player4.active.frames", "4" }, { "dynabomb_player4.active.delay", "6" }, - { "dynabomb_player4.active.mode_pingpong", "1" }, + { "dynabomb_player4.active.mode_pingpong", "true" }, { "dynabomb_nr", "RocksElements.pcx" }, { "dynabomb_nr.xpos", "12" }, { "dynabomb_nr.ypos", "11" }, @@ -2013,7 +2013,7 @@ struct ConfigInfo image_config[] = { "satellite.moving.ypos", "9" }, { "satellite.moving.frames", "8" }, { "satellite.moving.delay", "2" }, - { "satellite.moving.global_sync", "1" }, + { "satellite.moving.global_sync", "true" }, { "flames_left1", "RocksHeroes.pcx" }, { "flames_left1.xpos", "8" }, @@ -2443,22 +2443,22 @@ struct ConfigInfo image_config[] = { "explosion.ypos", "4" }, { "explosion.frames", "8" }, { "explosion.delay", "2" }, - { "explosion.mode_linear", "1" }, + { "explosion.mode_linear", "true" }, { "twinkle_blue", "RocksHeroes.pcx" }, { "twinkle_blue.xpos", "9" }, { "twinkle_blue.ypos", "11" }, { "twinkle_blue.frames", "3" }, { "twinkle_blue.delay", "2" }, - { "twinkle_blue.mode_pingpong", "1" }, - { "twinkle_blue.global_sync", "0" }, + { "twinkle_blue.mode_pingpong", "true" }, + { "twinkle_blue.global_sync", "false" }, { "twinkle_white", "RocksHeroes.pcx" }, { "twinkle_white.xpos", "13" }, { "twinkle_white.ypos", "11" }, { "twinkle_white.frames", "3" }, { "twinkle_white.delay", "2" }, - { "twinkle_white.mode_pingpong", "1" }, - { "twinkle_white.global_sync", "0" }, + { "twinkle_white.mode_pingpong", "true" }, + { "twinkle_white.global_sync", "false" }, { "steelwall_topleft", "RocksElements.pcx" }, { "steelwall_topleft.xpos", "0" }, diff --git a/src/conf_snd.c b/src/conf_snd.c index 642c96cf..c402cf8a 100644 --- a/src/conf_snd.c +++ b/src/conf_snd.c @@ -16,7 +16,9 @@ struct ConfigInfo sound_config_suffix[] = { - { NULL, NULL } + { ".mode_loop", "0", TYPE_BOOLEAN }, + + { NULL, NULL, 0 } }; struct ConfigInfo sound_config[] = diff --git a/src/conftime.h b/src/conftime.h index d8042ce7..cbe7bb3e 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-01-07 02:39]" +#define COMPILE_DATE_STRING "[2003-01-07 03:52]" diff --git a/src/libgame/misc.c b/src/libgame/misc.c index bde3ea63..7caaa3af 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -1234,6 +1234,63 @@ char getCharFromKey(Key key) } +/* ------------------------------------------------------------------------- */ +/* functions to translate string identifiers to integer or boolean value */ +/* ------------------------------------------------------------------------- */ + +int get_integer_from_string(char *s) +{ + static char *number_text[][3] = + { + { "0", "zero", "null", }, + { "1", "one", "first" }, + { "2", "two", "second" }, + { "3", "three", "third" }, + { "4", "four", "fourth" }, + { "5", "five", "fifth" }, + { "6", "six", "sixth" }, + { "7", "seven", "seventh" }, + { "8", "eight", "eighth" }, + { "9", "nine", "ninth" }, + { "10", "ten", "tenth" }, + { "11", "eleven", "eleventh" }, + { "12", "twelve", "twelfth" }, + }; + + int i, j; + char *s_lower = getStringToLower(s); + int result = -1; + + for (i=0; i<13; i++) + for (j=0; j<3; j++) + if (strcmp(s_lower, number_text[i][j]) == 0) + result = i; + + if (result == -1) + result = atoi(s); + + free(s_lower); + + return result; +} + +boolean get_boolean_from_string(char *s) +{ + char *s_lower = getStringToLower(s); + boolean result = FALSE; + + if (strcmp(s_lower, "true") == 0 || + strcmp(s_lower, "yes") == 0 || + strcmp(s_lower, "on") == 0 || + get_integer_from_string(s) == 1) + result = TRUE; + + free(s_lower); + + return result; +} + + /* ========================================================================= */ /* functions for generic lists */ /* ========================================================================= */ @@ -1369,6 +1426,13 @@ boolean FileIsArtworkType(char *basename, int type) /* functions for loading artwork configuration information */ /* ========================================================================= */ +static int get_parameter_value(int type, char *value) +{ + return (type == TYPE_INTEGER ? get_integer_from_string(value) : + type == TYPE_BOOLEAN ? get_boolean_from_string(value) : + -1); +} + struct FileInfo *getFileListFromConfigList(struct ConfigInfo *config_list, struct ConfigInfo *suffix_list, int num_file_list_entries) @@ -1400,7 +1464,8 @@ struct FileInfo *getFileListFromConfigList(struct ConfigInfo *config_list, for (j=0; j