completed options for vertical text spacing on info and setup screens
authorHolger Schemel <info@artsoft.org>
Tue, 31 Oct 2017 11:49:28 +0000 (12:49 +0100)
committerHolger Schemel <info@artsoft.org>
Fri, 23 Mar 2018 22:21:14 +0000 (23:21 +0100)
src/conf_gfx.c
src/files.c
src/main.h
src/screens.c

index c1c0890a4617f9d863cc5f03026cd16a02466038..b2859d1bd1c7fc231277af70559bf924f2dfd788 100644 (file)
@@ -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"                    },
index 3be804a701c80da26ed2a40b859d9b7c801a373e..a07ee8af5458f10b60cfe66d431ac2372be1e4a1 100644 (file)
@@ -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 */
index b20f512e5a244747e3f673fa7be7c216917d7542..f9ffaac88eb05fd1a4231cacdcddab8bdef8a9e0 100644 (file)
@@ -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;
index 5011bee25f07c1476a011ab0c65a6ba51308af54..87a862245d88a6b4bf7c3c73b38016160260bb25 100644 (file)
@@ -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)