From 548bc4ec64319d780a7bc38a6d0141bf526c7e16 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 24 Jan 2007 03:19:35 +0100 Subject: [PATCH] rnd-20070124-1-src --- src/conf_fnt.c | 16 ++++ src/conf_gfx.c | 92 ++++++++++++++---- src/conf_gfx.h | 144 ++++++++++++++-------------- src/conftime.h | 2 +- src/editor.c | 5 +- src/game.c | 219 ++++++++++++++++++++++++++++++++++++++----- src/game.h | 14 +++ src/libgame/setup.c | 48 ++++++++++ src/libgame/system.h | 17 ++++ src/main.c | 206 +++++++++++++++++++++------------------- src/main.h | 6 +- src/screens.c | 8 ++ 12 files changed, 563 insertions(+), 214 deletions(-) diff --git a/src/conf_fnt.c b/src/conf_fnt.c index 4cf2aa68..0940497f 100644 --- a/src/conf_fnt.c +++ b/src/conf_fnt.c @@ -87,6 +87,10 @@ font_to_graphic[] = FONT_TEXT_1_ACTIVE, GFX_SPECIAL_ARG_SCORES, IMG_FONT_TEXT_1_ACTIVE_SCORES }, + { + FONT_TEXT_1, GFX_SPECIAL_ARG_PLAYING, + IMG_FONT_TEXT_1_PLAYING + }, { FONT_TEXT_1, GFX_SPECIAL_ARG_DOOR, IMG_FONT_TEXT_1_DOOR @@ -215,6 +219,10 @@ font_to_graphic[] = FONT_LEVEL_NUMBER, -1, IMG_FONT_LEVEL_NUMBER }, + { + FONT_LEVEL_NUMBER_ACTIVE, -1, + IMG_FONT_LEVEL_NUMBER_ACTIVE + }, { FONT_TAPE_RECORDER, -1, IMG_FONT_TAPE_RECORDER @@ -223,6 +231,14 @@ font_to_graphic[] = FONT_GAME_INFO, -1, IMG_FONT_GAME_INFO }, + { + FONT_INFO_ELEMENTS, -1, + IMG_FONT_INFO_ELEMENTS + }, + { + FONT_INFO_LEVELSET, -1, + IMG_FONT_INFO_LEVELSET + }, { -1, -1, -1 diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 49f0f31c..dd669e0e 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -4684,6 +4684,8 @@ struct ConfigInfo image_config[] = { "font.text_1.active.SCORES.y", "0" }, { "font.text_1.active.SCORES.width", "16" }, { "font.text_1.active.SCORES.height", "32" }, + { "font.text_1.PLAYING", UNDEFINED_FILENAME }, + { "font.text_1.PLAYING.clone_from", "font.level_number" }, { "font.text_1.DOOR", UNDEFINED_FILENAME }, { "font.text_1.DOOR.clone_from", "font.level_number" }, { "font.text_2", "RocksFontSmall.pcx" }, @@ -4846,6 +4848,8 @@ struct ConfigInfo image_config[] = { "font.level_number.y", "350" }, { "font.level_number.width", "10" }, { "font.level_number.height", "14" }, + { "font.level_number.active", UNDEFINED_FILENAME }, + { "font.level_number.active.clone_from", "font.level_number" }, { "font.tape_recorder", "RocksFontSmall.pcx" }, { "font.tape_recorder.x", "0" }, @@ -4858,6 +4862,12 @@ struct ConfigInfo image_config[] = { "font.game_info.ypos", "0" }, { "font.game_info.delay", "10" }, + { "font.info.elements", UNDEFINED_FILENAME }, + { "font.info.elements.clone_from", "font.level_number" }, + + { "font.info.levelset", UNDEFINED_FILENAME }, + { "font.info.levelset.clone_from", "font.level_number" }, + { "global.border", "RocksScreen.pcx" }, { "global.door", "RocksDoor.pcx" }, @@ -5105,32 +5115,52 @@ struct ConfigInfo image_config[] = { "door_2.step_delay", "10" }, { "door_2.anim_mode", "default" }, +#if 1 + { "game.panel.level.x", "51" }, + { "game.panel.level.y", "20" }, + { "game.panel.level.align", "center" }, + { "game.panel.level.digits", "-1" }, + { "game.panel.gems.x", "50" }, + { "game.panel.gems.y", "54" }, + { "game.panel.gems.align", "center" }, + { "game.panel.gems.digits", "3" }, + { "game.panel.inventory.x", "50" }, + { "game.panel.inventory.y", "89" }, + { "game.panel.inventory.align", "center" }, + { "game.panel.inventory.digits", "3" }, + { "game.panel.keys.x", "18" }, + { "game.panel.keys.y", "123" }, + { "game.panel.score.x", "50" }, + { "game.panel.score.y", "159" }, + { "game.panel.score.align", "center" }, + { "game.panel.score.digits", "5" }, + { "game.panel.time.x", "50" }, + { "game.panel.time.y", "194" }, + { "game.panel.time.align", "center" }, + { "game.panel.time.digits", "-1" }, +#else { "game.panel.level.x", "37" }, { "game.panel.level.y", "20" }, -#if 0 - { "game.panel.level.digits", "2" }, -#endif + { "game.panel.level.align", "left" }, + { "game.panel.level.digits", "-1" }, { "game.panel.gems.x", "29" }, { "game.panel.gems.y", "54" }, -#if 0 - { "game.panel.gems.digits", "3" }, -#endif + { "game.panel.gems.align", "left" }, + { "game.panel.gems.digits", "-1" }, { "game.panel.inventory.x", "29" }, { "game.panel.inventory.y", "89" }, -#if 0 - { "game.panel.inventory.digits", "3" }, -#endif + { "game.panel.inventory.align", "left" }, + { "game.panel.inventory.digits", "-1" }, { "game.panel.keys.x", "18" }, { "game.panel.keys.y", "123" }, { "game.panel.score.x", "15" }, { "game.panel.score.y", "159" }, -#if 0 - { "game.panel.score.digits", "5" }, -#endif + { "game.panel.score.align", "left" }, + { "game.panel.score.digits", "-1" }, { "game.panel.time.x", "29" }, { "game.panel.time.y", "194" }, -#if 0 - { "game.panel.time.digits", "3" }, + { "game.panel.time.align", "left" }, + { "game.panel.time.digits", "-1" }, #endif #if 0 @@ -5138,10 +5168,16 @@ struct ConfigInfo image_config[] = { "game.panel.time_hh.x", "-1" }, { "game.panel.time_hh.y", "-1" }, + { "game.panel.time_hh.align", "left" }, + { "game.panel.time_hh.digits", "-1" }, { "game.panel.time_mm.x", "-1" }, { "game.panel.time_mm.y", "-1" }, + { "game.panel.time_mm.align", "left" }, + { "game.panel.time_mm.digits", "-1" }, { "game.panel.time_ss.x", "-1" }, { "game.panel.time_ss.y", "-1" }, + { "game.panel.time_ss.align", "left" }, + { "game.panel.time_ss.digits", "-1" }, { "game.panel.drop_next_1.x", "-1" }, { "game.panel.drop_next_1.y", "-1" }, @@ -5179,18 +5215,21 @@ struct ConfigInfo image_config[] = { "game.panel.key_white.y", "-1" }, { "game.panel.num_white_keys.x", "-1" }, { "game.panel.num_white_keys.y", "-1" }, + { "game.panel.num_white_keys.align", "left" }, { "game.panel.num_white_keys.digits", "-1" }, { "game.panel.shield_normal.x", "-1" }, { "game.panel.shield_normal.y", "-1" }, { "game.panel.shield_normal_time.x", "-1" }, - { "game.panel.shield_normal.time.y", "-1" }, - { "game.panel.shield_normal.time.digits", "-1" }, + { "game.panel.shield_normal_time.y", "-1" }, + { "game.panel.shield_normal_time.align", "left" }, + { "game.panel.shield_normal_time.digits", "-1" }, { "game.panel.shield_deadly.x", "-1" }, { "game.panel.shield_deadly.y", "-1" }, { "game.panel.shield_deadly_time.x", "-1" }, - { "game.panel.shield_deadly.time.y", "-1" }, - { "game.panel.shield_deadly.time.digits", "-1" }, + { "game.panel.shield_deadly_time.y", "-1" }, + { "game.panel.shield_deadly_time.align", "left" }, + { "game.panel.shield_deadly_time.digits", "-1" }, { "game.panel.exit.x", "-1" }, { "game.panel.exit.y", "-1" }, @@ -5207,18 +5246,21 @@ struct ConfigInfo image_config[] = { "game.panel.emc_magic_ball.y", "-1" }, { "game.panel.emc_magic_ball_time.x", "-1" }, { "game.panel.emc_magic_ball_time.y", "-1" }, + { "game.panel.emc_magic_ball_time.align", "left" }, { "game.panel.emc_magic_ball_time.digits", "-1" }, { "game.panel.light_switch.x", "-1" }, { "game.panel.light_switch.y", "-1" }, { "game.panel.light_switch_time.x", "-1" }, { "game.panel.light_switch_time.y", "-1" }, + { "game.panel.light_switch_time.align", "left" }, { "game.panel.light_switch_time.digits", "-1" }, { "game.panel.timegate_switch.x", "-1" }, { "game.panel.timegate_switch.y", "-1" }, { "game.panel.timegate_switch_time.x", "-1" }, { "game.panel.timegate_switch_time.y", "-1" }, + { "game.panel.timegate_switch_time.align", "left" }, { "game.panel.timegate_switch_time.digits", "-1" }, { "game.panel.switchgate_switch.x", "-1" }, @@ -5228,12 +5270,14 @@ struct ConfigInfo image_config[] = { "game.panel.emc_lenses.y", "-1" }, { "game.panel.emc_lenses_time.x", "-1" }, { "game.panel.emc_lenses_time.y", "-1" }, + { "game.panel.emc_lenses_time.align", "left" }, { "game.panel.emc_lenses_time.digits", "-1" }, { "game.panel.emc_magnifier.x", "-1" }, { "game.panel.emc_magnifier.y", "-1" }, { "game.panel.emc_magnifier_time.x", "-1" }, { "game.panel.emc_magnifier_time.y", "-1" }, + { "game.panel.emc_magnifier_time.align", "left" }, { "game.panel.emc_magnifier_time.digits", "-1" }, { "game.panel.balloon_switch.x", "-1" }, @@ -5241,22 +5285,27 @@ struct ConfigInfo image_config[] = { "game.panel.dynabomb_number.x", "-1" }, { "game.panel.dynabomb_number.y", "-1" }, + { "game.panel.dynabomb_number.align", "left" }, { "game.panel.dynabomb_number.digits", "-1" }, { "game.panel.dynabomb_size.x", "-1" }, { "game.panel.dynabomb_size.y", "-1" }, + { "game.panel.dynabomb_size.align", "left" }, { "game.panel.dynabomb_size.digits", "-1" }, { "game.panel.dynabomb_power.x", "-1" }, { "game.panel.dynabomb_power.y", "-1" }, { "game.panel.penguins.x", "-1" }, { "game.panel.penguins.y", "-1" }, + { "game.panel.penguins.align", "left" }, { "game.panel.penguins.digits", "-1" }, { "game.panel.sokoban_objects.x", "-1" }, { "game.panel.sokoban_objects.y", "-1" }, + { "game.panel.sokoban_objects.align", "left" }, { "game.panel.sokoban_objects.digits", "-1" }, { "game.panel.sokoban_fields.x", "-1" }, { "game.panel.sokoban_fields.y", "-1" }, + { "game.panel.sokoban_fields.align", "left" }, { "game.panel.sokoban_fields.digits", "-1" }, { "game.panel.robot_wheel.x", "-1" }, @@ -5283,6 +5332,7 @@ struct ConfigInfo image_config[] = { "game.panel.magic_wall.y", "-1" }, { "game.panel.magic_wall_time.x", "-1" }, { "game.panel.magic_wall_time.y", "-1" }, + { "game.panel.magic_wall_time.align", "left" }, { "game.panel.magic_wall_time.digits", "-1" }, { "game.panel.bd_magic_wall.x", "-1" }, { "game.panel.bd_magic_wall.y", "-1" }, @@ -5291,11 +5341,17 @@ struct ConfigInfo image_config[] = { "game.panel.player_name.x", "-1" }, { "game.panel.player_name.y", "-1" }, + { "game.panel.player_name.align", "left" }, + { "game.panel.player_name.chars", "-1" }, { "game.panel.level_name.x", "-1" }, { "game.panel.level_name.y", "-1" }, + { "game.panel.level_name.align", "left" }, + { "game.panel.level_name.chars", "-1" }, { "game.panel.level_author.x", "-1" }, { "game.panel.level_author.y", "-1" }, + { "game.panel.level_author.align", "left" }, + { "game.panel.level_author.chars", "-1" }, { "game.panel.stop.x", "-1" }, { "game.panel.stop.y", "-1" }, diff --git a/src/conf_gfx.h b/src/conf_gfx.h index e68db86c..4ed38dbb 100644 --- a/src/conf_gfx.h +++ b/src/conf_gfx.h @@ -1683,76 +1683,80 @@ #define IMG_FONT_TEXT_1_PREVIEW 1662 #define IMG_FONT_TEXT_1_SCORES 1663 #define IMG_FONT_TEXT_1_ACTIVE_SCORES 1664 -#define IMG_FONT_TEXT_1_DOOR 1665 -#define IMG_FONT_TEXT_2 1666 -#define IMG_FONT_TEXT_2_LEVELS 1667 -#define IMG_FONT_TEXT_2_PREVIEW 1668 -#define IMG_FONT_TEXT_2_SCORES 1669 -#define IMG_FONT_TEXT_2_ACTIVE_SCORES 1670 -#define IMG_FONT_TEXT_3 1671 -#define IMG_FONT_TEXT_3_LEVELS 1672 -#define IMG_FONT_TEXT_3_PREVIEW 1673 -#define IMG_FONT_TEXT_3_SCORES 1674 -#define IMG_FONT_TEXT_3_ACTIVE_SCORES 1675 -#define IMG_FONT_TEXT_4 1676 -#define IMG_FONT_TEXT_4_LEVELS 1677 -#define IMG_FONT_TEXT_4_SCORES 1678 -#define IMG_FONT_TEXT_4_ACTIVE_SCORES 1679 -#define IMG_FONT_ENVELOPE_1 1680 -#define IMG_FONT_ENVELOPE_2 1681 -#define IMG_FONT_ENVELOPE_3 1682 -#define IMG_FONT_ENVELOPE_4 1683 -#define IMG_FONT_INPUT_1 1684 -#define IMG_FONT_INPUT_1_MAIN 1685 -#define IMG_FONT_INPUT_1_ACTIVE 1686 -#define IMG_FONT_INPUT_1_ACTIVE_MAIN 1687 -#define IMG_FONT_INPUT_1_ACTIVE_SETUP 1688 -#define IMG_FONT_INPUT_2 1689 -#define IMG_FONT_INPUT_2_ACTIVE 1690 -#define IMG_FONT_OPTION_OFF 1691 -#define IMG_FONT_OPTION_ON 1692 -#define IMG_FONT_VALUE_1 1693 -#define IMG_FONT_VALUE_2 1694 -#define IMG_FONT_VALUE_OLD 1695 -#define IMG_FONT_LEVEL_NUMBER 1696 -#define IMG_FONT_TAPE_RECORDER 1697 -#define IMG_FONT_GAME_INFO 1698 -#define IMG_GLOBAL_BORDER 1699 -#define IMG_GLOBAL_DOOR 1700 -#define IMG_EDITOR_ELEMENT_BORDER 1701 -#define IMG_EDITOR_ELEMENT_BORDER_INPUT 1702 -#define IMG_EDITOR_CASCADE_LIST 1703 -#define IMG_EDITOR_CASCADE_LIST_ACTIVE 1704 -#define IMG_BACKGROUND_ENVELOPE_1 1705 -#define IMG_BACKGROUND_ENVELOPE_2 1706 -#define IMG_BACKGROUND_ENVELOPE_3 1707 -#define IMG_BACKGROUND_ENVELOPE_4 1708 -#define IMG_BACKGROUND 1709 -#define IMG_BACKGROUND_TITLE 1710 -#define IMG_BACKGROUND_MESSAGE 1711 -#define IMG_BACKGROUND_MAIN 1712 -#define IMG_BACKGROUND_LEVELS 1713 -#define IMG_BACKGROUND_SCORES 1714 -#define IMG_BACKGROUND_EDITOR 1715 -#define IMG_BACKGROUND_INFO 1716 -#define IMG_BACKGROUND_INFO_ELEMENTS 1717 -#define IMG_BACKGROUND_INFO_MUSIC 1718 -#define IMG_BACKGROUND_INFO_CREDITS 1719 -#define IMG_BACKGROUND_INFO_PROGRAM 1720 -#define IMG_BACKGROUND_INFO_LEVELSET 1721 -#define IMG_BACKGROUND_SETUP 1722 -#define IMG_BACKGROUND_DOOR 1723 -#define IMG_TITLESCREEN_INITIAL_1 1724 -#define IMG_TITLESCREEN_INITIAL_2 1725 -#define IMG_TITLESCREEN_INITIAL_3 1726 -#define IMG_TITLESCREEN_INITIAL_4 1727 -#define IMG_TITLESCREEN_INITIAL_5 1728 -#define IMG_TITLESCREEN_1 1729 -#define IMG_TITLESCREEN_2 1730 -#define IMG_TITLESCREEN_3 1731 -#define IMG_TITLESCREEN_4 1732 -#define IMG_TITLESCREEN_5 1733 +#define IMG_FONT_TEXT_1_PLAYING 1665 +#define IMG_FONT_TEXT_1_DOOR 1666 +#define IMG_FONT_TEXT_2 1667 +#define IMG_FONT_TEXT_2_LEVELS 1668 +#define IMG_FONT_TEXT_2_PREVIEW 1669 +#define IMG_FONT_TEXT_2_SCORES 1670 +#define IMG_FONT_TEXT_2_ACTIVE_SCORES 1671 +#define IMG_FONT_TEXT_3 1672 +#define IMG_FONT_TEXT_3_LEVELS 1673 +#define IMG_FONT_TEXT_3_PREVIEW 1674 +#define IMG_FONT_TEXT_3_SCORES 1675 +#define IMG_FONT_TEXT_3_ACTIVE_SCORES 1676 +#define IMG_FONT_TEXT_4 1677 +#define IMG_FONT_TEXT_4_LEVELS 1678 +#define IMG_FONT_TEXT_4_SCORES 1679 +#define IMG_FONT_TEXT_4_ACTIVE_SCORES 1680 +#define IMG_FONT_ENVELOPE_1 1681 +#define IMG_FONT_ENVELOPE_2 1682 +#define IMG_FONT_ENVELOPE_3 1683 +#define IMG_FONT_ENVELOPE_4 1684 +#define IMG_FONT_INPUT_1 1685 +#define IMG_FONT_INPUT_1_MAIN 1686 +#define IMG_FONT_INPUT_1_ACTIVE 1687 +#define IMG_FONT_INPUT_1_ACTIVE_MAIN 1688 +#define IMG_FONT_INPUT_1_ACTIVE_SETUP 1689 +#define IMG_FONT_INPUT_2 1690 +#define IMG_FONT_INPUT_2_ACTIVE 1691 +#define IMG_FONT_OPTION_OFF 1692 +#define IMG_FONT_OPTION_ON 1693 +#define IMG_FONT_VALUE_1 1694 +#define IMG_FONT_VALUE_2 1695 +#define IMG_FONT_VALUE_OLD 1696 +#define IMG_FONT_LEVEL_NUMBER 1697 +#define IMG_FONT_LEVEL_NUMBER_ACTIVE 1698 +#define IMG_FONT_TAPE_RECORDER 1699 +#define IMG_FONT_GAME_INFO 1700 +#define IMG_FONT_INFO_ELEMENTS 1701 +#define IMG_FONT_INFO_LEVELSET 1702 +#define IMG_GLOBAL_BORDER 1703 +#define IMG_GLOBAL_DOOR 1704 +#define IMG_EDITOR_ELEMENT_BORDER 1705 +#define IMG_EDITOR_ELEMENT_BORDER_INPUT 1706 +#define IMG_EDITOR_CASCADE_LIST 1707 +#define IMG_EDITOR_CASCADE_LIST_ACTIVE 1708 +#define IMG_BACKGROUND_ENVELOPE_1 1709 +#define IMG_BACKGROUND_ENVELOPE_2 1710 +#define IMG_BACKGROUND_ENVELOPE_3 1711 +#define IMG_BACKGROUND_ENVELOPE_4 1712 +#define IMG_BACKGROUND 1713 +#define IMG_BACKGROUND_TITLE 1714 +#define IMG_BACKGROUND_MESSAGE 1715 +#define IMG_BACKGROUND_MAIN 1716 +#define IMG_BACKGROUND_LEVELS 1717 +#define IMG_BACKGROUND_SCORES 1718 +#define IMG_BACKGROUND_EDITOR 1719 +#define IMG_BACKGROUND_INFO 1720 +#define IMG_BACKGROUND_INFO_ELEMENTS 1721 +#define IMG_BACKGROUND_INFO_MUSIC 1722 +#define IMG_BACKGROUND_INFO_CREDITS 1723 +#define IMG_BACKGROUND_INFO_PROGRAM 1724 +#define IMG_BACKGROUND_INFO_LEVELSET 1725 +#define IMG_BACKGROUND_SETUP 1726 +#define IMG_BACKGROUND_DOOR 1727 +#define IMG_TITLESCREEN_INITIAL_1 1728 +#define IMG_TITLESCREEN_INITIAL_2 1729 +#define IMG_TITLESCREEN_INITIAL_3 1730 +#define IMG_TITLESCREEN_INITIAL_4 1731 +#define IMG_TITLESCREEN_INITIAL_5 1732 +#define IMG_TITLESCREEN_1 1733 +#define IMG_TITLESCREEN_2 1734 +#define IMG_TITLESCREEN_3 1735 +#define IMG_TITLESCREEN_4 1736 +#define IMG_TITLESCREEN_5 1737 -#define NUM_IMAGE_FILES 1734 +#define NUM_IMAGE_FILES 1738 #endif /* CONF_GFX_H */ diff --git a/src/conftime.h b/src/conftime.h index c2aeb998..3eeebb95 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2007-01-23 21:36]" +#define COMPILE_DATE_STRING "[2007-01-24 03:14]" diff --git a/src/editor.c b/src/editor.c index 72ceb0d3..c4adb46d 100644 --- a/src/editor.c +++ b/src/editor.c @@ -5323,8 +5323,11 @@ static void CreateCounterButtons() if (i == ED_COUNTER_ID_SELECT_LEVEL) { font_type = FONT_LEVEL_NUMBER; +#if 1 + font_type_active = FONT_LEVEL_NUMBER_ACTIVE; +#else font_type_active = FONT_LEVEL_NUMBER; - +#endif x += 2 * ED_GADGET_DISTANCE; y -= ED_GADGET_DISTANCE; diff --git a/src/game.c b/src/game.c index be311d80..62ed8bbb 100644 --- a/src/game.c +++ b/src/game.c @@ -86,26 +86,31 @@ #define EX_TYPE_SINGLE_TILE (EX_TYPE_CENTER | EX_TYPE_BORDER) #define PANEL_DEACTIVATED(p) ((p).x < 0 || (p).y < 0) +#define PANEL_XPOS(p) (ALIGNED_XPOS((p).x, (p).width, (p).align)) +#define PANEL_YPOS(p) ((p).y) /* special positions in the game control window (relative to control window) */ -#define XX_LEVEL1 (game.panel.level.x) -#define XX_LEVEL2 (game.panel.level.x - 1) -#define YY_LEVEL (game.panel.level.y) -#define XX_EMERALDS (game.panel.gems.x) -#define YY_EMERALDS (game.panel.gems.y) -#define XX_DYNAMITE (game.panel.inventory.x) -#define YY_DYNAMITE (game.panel.inventory.y) -#define XX_KEYS (game.panel.keys.x) -#define YY_KEYS (game.panel.keys.y) -#define XX_SCORE (game.panel.score.x) -#define YY_SCORE (game.panel.score.y) -#define XX_TIME1 (game.panel.time.x) -#define XX_TIME2 (game.panel.time.x + 1) -#define YY_TIME (game.panel.time.y) +#define XX_LEVEL1 (PANEL_XPOS(game.panel.level)) +#define XX_LEVEL2 (PANEL_XPOS(game.panel.level) - 1) +#define XX_LEVEL (PANEL_XPOS(game.panel.level)) +#define YY_LEVEL (PANEL_YPOS(game.panel.level)) +#define XX_EMERALDS (PANEL_XPOS(game.panel.gems)) +#define YY_EMERALDS (PANEL_YPOS(game.panel.gems)) +#define XX_DYNAMITE (PANEL_XPOS(game.panel.inventory)) +#define YY_DYNAMITE (PANEL_YPOS(game.panel.inventory)) +#define XX_KEYS (PANEL_XPOS(game.panel.keys)) +#define YY_KEYS (PANEL_YPOS(game.panel.keys)) +#define XX_SCORE (PANEL_XPOS(game.panel.score)) +#define YY_SCORE (PANEL_YPOS(game.panel.score)) +#define XX_TIME1 (PANEL_XPOS(game.panel.time)) +#define XX_TIME2 (PANEL_XPOS(game.panel.time) + 1) +#define XX_TIME (PANEL_XPOS(game.panel.time)) +#define YY_TIME (PANEL_YPOS(game.panel.time)) /* special positions in the game control window (relative to main window) */ #define DX_LEVEL1 (DX + XX_LEVEL1) #define DX_LEVEL2 (DX + XX_LEVEL2) +#define DX_LEVEL (DX + XX_LEVEL) #define DY_LEVEL (DY + YY_LEVEL) #define DX_EMERALDS (DX + XX_EMERALDS) #define DY_EMERALDS (DY + YY_EMERALDS) @@ -117,6 +122,7 @@ #define DY_SCORE (DY + YY_SCORE) #define DX_TIME1 (DX + XX_TIME1) #define DX_TIME2 (DX + XX_TIME2) +#define DX_TIME (DX + XX_TIME) #define DY_TIME (DY + YY_TIME) /* values for delayed check of falling and moving elements and for collision */ @@ -1317,24 +1323,169 @@ static inline void InitField_WithBug2(int x, int y, boolean init_game) */ } +#if 1 + +inline void DrawGameValue_Emeralds(int value) +{ + int font_nr = FONT_TEXT_2; + int font_width = getFontWidth(font_nr); + int xpos = (3 * 14 - 3 * font_width) / 2; + + if (PANEL_DEACTIVATED(game.panel.gems)) + return; + + game.panel.gems.width = game.panel.gems.chars * font_width; + xpos = 0; + + DrawText(DX_EMERALDS + xpos, DY_EMERALDS, int2str(value, 3), font_nr); +} + +inline void DrawGameValue_Dynamite(int value) +{ + int font_nr = FONT_TEXT_2; + int font_width = getFontWidth(font_nr); + int xpos = (3 * 14 - 3 * font_width) / 2; + + if (PANEL_DEACTIVATED(game.panel.inventory)) + return; + + game.panel.inventory.width = game.panel.inventory.chars * font_width; + xpos = 0; + + DrawText(DX_DYNAMITE + xpos, DY_DYNAMITE, int2str(value, 3), font_nr); +} + +inline void DrawGameValue_Keys(int key[MAX_NUM_KEYS]) +{ + int base_key_graphic = EL_KEY_1; + int i; + + if (PANEL_DEACTIVATED(game.panel.keys)) + return; + + if (level.game_engine_type == GAME_ENGINE_TYPE_EM) + base_key_graphic = EL_EM_KEY_1; + + /* currently only 4 of 8 possible keys are displayed */ + for (i = 0; i < STD_NUM_KEYS; i++) + { + int x = XX_KEYS + i * MINI_TILEX; + int y = YY_KEYS; + + if (key[i]) + DrawMiniGraphicExt(drawto, DX + x,DY + y, el2edimg(base_key_graphic + i)); + else + BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto, + DOOR_GFX_PAGEX5 + x, y, MINI_TILEX, MINI_TILEY, DX + x,DY + y); + } +} + +inline void DrawGameValue_Score(int value) +{ + int font_nr = FONT_TEXT_2; + int font_width = getFontWidth(font_nr); + int xpos = (5 * 14 - 5 * font_width) / 2; + + if (PANEL_DEACTIVATED(game.panel.score)) + return; + + game.panel.score.width = game.panel.score.chars * font_width; + xpos = 0; + + DrawText(DX_SCORE + xpos, DY_SCORE, int2str(value, 5), font_nr); +} + +inline void DrawGameValue_Time(int value) +{ + static int last_value = -1; + int num_digits1 = 3; + int num_digits2 = 4; + int num_digits = game.panel.time.chars; + int font1_nr = FONT_TEXT_2; + int font2_nr = FONT_TEXT_1; + int font_nr = font1_nr; + int font1_width = getFontWidth(font1_nr); + int font2_width = getFontWidth(font2_nr); + int xpos3 = (3 * 14 - 3 * font1_width) / 2; + int xpos4 = (4 * 10 - 4 * font2_width) / 2; + + if (PANEL_DEACTIVATED(game.panel.time)) + return; + + if (num_digits == -1) /* use dynamic number of digits */ + { + num_digits = (value < 1000 ? num_digits1 : num_digits2); + font_nr = (value < 1000 ? font1_nr : font2_nr); + } + + xpos3 = 0; + xpos4 = 0; + + /* clear background if value just changed its size (dynamic digits only) */ + if (game.panel.time.chars == -1 && (last_value < 1000) != (value < 1000)) + { + int width1 = num_digits1 * getFontWidth(font1_nr); + int width2 = num_digits2 * getFontWidth(font2_nr); + int max_width = MAX(width1, width2); + int max_height = MAX(getFontHeight(font1_nr), getFontHeight(font2_nr)); + + game.panel.time.width = max_width; + + ClearRectangleOnBackground(drawto, DX_TIME, DY_TIME, max_width, max_height); + } + + game.panel.time.width = num_digits * getFontWidth(font_nr); + + DrawText(DX_TIME, DY_TIME, int2str(value, num_digits), font_nr); + + last_value = value; +} + +inline void DrawGameValue_Level(int value) +{ + int num_digits1 = 2; + int num_digits2 = 3; + int num_digits = game.panel.level.chars; + int font1_nr = FONT_TEXT_2; + int font2_nr = FONT_TEXT_1; + int font_nr = font1_nr; + + if (PANEL_DEACTIVATED(game.panel.level)) + return; + + if (num_digits == -1) /* use dynamic number of digits */ + { + num_digits = (level_nr < 100 ? num_digits1 : num_digits2); + font_nr = (level_nr < 100 ? font1_nr : font2_nr); + } + + game.panel.level.width = num_digits * getFontWidth(font_nr); + + DrawText(DX_LEVEL, DY_LEVEL, int2str(value, num_digits), font_nr); +} + +#else + inline void DrawGameValue_Emeralds(int value) { - int xpos = (3 * 14 - 3 * getFontWidth(FONT_TEXT_2)) / 2; + int font_nr = FONT_TEXT_2; + int xpos = (3 * 14 - 3 * getFontWidth(font_nr)) / 2; if (PANEL_DEACTIVATED(game.panel.gems)) return; - DrawText(DX_EMERALDS + xpos, DY_EMERALDS, int2str(value, 3), FONT_TEXT_2); + DrawText(DX_EMERALDS + xpos, DY_EMERALDS, int2str(value, 3), font_nr); } inline void DrawGameValue_Dynamite(int value) { - int xpos = (3 * 14 - 3 * getFontWidth(FONT_TEXT_2)) / 2; + int font_nr = FONT_TEXT_2; + int xpos = (3 * 14 - 3 * getFontWidth(font_nr)) / 2; if (PANEL_DEACTIVATED(game.panel.inventory)) return; - DrawText(DX_DYNAMITE + xpos, DY_DYNAMITE, int2str(value, 3), FONT_TEXT_2); + DrawText(DX_DYNAMITE + xpos, DY_DYNAMITE, int2str(value, 3), font_nr); } inline void DrawGameValue_Keys(int key[MAX_NUM_KEYS]) @@ -1364,18 +1515,25 @@ inline void DrawGameValue_Keys(int key[MAX_NUM_KEYS]) inline void DrawGameValue_Score(int value) { - int xpos = (5 * 14 - 5 * getFontWidth(FONT_TEXT_2)) / 2; + int font_nr = FONT_TEXT_2; + int xpos = (5 * 14 - 5 * getFontWidth(font_nr)) / 2; if (PANEL_DEACTIVATED(game.panel.score)) return; - DrawText(DX_SCORE + xpos, DY_SCORE, int2str(value, 5), FONT_TEXT_2); + DrawText(DX_SCORE + xpos, DY_SCORE, int2str(value, 5), font_nr); } inline void DrawGameValue_Time(int value) { - int xpos3 = (3 * 14 - 3 * getFontWidth(FONT_TEXT_2)) / 2; - int xpos4 = (4 * 10 - 4 * getFontWidth(FONT_LEVEL_NUMBER)) / 2; + int font1_nr = FONT_TEXT_2; +#if 1 + int font2_nr = FONT_TEXT_1; +#else + int font2_nr = FONT_LEVEL_NUMBER; +#endif + int xpos3 = (3 * 14 - 3 * getFontWidth(font1_nr)) / 2; + int xpos4 = (4 * 10 - 4 * getFontWidth(font2_nr)) / 2; if (PANEL_DEACTIVATED(game.panel.time)) return; @@ -1385,22 +1543,31 @@ inline void DrawGameValue_Time(int value) ClearRectangleOnBackground(drawto, DX_TIME1, DY_TIME, 14 * 3, 14); if (value < 1000) - DrawText(DX_TIME1 + xpos3, DY_TIME, int2str(value, 3), FONT_TEXT_2); + DrawText(DX_TIME1 + xpos3, DY_TIME, int2str(value, 3), font1_nr); else - DrawText(DX_TIME2 + xpos4, DY_TIME, int2str(value, 4), FONT_LEVEL_NUMBER); + DrawText(DX_TIME2 + xpos4, DY_TIME, int2str(value, 4), font2_nr); } inline void DrawGameValue_Level(int value) { + int font1_nr = FONT_TEXT_2; +#if 1 + int font2_nr = FONT_TEXT_1; +#else + int font2_nr = FONT_LEVEL_NUMBER; +#endif + if (PANEL_DEACTIVATED(game.panel.level)) return; if (level_nr < 100) - DrawText(DX_LEVEL1, DY_LEVEL, int2str(value, 2), FONT_TEXT_2); + DrawText(DX_LEVEL1, DY_LEVEL, int2str(value, 2), font1_nr); else - DrawText(DX_LEVEL2, DY_LEVEL, int2str(value, 3), FONT_LEVEL_NUMBER); + DrawText(DX_LEVEL2, DY_LEVEL, int2str(value, 3), font2_nr); } +#endif + void DrawAllGameValues(int emeralds, int dynamite, int score, int time, int key_bits) { diff --git a/src/game.h b/src/game.h index 3ede4532..e7c7d89c 100644 --- a/src/game.h +++ b/src/game.h @@ -14,12 +14,25 @@ #ifndef GAME_H #define GAME_H +/* (not included here due to collisions with Emerald Mine engine definitions) */ +/* #include "main.h" */ #define MAX_INVENTORY_SIZE 1000 #define STD_NUM_KEYS 4 #define MAX_NUM_KEYS 8 +#if 1 +struct GamePanelInfo +{ + struct TextPosInfo level; + struct TextPosInfo gems; + struct TextPosInfo inventory; + struct TextPosInfo keys; + struct TextPosInfo score; + struct TextPosInfo time; +}; +#else struct GamePanelInfo { struct XY level; @@ -29,6 +42,7 @@ struct GamePanelInfo struct XY score; struct XY time; }; +#endif struct GameInfo { diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 496b867b..114087ac 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -1625,6 +1625,10 @@ static void *loadSetupFileData(char *filename, boolean use_hash) char *token, *value, *line_ptr; void *setup_file_data, *insert_ptr = NULL; boolean read_continued_line = FALSE; + boolean token_value_separator_found; +#if 1 + boolean token_value_separator_warning = FALSE; +#endif FILE *file; if (!(file = fopen(filename, MODE_READ))) @@ -1704,6 +1708,8 @@ static void *loadSetupFileData(char *filename, boolean use_hash) /* start with empty value as reliable default */ value = ""; + token_value_separator_found = FALSE; + /* find end of token to determine start of value */ for (line_ptr = token; *line_ptr; line_ptr++) { @@ -1716,10 +1722,47 @@ static void *loadSetupFileData(char *filename, boolean use_hash) *line_ptr = '\0'; /* terminate token string */ value = line_ptr + 1; /* set beginning of value */ + token_value_separator_found = TRUE; + break; } } +#if 1 + /* fallback: if no token/value separator found, also allow whitespaces */ + if (!token_value_separator_found) + { + for (line_ptr = token; *line_ptr; line_ptr++) + { + if (*line_ptr == ' ' || *line_ptr == '\t') + { + *line_ptr = '\0'; /* terminate token string */ + value = line_ptr + 1; /* set beginning of value */ + + token_value_separator_found = TRUE; + + break; + } + } + +#if 1 + if (token_value_separator_found) + { + if (!token_value_separator_warning) + { + Error(ERR_RETURN_LINE, "-"); + Error(ERR_WARN, "no valid token/value separator in config file:"); + Error(ERR_RETURN, "- config file: '%s'", filename); + + token_value_separator_warning = TRUE; + } + + Error(ERR_RETURN, "- no separator in line: '%s'", line); + } +#endif + } +#endif + /* cut trailing whitespaces from token */ for (line_ptr = &token[strlen(token)]; line_ptr >= token; line_ptr--) if ((*line_ptr == ' ' || *line_ptr == '\t') && *(line_ptr + 1) == '\0') @@ -1746,6 +1789,11 @@ static void *loadSetupFileData(char *filename, boolean use_hash) fclose(file); +#if 1 + if (token_value_separator_warning) + Error(ERR_RETURN_LINE, "-"); +#endif + if (use_hash) { if (hashtable_count((SetupFileHash *)setup_file_data) == 0) diff --git a/src/libgame/system.h b/src/libgame/system.h index 0f6f0656..9d3e578a 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1008,6 +1008,23 @@ struct Rect int width, height; }; +#if 1 +struct MenuPosInfo +{ + int x, y; + int width, height; + int align; +}; + +struct TextPosInfo +{ + int x, y; + int width, height; + int align; + int chars; +}; +#endif + /* ========================================================================= */ /* exported variables */ diff --git a/src/main.c b/src/main.c index 5abc0ae1..8e83997f 100644 --- a/src/main.c +++ b/src/main.c @@ -5442,68 +5442,68 @@ struct TokenIntPtrInfo image_config_vars[] = { "menu.list_size.SCORES", &menu.list_size[GFX_SPECIAL_ARG_SCORES] }, { "menu.list_size.INFO", &menu.list_size[GFX_SPECIAL_ARG_INFO] }, - { "main.button.name.x", &menu.main.button.name.x }, - { "main.button.name.y", &menu.main.button.name.y }, - { "main.button.levels.x", &menu.main.button.levels.x }, - { "main.button.levels.y", &menu.main.button.levels.y }, - { "main.button.scores.x", &menu.main.button.scores.x }, - { "main.button.scores.y", &menu.main.button.scores.y }, - { "main.button.editor.x", &menu.main.button.editor.x }, - { "main.button.editor.y", &menu.main.button.editor.y }, - { "main.button.info.x", &menu.main.button.info.x }, - { "main.button.info.y", &menu.main.button.info.y }, - { "main.button.game.x", &menu.main.button.game.x }, - { "main.button.game.y", &menu.main.button.game.y }, - { "main.button.setup.x", &menu.main.button.setup.x }, - { "main.button.setup.y", &menu.main.button.setup.y }, - { "main.button.quit.x", &menu.main.button.quit.x }, - { "main.button.quit.y", &menu.main.button.quit.y }, + { "main.button.name.x", &menu.main.button.name.x }, + { "main.button.name.y", &menu.main.button.name.y }, + { "main.button.levels.x", &menu.main.button.levels.x }, + { "main.button.levels.y", &menu.main.button.levels.y }, + { "main.button.scores.x", &menu.main.button.scores.x }, + { "main.button.scores.y", &menu.main.button.scores.y }, + { "main.button.editor.x", &menu.main.button.editor.x }, + { "main.button.editor.y", &menu.main.button.editor.y }, + { "main.button.info.x", &menu.main.button.info.x }, + { "main.button.info.y", &menu.main.button.info.y }, + { "main.button.game.x", &menu.main.button.game.x }, + { "main.button.game.y", &menu.main.button.game.y }, + { "main.button.setup.x", &menu.main.button.setup.x }, + { "main.button.setup.y", &menu.main.button.setup.y }, + { "main.button.quit.x", &menu.main.button.quit.x }, + { "main.button.quit.y", &menu.main.button.quit.y }, - { "main.button.prev_level.x", &menu.main.button.prev_level.x }, - { "main.button.prev_level.y", &menu.main.button.prev_level.y }, - { "main.button.next_level.x", &menu.main.button.next_level.x }, - { "main.button.next_level.y", &menu.main.button.next_level.y }, + { "main.button.prev_level.x", &menu.main.button.prev_level.x }, + { "main.button.prev_level.y", &menu.main.button.prev_level.y }, + { "main.button.next_level.x", &menu.main.button.next_level.x }, + { "main.button.next_level.y", &menu.main.button.next_level.y }, - { "main.text.name.x", &menu.main.text.name.x }, - { "main.text.name.y", &menu.main.text.name.y }, - { "main.text.name.width", &menu.main.text.name.width }, - { "main.text.name.height", &menu.main.text.name.height }, - { "main.text.name.align", &menu.main.text.name.align }, - { "main.text.levels.x", &menu.main.text.levels.x }, - { "main.text.levels.y", &menu.main.text.levels.y }, - { "main.text.levels.width", &menu.main.text.levels.width }, - { "main.text.levels.height", &menu.main.text.levels.height }, - { "main.text.levels.align", &menu.main.text.levels.align }, - { "main.text.scores.x", &menu.main.text.scores.x }, - { "main.text.scores.y", &menu.main.text.scores.y }, - { "main.text.scores.width", &menu.main.text.scores.width }, - { "main.text.scores.height", &menu.main.text.scores.height }, - { "main.text.scores.align", &menu.main.text.scores.align }, - { "main.text.editor.x", &menu.main.text.editor.x }, - { "main.text.editor.y", &menu.main.text.editor.y }, - { "main.text.editor.width", &menu.main.text.editor.width }, - { "main.text.editor.height", &menu.main.text.editor.height }, - { "main.text.editor.align", &menu.main.text.editor.align }, - { "main.text.info.x", &menu.main.text.info.x }, - { "main.text.info.y", &menu.main.text.info.y }, - { "main.text.info.width", &menu.main.text.info.width }, - { "main.text.info.height", &menu.main.text.info.height }, - { "main.text.info.align", &menu.main.text.info.align }, - { "main.text.game.x", &menu.main.text.game.x }, - { "main.text.game.y", &menu.main.text.game.y }, - { "main.text.game.width", &menu.main.text.game.width }, - { "main.text.game.height", &menu.main.text.game.height }, - { "main.text.game.align", &menu.main.text.game.align }, - { "main.text.setup.x", &menu.main.text.setup.x }, - { "main.text.setup.y", &menu.main.text.setup.y }, - { "main.text.setup.width", &menu.main.text.setup.width }, - { "main.text.setup.height", &menu.main.text.setup.height }, - { "main.text.setup.align", &menu.main.text.setup.align }, - { "main.text.quit.x", &menu.main.text.quit.x }, - { "main.text.quit.y", &menu.main.text.quit.y }, - { "main.text.quit.width", &menu.main.text.quit.width }, - { "main.text.quit.height", &menu.main.text.quit.height }, - { "main.text.quit.align", &menu.main.text.quit.align }, + { "main.text.name.x", &menu.main.text.name.x }, + { "main.text.name.y", &menu.main.text.name.y }, + { "main.text.name.width", &menu.main.text.name.width }, + { "main.text.name.height", &menu.main.text.name.height }, + { "main.text.name.align", &menu.main.text.name.align }, + { "main.text.levels.x", &menu.main.text.levels.x }, + { "main.text.levels.y", &menu.main.text.levels.y }, + { "main.text.levels.width", &menu.main.text.levels.width }, + { "main.text.levels.height", &menu.main.text.levels.height }, + { "main.text.levels.align", &menu.main.text.levels.align }, + { "main.text.scores.x", &menu.main.text.scores.x }, + { "main.text.scores.y", &menu.main.text.scores.y }, + { "main.text.scores.width", &menu.main.text.scores.width }, + { "main.text.scores.height", &menu.main.text.scores.height }, + { "main.text.scores.align", &menu.main.text.scores.align }, + { "main.text.editor.x", &menu.main.text.editor.x }, + { "main.text.editor.y", &menu.main.text.editor.y }, + { "main.text.editor.width", &menu.main.text.editor.width }, + { "main.text.editor.height", &menu.main.text.editor.height }, + { "main.text.editor.align", &menu.main.text.editor.align }, + { "main.text.info.x", &menu.main.text.info.x }, + { "main.text.info.y", &menu.main.text.info.y }, + { "main.text.info.width", &menu.main.text.info.width }, + { "main.text.info.height", &menu.main.text.info.height }, + { "main.text.info.align", &menu.main.text.info.align }, + { "main.text.game.x", &menu.main.text.game.x }, + { "main.text.game.y", &menu.main.text.game.y }, + { "main.text.game.width", &menu.main.text.game.width }, + { "main.text.game.height", &menu.main.text.game.height }, + { "main.text.game.align", &menu.main.text.game.align }, + { "main.text.setup.x", &menu.main.text.setup.x }, + { "main.text.setup.y", &menu.main.text.setup.y }, + { "main.text.setup.width", &menu.main.text.setup.width }, + { "main.text.setup.height", &menu.main.text.setup.height }, + { "main.text.setup.align", &menu.main.text.setup.align }, + { "main.text.quit.x", &menu.main.text.quit.x }, + { "main.text.quit.y", &menu.main.text.quit.y }, + { "main.text.quit.width", &menu.main.text.quit.width }, + { "main.text.quit.height", &menu.main.text.quit.height }, + { "main.text.quit.align", &menu.main.text.quit.align }, { "main.text.current_level.x", &menu.main.text.current_level.x }, { "main.text.current_level.y", &menu.main.text.current_level.y }, @@ -5530,52 +5530,62 @@ struct TokenIntPtrInfo image_config_vars[] = { "main.text.title_3.y", &menu.main.text.title_3.y }, { "main.text.title_3.align", &menu.main.text.title_3.align }, - { "main.input.name.x", &menu.main.input.name.x }, - { "main.input.name.y", &menu.main.input.name.y }, - { "main.input.name.align", &menu.main.input.name.align }, + { "main.input.name.x", &menu.main.input.name.x }, + { "main.input.name.y", &menu.main.input.name.y }, + { "main.input.name.align", &menu.main.input.name.align }, - { "preview.x", &preview.x }, - { "preview.y", &preview.y }, - { "preview.align", &preview.align }, - { "preview.xsize", &preview.xsize }, - { "preview.ysize", &preview.ysize }, - { "preview.xoffset", &preview.xoffset }, - { "preview.yoffset", &preview.yoffset }, - { "preview.tile_size", &preview.tile_size }, - { "preview.step_offset", &preview.step_offset }, - { "preview.step_delay", &preview.step_delay }, - { "preview.anim_mode", &preview.anim_mode }, + { "preview.x", &preview.x }, + { "preview.y", &preview.y }, + { "preview.align", &preview.align }, + { "preview.xsize", &preview.xsize }, + { "preview.ysize", &preview.ysize }, + { "preview.xoffset", &preview.xoffset }, + { "preview.yoffset", &preview.yoffset }, + { "preview.tile_size", &preview.tile_size }, + { "preview.step_offset", &preview.step_offset }, + { "preview.step_delay", &preview.step_delay }, + { "preview.anim_mode", &preview.anim_mode }, - { "door_1.width", &door_1.width }, - { "door_1.height", &door_1.height }, - { "door_1.step_offset", &door_1.step_offset }, - { "door_1.step_delay", &door_1.step_delay }, - { "door_1.anim_mode", &door_1.anim_mode }, - { "door_2.width", &door_2.width }, - { "door_2.height", &door_2.height }, - { "door_2.step_offset", &door_2.step_offset }, - { "door_2.step_delay", &door_2.step_delay }, - { "door_2.anim_mode", &door_2.anim_mode }, + { "door_1.width", &door_1.width }, + { "door_1.height", &door_1.height }, + { "door_1.step_offset", &door_1.step_offset }, + { "door_1.step_delay", &door_1.step_delay }, + { "door_1.anim_mode", &door_1.anim_mode }, + { "door_2.width", &door_2.width }, + { "door_2.height", &door_2.height }, + { "door_2.step_offset", &door_2.step_offset }, + { "door_2.step_delay", &door_2.step_delay }, + { "door_2.anim_mode", &door_2.anim_mode }, - { "game.panel.level.x", &game.panel.level.x }, - { "game.panel.level.y", &game.panel.level.y }, - { "game.panel.gems.x", &game.panel.gems.x }, - { "game.panel.gems.y", &game.panel.gems.y }, - { "game.panel.inventory.x", &game.panel.inventory.x }, - { "game.panel.inventory.y", &game.panel.inventory.y }, - { "game.panel.keys.x", &game.panel.keys.x }, - { "game.panel.keys.y", &game.panel.keys.y }, - { "game.panel.score.x", &game.panel.score.x }, - { "game.panel.score.y", &game.panel.score.y }, - { "game.panel.time.x", &game.panel.time.x }, - { "game.panel.time.y", &game.panel.time.y }, + { "game.panel.level.x", &game.panel.level.x }, + { "game.panel.level.y", &game.panel.level.y }, + { "game.panel.level.align", &game.panel.level.align }, + { "game.panel.level.digits", &game.panel.level.chars }, + { "game.panel.gems.x", &game.panel.gems.x }, + { "game.panel.gems.y", &game.panel.gems.y }, + { "game.panel.gems.align", &game.panel.gems.align }, + { "game.panel.gems.digits", &game.panel.gems.chars }, + { "game.panel.inventory.x", &game.panel.inventory.x }, + { "game.panel.inventory.y", &game.panel.inventory.y }, + { "game.panel.inventory.align", &game.panel.inventory.align }, + { "game.panel.inventory.digits", &game.panel.inventory.chars }, + { "game.panel.keys.x", &game.panel.keys.x }, + { "game.panel.keys.y", &game.panel.keys.y }, + { "game.panel.score.x", &game.panel.score.x }, + { "game.panel.score.y", &game.panel.score.y }, + { "game.panel.score.align", &game.panel.score.align }, + { "game.panel.score.digits", &game.panel.score.chars }, + { "game.panel.time.x", &game.panel.time.x }, + { "game.panel.time.y", &game.panel.time.y }, + { "game.panel.time.align", &game.panel.time.align }, + { "game.panel.time.digits", &game.panel.time.chars }, { "[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, } + { NULL, NULL, } }; @@ -5624,6 +5634,8 @@ struct FontInfo font_info[NUM_FONTS + 1] = { "font.level_number" }, { "font.tape_recorder" }, { "font.game_info" }, + { "font.info.elements" }, + { "font.info.levelset" }, }; diff --git a/src/main.h b/src/main.h index 28b4574a..37742d78 100644 --- a/src/main.h +++ b/src/main.h @@ -1820,8 +1820,10 @@ #define FONT_LEVEL_NUMBER 32 #define FONT_TAPE_RECORDER 33 #define FONT_GAME_INFO 34 +#define FONT_INFO_ELEMENTS 35 +#define FONT_INFO_LEVELSET 36 -#define NUM_FONTS 35 +#define NUM_FONTS 37 #define NUM_INITIAL_FONTS 4 #define FONT_ACTIVE(f) \ @@ -1963,12 +1965,14 @@ struct BorderInfo int draw_masked[NUM_SPECIAL_GFX_ARGS]; }; +#if 0 struct MenuPosInfo { int x, y; int width, height; int align; }; +#endif struct MenuMainButtonInfo { diff --git a/src/screens.c b/src/screens.c index eeb2bcf7..6ba029e7 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1849,7 +1849,11 @@ static char *getHelpText(int element, int action, int direction) void DrawInfoScreen_HelpText(int element, int action, int direction, int ypos) { +#if 1 + int font_nr = FONT_INFO_ELEMENTS; +#else int font_nr = FONT_LEVEL_NUMBER; +#endif int font_width = getFontWidth(font_nr); int sx = mSX + MINI_TILEX + TILEX + MINI_TILEX; int sy = mSY + 65 + 2 * 32 + 1; @@ -2452,7 +2456,11 @@ void DrawInfoScreen_LevelSet() int ystart = 150; int ybottom = SYSIZE - 20; char *filename = getLevelSetInfoFilename(); +#if 1 + int font_nr = FONT_INFO_LEVELSET; +#else int font_nr = FONT_LEVEL_NUMBER; +#endif int font_width = getFontWidth(font_nr); int font_height = getFontHeight(font_nr); int pad_x = 32; -- 2.34.1