From: Holger Schemel Date: Tue, 31 Oct 2017 11:49:28 +0000 (+0100) Subject: completed options for vertical text spacing on info and setup screens X-Git-Tag: 4.1.0.0~80 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=c4245ac7001dbd6a10e085ac72962611f43a1e90;p=rocksndiamonds.git completed options for vertical text spacing on info and setup screens --- diff --git a/src/conf_gfx.c b/src/conf_gfx.c index c1c0890a..b2859d1b 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -7802,7 +7802,15 @@ struct ConfigInfo image_config[] = { "menu.line_spacing.INFO[LEVELSET]", "0" }, { "menu.line_spacing.SETUP[INPUT]", "0" }, - { "menu.extra_spacing", "2" }, + { "menu.extra_spacing.INFO", "2" }, + { "menu.extra_spacing.INFO[TITLE]", "2" }, + { "menu.extra_spacing.INFO[ELEMENTS]", "2" }, + { "menu.extra_spacing.INFO[MUSIC]", "2" }, + { "menu.extra_spacing.INFO[CREDITS]", "2" }, + { "menu.extra_spacing.INFO[PROGRAM]", "2" }, + { "menu.extra_spacing.INFO[VERSION]", "2" }, + { "menu.extra_spacing.INFO[LEVELSET]", "2" }, + { "menu.extra_spacing.SETUP[INPUT]", "2" }, { "main.button.name.x", "0" }, { "main.button.name.y", "64" }, diff --git a/src/files.c b/src/files.c index 3be804a7..a07ee8af 100644 --- a/src/files.c +++ b/src/files.c @@ -9756,6 +9756,7 @@ static void LoadMenuDesignSettingsFromFilename(char *filename) char *value_2 = getHashEntry(setup_file_hash,"menu.headline1_spacing.INFO"); char *value_3 = getHashEntry(setup_file_hash,"menu.headline2_spacing.INFO"); char *value_4 = getHashEntry(setup_file_hash,"menu.line_spacing.INFO"); + char *value_5 = getHashEntry(setup_file_hash,"menu.extra_spacing.INFO"); if (value_1 != NULL) menu.paragraph_spacing_info[i] = get_integer_from_string(value_1); @@ -9765,6 +9766,8 @@ static void LoadMenuDesignSettingsFromFilename(char *filename) menu.headline2_spacing_info[i] = get_integer_from_string(value_3); if (value_4 != NULL) menu.line_spacing_info[i] = get_integer_from_string(value_4); + if (value_5 != NULL) + menu.extra_spacing_info[i] = get_integer_from_string(value_5); } /* special case: initialize with default values that may be overwritten */ diff --git a/src/main.h b/src/main.h index b20f512e..f9ffaac8 100644 --- a/src/main.h +++ b/src/main.h @@ -2732,7 +2732,9 @@ struct MenuInfo int line_spacing[NUM_SPECIAL_GFX_INFO_ARGS]; int line_spacing_info[NUM_SPECIAL_GFX_INFO_ARGS]; int line_spacing_setup[NUM_SPECIAL_GFX_INFO_ARGS]; - int extra_spacing; + int extra_spacing[NUM_SPECIAL_GFX_INFO_ARGS]; + int extra_spacing_info[NUM_SPECIAL_GFX_INFO_ARGS]; + int extra_spacing_setup[NUM_SPECIAL_GFX_INFO_ARGS]; struct TitleFadingInfo enter_menu; struct TitleFadingInfo leave_menu; diff --git a/src/screens.c b/src/screens.c index 5011bee2..87a86224 100644 --- a/src/screens.c +++ b/src/screens.c @@ -444,6 +444,9 @@ static struct #define DRAW_YOFFSET_INFO(i) (DRAW_MODE_INFO(i) == INFO_MODE_MAIN ? \ menu.draw_yoffset[GAME_MODE_INFO] : \ menu.draw_yoffset_info[DRAW_MODE_INFO(i)]) +#define EXTRA_SPACING_INFO(i) (DRAW_MODE_INFO(i) == INFO_MODE_MAIN ? \ + menu.extra_spacing[GAME_MODE_INFO] : \ + menu.extra_spacing_info[DRAW_MODE_INFO(i)]) #define DRAW_XOFFSET_SETUP(i) (DRAW_MODE_SETUP(i) == SETUP_MODE_MAIN ? \ menu.draw_xoffset[GAME_MODE_SETUP] : \ @@ -451,6 +454,9 @@ static struct #define DRAW_YOFFSET_SETUP(i) (DRAW_MODE_SETUP(i) == SETUP_MODE_MAIN ? \ menu.draw_yoffset[GAME_MODE_SETUP] : \ menu.draw_yoffset_setup[DRAW_MODE_SETUP(i)]) +#define EXTRA_SPACING_SETUP(i) (DRAW_MODE_SETUP(i) == SETUP_MODE_MAIN ? \ + menu.extra_spacing[GAME_MODE_SETUP] : \ + menu.extra_spacing_setup[DRAW_MODE_SETUP(i)]) #define DRAW_XOFFSET(s) ((s) == GAME_MODE_INFO ? \ DRAW_XOFFSET_INFO(info_mode) : \ @@ -462,6 +468,11 @@ static struct (s) == GAME_MODE_SETUP ? \ DRAW_YOFFSET_SETUP(setup_mode) : \ menu.draw_yoffset[DRAW_MODE(s)]) +#define EXTRA_SPACING(s) ((s) == GAME_MODE_INFO ? \ + EXTRA_SPACING_INFO(info_mode) : \ + (s) == GAME_MODE_SETUP ? \ + EXTRA_SPACING_SETUP(setup_mode) : \ + menu.extra_spacing[DRAW_MODE(s)]) #define mSX (SX + DRAW_XOFFSET(game_status)) #define mSY (SY + DRAW_YOFFSET(game_status)) @@ -2532,7 +2543,7 @@ void HandleInfoScreen_Main(int mx, int my, int dx, int dy, int button) static int getMenuFontSpacing(int spacing_height, int font_nr) { - int font_spacing = getFontHeight(font_nr) + menu.extra_spacing; + int font_spacing = getFontHeight(font_nr) + EXTRA_SPACING(game_status); return (spacing_height < 0 ? ABS(spacing_height) * font_spacing : spacing_height); @@ -2540,7 +2551,8 @@ static int getMenuFontSpacing(int spacing_height, int font_nr) static int getMenuTextSpacing(int spacing_height, int font_nr) { - return getMenuFontSpacing(spacing_height, font_nr) + menu.extra_spacing; + return (getMenuFontSpacing(spacing_height, font_nr) + + EXTRA_SPACING(game_status)); } static int getMenuTextStep(int spacing_height, int font_nr)