rnd-20061017-2-src
authorHolger Schemel <info@artsoft.org>
Tue, 17 Oct 2006 18:36:28 +0000 (20:36 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:53:22 +0000 (10:53 +0200)
* added additional configuration directives for info screen draw offset:
  menu.draw_{x,y}offset.INFO[{ELEMENTS,MUSIC,CREDITS,PROGRAM,LEVELSET}]

ChangeLog
src/conf_gfx.c
src/conftime.h
src/events.c
src/files.c
src/main.c
src/main.h
src/screens.c
src/screens.h
src/tools.c

index 6f3e66d852f8274009c2c1cc4bc3d7e5bb0f777c..2708c47b7c3b014285ec9167a1f020852849a282 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-10-17
+       * added additional configuration directives for info screen draw offset:
+         menu.draw_{x,y}offset.INFO[{ELEMENTS,MUSIC,CREDITS,PROGRAM,LEVELSET}]
+
 2006-10-16
        * added highlighted menu text entries to menu navigation when selected
 
index ef3231fb9c3de33611b72d77d0d069cb315bcbed..019af377ea7b22bbdd704f9b6cf95877f83395a0 100644 (file)
@@ -4545,6 +4545,16 @@ struct ConfigInfo image_config[] =
   { "menu.draw_yoffset.EDITOR",                        "0"                     },
   { "menu.draw_xoffset.INFO",                  "0"                     },
   { "menu.draw_yoffset.INFO",                  "0"                     },
+  { "menu.draw_xoffset.INFO[ELEMENTS]",                "0"                     },
+  { "menu.draw_yoffset.INFO[ELEMENTS]",                "0"                     },
+  { "menu.draw_xoffset.INFO[MUSIC]",           "0"                     },
+  { "menu.draw_yoffset.INFO[MUSIC]",           "0"                     },
+  { "menu.draw_xoffset.INFO[CREDITS]",         "0"                     },
+  { "menu.draw_yoffset.INFO[CREDITS]",         "0"                     },
+  { "menu.draw_xoffset.INFO[PROGRAM]",         "0"                     },
+  { "menu.draw_yoffset.INFO[PROGRAM]",         "0"                     },
+  { "menu.draw_xoffset.INFO[LEVELSET]",                "0"                     },
+  { "menu.draw_yoffset.INFO[LEVELSET]",                "0"                     },
   { "menu.draw_xoffset.SETUP",                 "0"                     },
   { "menu.draw_yoffset.SETUP",                 "0"                     },
 
@@ -4630,6 +4640,8 @@ struct ConfigInfo image_config[] =
   { "preview.y",                               "388"                   },
   { "preview.xsize",                           "66"                    },
   { "preview.ysize",                           "34"                    },
+  { "preview.xoffset",                         "0"                     },
+  { "preview.yoffset",                         "0"                     },
   { "preview.tile_size",                       "4"                     },
   { "preview.step_offset",                     "1"                     },
   { "preview.step_delay",                      "50"                    },
index c33f531173207632b04f33c824cd5e9eb7c2273b..6d93226e9ea0796a4381d1b8054f002b7d56555b 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2006-10-17 02:38]"
+#define COMPILE_DATE_STRING "[2006-10-17 20:23]"
index 9bd812373723cef124767d39028f4419dcfbbbdc..dbaa43735a78fb606b3cf7f4c87fc531b0cd42a0 100644 (file)
@@ -711,6 +711,9 @@ void HandleKey(Key key, int key_status)
 
     ToggleFullscreenIfNeeded();
 
+    if (game_status == GAME_MODE_SETUP)
+      RedrawSetupScreenAfterFullscreenToggle();
+
     return;
   }
 
index 1287d1ecd2d1fe041f9edf408ffaa75944c49e17..3d6af17cd23acdc00c641402f6009d05770bc47d 100644 (file)
@@ -6619,6 +6619,18 @@ static void LoadSpecialMenuDesignSettingsFromFilename(char *filename)
       menu.list_size[i] = get_integer_from_string(list_size);
   }
 
+  /* special case: initialize with default values that may be overwritten */
+  for (i = 0; i < NUM_SPECIAL_GFX_INFO_ARGS; i++)
+  {
+    char *value_x = getHashEntry(setup_file_hash, "menu.draw_xoffset.INFO");
+    char *value_y = getHashEntry(setup_file_hash, "menu.draw_yoffset.INFO");
+
+    if (value_x != NULL)
+      menu.draw_xoffset_info[i] = get_integer_from_string(value_x);
+    if (value_y != NULL)
+      menu.draw_yoffset_info[i] = get_integer_from_string(value_y);
+  }
+
   /* read (and overwrite with) values that may be specified in config file */
   for (i = 0; image_config_vars[i].token != NULL; i++)
   {
index bb45da5484c23b3bed1771adac2f11f358ba2a2c..f7925c4574170a782f19dcc26a176a695de7610e 100644 (file)
@@ -4661,6 +4661,26 @@ struct TokenIntPtrInfo image_config_vars[] =
   { "menu.draw_yoffset.EDITOR",        &menu.draw_yoffset[GFX_SPECIAL_ARG_EDITOR]    },
   { "menu.draw_xoffset.INFO",  &menu.draw_xoffset[GFX_SPECIAL_ARG_INFO]      },
   { "menu.draw_yoffset.INFO",  &menu.draw_yoffset[GFX_SPECIAL_ARG_INFO]      },
+  { "menu.draw_xoffset.INFO[ELEMENTS]",
+    &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_ELEMENTS]                   },
+  { "menu.draw_yoffset.INFO[ELEMENTS]",
+    &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_ELEMENTS]                   },
+  { "menu.draw_xoffset.INFO[MUSIC]",
+    &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_MUSIC]                              },
+  { "menu.draw_yoffset.INFO[MUSIC]",
+    &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_MUSIC]                              },
+  { "menu.draw_xoffset.INFO[CREDITS]",
+    &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_CREDITS]                    },
+  { "menu.draw_yoffset.INFO[CREDITS]",
+    &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_CREDITS]                    },
+  { "menu.draw_xoffset.INFO[PROGRAM]",
+    &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_PROGRAM]                    },
+  { "menu.draw_yoffset.INFO[PROGRAM]",
+    &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_PROGRAM]                    },
+  { "menu.draw_xoffset.INFO[LEVELSET]",
+    &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_LEVELSET]                   },
+  { "menu.draw_yoffset.INFO[LEVELSET]",
+    &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_LEVELSET]                   },
   { "menu.draw_xoffset.SETUP", &menu.draw_xoffset[GFX_SPECIAL_ARG_SETUP]     },
   { "menu.draw_yoffset.SETUP", &menu.draw_yoffset[GFX_SPECIAL_ARG_SETUP]     },
 
@@ -4746,6 +4766,8 @@ struct TokenIntPtrInfo image_config_vars[] =
   { "preview.y",               &preview.y                                    },
   { "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                           },
index 3c3a40fb5181bd3a297542b5e64c20d6138642c8..36fb3b16c6ae4e69cfe4f4d62a2b491b6ce45908 100644 (file)
 
 #define NUM_SPECIAL_GFX_ARGS           12
 
+/* these additional definitions are currently only used for draw offsets */
+#define GFX_SPECIAL_ARG_INFO_MAIN      0
+#define GFX_SPECIAL_ARG_INFO_TITLE     1
+#define GFX_SPECIAL_ARG_INFO_ELEMENTS  2
+#define GFX_SPECIAL_ARG_INFO_MUSIC     3
+#define GFX_SPECIAL_ARG_INFO_CREDITS   4
+#define GFX_SPECIAL_ARG_INFO_PROGRAM   5
+#define GFX_SPECIAL_ARG_INFO_LEVELSET  6
+
+#define NUM_SPECIAL_GFX_INFO_ARGS      7
+
 
 /* values for image configuration suffixes */
 #define GFX_ARG_X                      0
@@ -1884,6 +1895,8 @@ struct MenuInfo
 {
   int draw_xoffset[NUM_SPECIAL_GFX_ARGS];
   int draw_yoffset[NUM_SPECIAL_GFX_ARGS];
+  int draw_xoffset_info[NUM_SPECIAL_GFX_INFO_ARGS];
+  int draw_yoffset_info[NUM_SPECIAL_GFX_INFO_ARGS];
 
   int scrollbar_xoffset;
 
@@ -1911,6 +1924,7 @@ struct PreviewInfo
 {
   int x, y;
   int xsize, ysize;
+  int xoffset, yoffset;
   int tile_size;
   int step_offset;
   int step_delay;
index be4f8a48e5c525804fd36ee2f34b10e14141fb05..cae3c5f2d7258522e6378d8c82f30d201300818a 100644 (file)
@@ -164,13 +164,31 @@ static int info_mode = INFO_MODE_MAIN;
 static TreeInfo *screen_modes = NULL;
 static TreeInfo *screen_mode_current = NULL;
 
-#define DRAW_OFFSET_MODE(x)    (x >= GAME_MODE_MAIN &&                 \
-                                x <= GAME_MODE_SETUP ? x :             \
-                                x == GAME_MODE_PSEUDO_TYPENAME ?       \
+#define DRAW_MODE(s)           ((s) >= GAME_MODE_MAIN &&               \
+                                (s) <= GAME_MODE_SETUP ? (s) :         \
+                                (s) == GAME_MODE_PSEUDO_TYPENAME ?     \
                                 GAME_MODE_MAIN : GAME_MODE_DEFAULT)
 
-#define mSX (SX + menu.draw_xoffset[DRAW_OFFSET_MODE(game_status)])
-#define mSY (SY + menu.draw_yoffset[DRAW_OFFSET_MODE(game_status)])
+#define DRAW_MODE_INFO(i)      ((i) >= INFO_MODE_ELEMENTS &&           \
+                                (i) <= INFO_MODE_LEVELSET ? (i) :      \
+                                INFO_MODE_MAIN)
+
+#define DRAW_XOFFSET_INFO(i)   (DRAW_MODE_INFO(i) == INFO_MODE_MAIN ?  \
+                                menu.draw_xoffset[GAME_MODE_INFO] :    \
+                                menu.draw_xoffset_info[DRAW_MODE_INFO(i)])
+#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 DRAW_XOFFSET(s)                ((s) == GAME_MODE_INFO ?                \
+                                DRAW_XOFFSET_INFO(info_mode) :         \
+                                menu.draw_xoffset[DRAW_MODE(s)])
+#define DRAW_YOFFSET(s)                ((s) == GAME_MODE_INFO ?                \
+                                DRAW_YOFFSET_INFO(info_mode) :         \
+                                menu.draw_yoffset[DRAW_MODE(s)])
+
+#define mSX                    (SX + DRAW_XOFFSET(game_status))
+#define mSY                    (SY + DRAW_YOFFSET(game_status))
 
 #define NUM_MENU_ENTRIES_ON_SCREEN (menu.list_size[game_status] > 2 ?  \
                                    menu.list_size[game_status] :       \
@@ -4264,6 +4282,12 @@ void DrawSetupScreen()
   PlayMenuMusic();
 }
 
+void RedrawSetupScreenAfterFullscreenToggle()
+{
+  if (setup_mode == SETUP_MODE_GRAPHICS)
+    DrawSetupScreen();
+}
+
 void HandleSetupScreen(int mx, int my, int dx, int dy, int button)
 {
   if (setup_mode == SETUP_MODE_INPUT)
index 6f8cb1fb87d192b9cf588d884f20a29bc9cabdfa..d649a76dfa214cf866019b48b97bb7ecce6d533b 100644 (file)
@@ -26,6 +26,8 @@ void DrawAndFadeInMainMenu(int);
 void DrawMainMenu(void);
 void DrawHallOfFame(int);
 
+void RedrawSetupScreenAfterFullscreenToggle();
+
 void HandleTitleScreen(int, int, int, int, int);
 void HandleMainMenu(int, int, int, int, int);
 void HandleChooseLevel(int, int, int, int, int);
index 32f7b638d094bb7d3de5bc419576eccbe42110ea..17864c32133cc217cc86a646953d138a04413b52 100644 (file)
@@ -1777,7 +1777,8 @@ void DrawPreviewLevel(boolean restart)
 
   if (restart)
   {
-    from_x = from_y = 0;
+    from_x = preview.xoffset;
+    from_y = preview.yoffset;
     scroll_direction = MV_RIGHT;
     label_state = 1;
     label_counter = 0;