added separate buttons for element properties of drawing elements
[rocksndiamonds.git] / src / files.c
index e5ca6168c5a3c5e4612d2460fad557ae3f0ce5a7..c0f256c73c27016f42c2af688f47f97cc0769111 100644 (file)
@@ -1786,10 +1786,41 @@ static void setFileInfoToDefaults(struct LevelFileInfo *level_file_info)
   level_file_info->filename = NULL;
 }
 
+int getMappedElement_SB(int, boolean);
+
 static void ActivateLevelTemplate()
 {
   int x, y;
 
+  if (check_special_flags("load_xsb_to_ces"))
+  {
+    /* fill smaller playfields with padding "beyond border wall" elements */
+    if (level.fieldx < level_template.fieldx ||
+       level.fieldy < level_template.fieldy)
+    {
+      short field[level.fieldx][level.fieldy];
+      int new_fieldx = MAX(level.fieldx, level_template.fieldx);
+      int new_fieldy = MAX(level.fieldy, level_template.fieldy);
+      int pos_fieldx = (new_fieldx - level.fieldx) / 2;
+      int pos_fieldy = (new_fieldy - level.fieldy) / 2;
+
+      /* copy old playfield (which is smaller than the visible area) */
+      for (y = 0; y < level.fieldy; y++) for (x = 0; x < level.fieldx; x++)
+       field[x][y] = level.field[x][y];
+
+      /* fill new, larger playfield with "beyond border wall" elements */
+      for (y = 0; y < new_fieldy; y++) for (x = 0; x < new_fieldx; x++)
+       level.field[x][y] = getMappedElement_SB('_', TRUE);
+
+      /* copy the old playfield to the middle of the new playfield */
+      for (y = 0; y < level.fieldy; y++) for (x = 0; x < level.fieldx; x++)
+       level.field[pos_fieldx + x][pos_fieldy + y] = field[x][y];
+
+      level.fieldx = new_fieldx;
+      level.fieldy = new_fieldy;
+    }
+  }
+
   /* Currently there is no special action needed to activate the template
      data, because 'element_info' property settings overwrite the original
      level data, while all other variables do not change. */
@@ -5756,32 +5787,6 @@ static void LoadLevelFromFileInfo_SB(struct LevelInfo *level,
   {
     /* special global settings can now be set in level template */
 
-    /* fill smaller playfields with padding "beyond border wall" elements */
-    if (level->fieldx < SCR_FIELDX ||
-       level->fieldy < SCR_FIELDY)
-    {
-      short field[level->fieldx][level->fieldy];
-      int new_fieldx = MAX(level->fieldx, SCR_FIELDX);
-      int new_fieldy = MAX(level->fieldy, SCR_FIELDY);
-      int pos_fieldx = (new_fieldx - level->fieldx) / 2;
-      int pos_fieldy = (new_fieldy - level->fieldy) / 2;
-
-      /* copy old playfield (which is smaller than the visible area) */
-      for (y = 0; y < level->fieldy; y++) for (x = 0; x < level->fieldx; x++)
-       field[x][y] = level->field[x][y];
-
-      /* fill new, larger playfield with "beyond border wall" elements */
-      for (y = 0; y < new_fieldy; y++) for (x = 0; x < new_fieldx; x++)
-       level->field[x][y] = getMappedElement_SB('_', load_xsb_to_ces);
-
-      /* copy the old playfield to the middle of the new playfield */
-      for (y = 0; y < level->fieldy; y++) for (x = 0; x < level->fieldx; x++)
-       level->field[pos_fieldx + x][pos_fieldy + y] = field[x][y];
-
-      level->fieldx = new_fieldx;
-      level->fieldy = new_fieldy;
-    }
-
     level->use_custom_template = TRUE;
   }
 }
@@ -7900,40 +7905,42 @@ void SaveScore(int nr)
 #define SETUP_TOKEN_SCROLL_DELAY               6
 #define SETUP_TOKEN_SCROLL_DELAY_VALUE         7
 #define SETUP_TOKEN_ENGINE_SNAPSHOT_MODE       8
-#define SETUP_TOKEN_FADE_SCREENS               9
-#define SETUP_TOKEN_AUTORECORD                 10
-#define SETUP_TOKEN_SHOW_TITLESCREEN           11
-#define SETUP_TOKEN_QUICK_DOORS                        12
-#define SETUP_TOKEN_TEAM_MODE                  13
-#define SETUP_TOKEN_HANDICAP                   14
-#define SETUP_TOKEN_SKIP_LEVELS                        15
-#define SETUP_TOKEN_TIME_LIMIT                 16
-#define SETUP_TOKEN_FULLSCREEN                 17
-#define SETUP_TOKEN_WINDOW_SCALING_PERCENT     18
-#define SETUP_TOKEN_WINDOW_SCALING_QUALITY     19
-#define SETUP_TOKEN_ASK_ON_ESCAPE              20
-#define SETUP_TOKEN_ASK_ON_ESCAPE_EDITOR       21
-#define SETUP_TOKEN_QUICK_SWITCH               22
-#define SETUP_TOKEN_INPUT_ON_FOCUS             23
-#define SETUP_TOKEN_PREFER_AGA_GRAPHICS                24
-#define SETUP_TOKEN_GAME_FRAME_DELAY           25
-#define SETUP_TOKEN_SP_SHOW_BORDER_ELEMENTS    26
-#define SETUP_TOKEN_SMALL_GAME_GRAPHICS                27
-#define SETUP_TOKEN_SHOW_SNAPSHOT_BUTTONS      28
-#define SETUP_TOKEN_GRAPHICS_SET               29
-#define SETUP_TOKEN_SOUNDS_SET                 30
-#define SETUP_TOKEN_MUSIC_SET                  31
-#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS    32
-#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS      33
-#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC       34
-#define SETUP_TOKEN_VOLUME_SIMPLE              35
-#define SETUP_TOKEN_VOLUME_LOOPS               36
-#define SETUP_TOKEN_VOLUME_MUSIC               37
-#define SETUP_TOKEN_TOUCH_CONTROL_TYPE         38
-#define SETUP_TOKEN_TOUCH_MOVE_DISTANCE                39
-#define SETUP_TOKEN_TOUCH_DROP_DISTANCE                40
-
-#define NUM_GLOBAL_SETUP_TOKENS                        41
+#define SETUP_TOKEN_ENGINE_SNAPSHOT_MEMORY     9
+#define SETUP_TOKEN_FADE_SCREENS               10
+#define SETUP_TOKEN_AUTORECORD                 11
+#define SETUP_TOKEN_SHOW_TITLESCREEN           12
+#define SETUP_TOKEN_QUICK_DOORS                        13
+#define SETUP_TOKEN_TEAM_MODE                  14
+#define SETUP_TOKEN_HANDICAP                   15
+#define SETUP_TOKEN_SKIP_LEVELS                        16
+#define SETUP_TOKEN_TIME_LIMIT                 17
+#define SETUP_TOKEN_FULLSCREEN                 18
+#define SETUP_TOKEN_WINDOW_SCALING_PERCENT     19
+#define SETUP_TOKEN_WINDOW_SCALING_QUALITY     20
+#define SETUP_TOKEN_SCREEN_RENDERING_MODE      21
+#define SETUP_TOKEN_ASK_ON_ESCAPE              22
+#define SETUP_TOKEN_ASK_ON_ESCAPE_EDITOR       23
+#define SETUP_TOKEN_QUICK_SWITCH               24
+#define SETUP_TOKEN_INPUT_ON_FOCUS             25
+#define SETUP_TOKEN_PREFER_AGA_GRAPHICS                26
+#define SETUP_TOKEN_GAME_FRAME_DELAY           27
+#define SETUP_TOKEN_SP_SHOW_BORDER_ELEMENTS    28
+#define SETUP_TOKEN_SMALL_GAME_GRAPHICS                29
+#define SETUP_TOKEN_SHOW_SNAPSHOT_BUTTONS      30
+#define SETUP_TOKEN_GRAPHICS_SET               31
+#define SETUP_TOKEN_SOUNDS_SET                 32
+#define SETUP_TOKEN_MUSIC_SET                  33
+#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS    34
+#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS      35
+#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC       36
+#define SETUP_TOKEN_VOLUME_SIMPLE              37
+#define SETUP_TOKEN_VOLUME_LOOPS               38
+#define SETUP_TOKEN_VOLUME_MUSIC               39
+#define SETUP_TOKEN_TOUCH_CONTROL_TYPE         40
+#define SETUP_TOKEN_TOUCH_MOVE_DISTANCE                41
+#define SETUP_TOKEN_TOUCH_DROP_DISTANCE                42
+
+#define NUM_GLOBAL_SETUP_TOKENS                        43
 
 /* editor setup */
 #define SETUP_TOKEN_EDITOR_EL_BOULDERDASH      0
@@ -8048,6 +8055,32 @@ void SaveScore(int nr)
 
 #define NUM_INTERNAL_SETUP_TOKENS              17
 
+/* debug setup */
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_0                0
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_1                1
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_2                2
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_3                3
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_4                4
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_5                5
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_6                6
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_7                7
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_8                8
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_9                9
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_KEY_0    10
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_KEY_1    11
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_KEY_2    12
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_KEY_3    13
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_KEY_4    14
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_KEY_5    15
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_KEY_6    16
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_KEY_7    17
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_KEY_8    18
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_KEY_9    19
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_USE_MOD_KEY 20
+#define SETUP_TOKEN_DEBUG_FRAME_DELAY_GAME_ONLY        21
+
+#define NUM_DEBUG_SETUP_TOKENS                 22
+
 /* options setup */
 #define SETUP_TOKEN_OPTIONS_VERBOSE            0
 
@@ -8061,6 +8094,7 @@ static struct SetupShortcutInfo ssi;
 static struct SetupInputInfo sii;
 static struct SetupSystemInfo syi;
 static struct SetupInternalInfo sxi;
+static struct SetupDebugInfo sdi;
 static struct OptionInfo soi;
 
 static struct TokenInfo global_setup_tokens[] =
@@ -8074,6 +8108,7 @@ static struct TokenInfo global_setup_tokens[] =
   { TYPE_SWITCH, &si.scroll_delay,            "scroll_delay"           },
   { TYPE_INTEGER,&si.scroll_delay_value,      "scroll_delay_value"     },
   { TYPE_STRING, &si.engine_snapshot_mode,    "engine_snapshot_mode"   },
+  { TYPE_INTEGER,&si.engine_snapshot_memory,  "engine_snapshot_memory" },
   { TYPE_SWITCH, &si.fade_screens,            "fade_screens"           },
   { TYPE_SWITCH, &si.autorecord,              "automatic_tape_recording"},
   { TYPE_SWITCH, &si.show_titlescreen,        "show_titlescreen"       },
@@ -8085,6 +8120,7 @@ static struct TokenInfo global_setup_tokens[] =
   { TYPE_SWITCH, &si.fullscreen,              "fullscreen"             },
   { TYPE_INTEGER,&si.window_scaling_percent,  "window_scaling_percent" },
   { TYPE_STRING, &si.window_scaling_quality,  "window_scaling_quality" },
+  { TYPE_STRING, &si.screen_rendering_mode,   "screen_rendering_mode"  },
   { TYPE_SWITCH, &si.ask_on_escape,           "ask_on_escape"          },
   { TYPE_SWITCH, &si.ask_on_escape_editor,    "ask_on_escape_editor"   },
   { TYPE_SWITCH, &si.quick_switch,            "quick_player_switch"    },
@@ -8221,6 +8257,32 @@ static struct TokenInfo internal_setup_tokens[] =
   { TYPE_INTEGER,&sxi.default_window_height,   "default_window_height" },
 };
 
+static struct TokenInfo debug_setup_tokens[] =
+{
+  { TYPE_INTEGER, &sdi.frame_delay[0],         "debug.frame_delay_0"   },
+  { TYPE_INTEGER, &sdi.frame_delay[1],         "debug.frame_delay_1"   },
+  { TYPE_INTEGER, &sdi.frame_delay[2],         "debug.frame_delay_2"   },
+  { TYPE_INTEGER, &sdi.frame_delay[3],         "debug.frame_delay_3"   },
+  { TYPE_INTEGER, &sdi.frame_delay[4],         "debug.frame_delay_4"   },
+  { TYPE_INTEGER, &sdi.frame_delay[5],         "debug.frame_delay_5"   },
+  { TYPE_INTEGER, &sdi.frame_delay[6],         "debug.frame_delay_6"   },
+  { TYPE_INTEGER, &sdi.frame_delay[7],         "debug.frame_delay_7"   },
+  { TYPE_INTEGER, &sdi.frame_delay[8],         "debug.frame_delay_8"   },
+  { TYPE_INTEGER, &sdi.frame_delay[9],         "debug.frame_delay_9"   },
+  { TYPE_KEY_X11, &sdi.frame_delay_key[0],     "debug.key.frame_delay_0" },
+  { TYPE_KEY_X11, &sdi.frame_delay_key[1],     "debug.key.frame_delay_1" },
+  { TYPE_KEY_X11, &sdi.frame_delay_key[2],     "debug.key.frame_delay_2" },
+  { TYPE_KEY_X11, &sdi.frame_delay_key[3],     "debug.key.frame_delay_3" },
+  { TYPE_KEY_X11, &sdi.frame_delay_key[4],     "debug.key.frame_delay_4" },
+  { TYPE_KEY_X11, &sdi.frame_delay_key[5],     "debug.key.frame_delay_5" },
+  { TYPE_KEY_X11, &sdi.frame_delay_key[6],     "debug.key.frame_delay_6" },
+  { TYPE_KEY_X11, &sdi.frame_delay_key[7],     "debug.key.frame_delay_7" },
+  { TYPE_KEY_X11, &sdi.frame_delay_key[8],     "debug.key.frame_delay_8" },
+  { TYPE_KEY_X11, &sdi.frame_delay_key[9],     "debug.key.frame_delay_9" },
+  { TYPE_BOOLEAN, &sdi.frame_delay_use_mod_key,"debug.frame_delay.use_mod_key"},
+  { TYPE_BOOLEAN, &sdi.frame_delay_game_only,  "debug.frame_delay.game_only" },
+};
+
 static struct TokenInfo options_setup_tokens[] =
 {
   { TYPE_BOOLEAN, &soi.verbose,                "options.verbose"               },
@@ -8255,6 +8317,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   si->scroll_delay = TRUE;
   si->scroll_delay_value = STD_SCROLL_DELAY;
   si->engine_snapshot_mode = getStringCopy(STR_SNAPSHOT_MODE_DEFAULT);
+  si->engine_snapshot_memory = SNAPSHOT_MEMORY_DEFAULT;
   si->fade_screens = TRUE;
   si->autorecord = TRUE;
   si->show_titlescreen = TRUE;
@@ -8266,6 +8329,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   si->fullscreen = FALSE;
   si->window_scaling_percent = STD_WINDOW_SCALING_PERCENT;
   si->window_scaling_quality = getStringCopy(SCALING_QUALITY_DEFAULT);
+  si->screen_rendering_mode = getStringCopy(STR_SPECIAL_RENDERING_DEFAULT);
   si->ask_on_escape = TRUE;
   si->ask_on_escape_editor = TRUE;
   si->quick_switch = FALSE;
@@ -8383,6 +8447,31 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   si->internal.default_window_width  = WIN_XSIZE_DEFAULT;
   si->internal.default_window_height = WIN_YSIZE_DEFAULT;
 
+  si->debug.frame_delay[0] = DEFAULT_FRAME_DELAY_0;
+  si->debug.frame_delay[1] = DEFAULT_FRAME_DELAY_1;
+  si->debug.frame_delay[2] = DEFAULT_FRAME_DELAY_2;
+  si->debug.frame_delay[3] = DEFAULT_FRAME_DELAY_3;
+  si->debug.frame_delay[4] = DEFAULT_FRAME_DELAY_4;
+  si->debug.frame_delay[5] = DEFAULT_FRAME_DELAY_5;
+  si->debug.frame_delay[6] = DEFAULT_FRAME_DELAY_6;
+  si->debug.frame_delay[7] = DEFAULT_FRAME_DELAY_7;
+  si->debug.frame_delay[8] = DEFAULT_FRAME_DELAY_8;
+  si->debug.frame_delay[9] = DEFAULT_FRAME_DELAY_9;
+
+  si->debug.frame_delay_key[0] = DEFAULT_KEY_FRAME_DELAY_0;
+  si->debug.frame_delay_key[1] = DEFAULT_KEY_FRAME_DELAY_1;
+  si->debug.frame_delay_key[2] = DEFAULT_KEY_FRAME_DELAY_2;
+  si->debug.frame_delay_key[3] = DEFAULT_KEY_FRAME_DELAY_3;
+  si->debug.frame_delay_key[4] = DEFAULT_KEY_FRAME_DELAY_4;
+  si->debug.frame_delay_key[5] = DEFAULT_KEY_FRAME_DELAY_5;
+  si->debug.frame_delay_key[6] = DEFAULT_KEY_FRAME_DELAY_6;
+  si->debug.frame_delay_key[7] = DEFAULT_KEY_FRAME_DELAY_7;
+  si->debug.frame_delay_key[8] = DEFAULT_KEY_FRAME_DELAY_8;
+  si->debug.frame_delay_key[9] = DEFAULT_KEY_FRAME_DELAY_9;
+
+  si->debug.frame_delay_use_mod_key = DEFAULT_FRAME_DELAY_USE_MOD_KEY;
+  si->debug.frame_delay_game_only   = DEFAULT_FRAME_DELAY_GAME_ONLY;
+
   si->options.verbose = FALSE;
 
 #if defined(PLATFORM_ANDROID)
@@ -8471,6 +8560,13 @@ static void decodeSetupFileHash(SetupFileHash *setup_file_hash)
                 getHashEntry(setup_file_hash, internal_setup_tokens[i].text));
   setup.internal = sxi;
 
+  /* debug setup */
+  sdi = setup.debug;
+  for (i = 0; i < NUM_DEBUG_SETUP_TOKENS; i++)
+    setSetupInfo(debug_setup_tokens, i,
+                getHashEntry(setup_file_hash, debug_setup_tokens[i].text));
+  setup.debug = sdi;
+
   /* options setup */
   soi = setup.options;
   for (i = 0; i < NUM_OPTIONS_SETUP_TOKENS; i++)
@@ -8637,6 +8733,12 @@ void SaveSetup()
   /* internal setup */
   /* (internal setup values not saved to user setup file) */
 
+  /* debug setup */
+  sdi = setup.debug;
+  fprintf(file, "\n");
+  for (i = 0; i < NUM_DEBUG_SETUP_TOKENS; i++)
+    fprintf(file, "%s\n", getSetupLine(debug_setup_tokens, "", i));
+
   /* options setup */
   soi = setup.options;
   fprintf(file, "\n");
@@ -8761,6 +8863,31 @@ static void InitMenuDesignSettings_SpecialPreProcessing()
 
   /* special case: initialize "ARG_DEFAULT" values in static default config */
   /* (e.g., initialize "[titlemessage].fade_mode" from "[title].fade_mode") */
+  titlescreen_initial_first_default.fade_mode  =
+    title_initial_first_default.fade_mode;
+  titlescreen_initial_first_default.fade_delay =
+    title_initial_first_default.fade_delay;
+  titlescreen_initial_first_default.post_delay =
+    title_initial_first_default.post_delay;
+  titlescreen_initial_first_default.auto_delay =
+    title_initial_first_default.auto_delay;
+  titlescreen_first_default.fade_mode  = title_first_default.fade_mode;
+  titlescreen_first_default.fade_delay = title_first_default.fade_delay;
+  titlescreen_first_default.post_delay = title_first_default.post_delay;
+  titlescreen_first_default.auto_delay = title_first_default.auto_delay;
+  titlemessage_initial_first_default.fade_mode  =
+    title_initial_first_default.fade_mode;
+  titlemessage_initial_first_default.fade_delay =
+    title_initial_first_default.fade_delay;
+  titlemessage_initial_first_default.post_delay =
+    title_initial_first_default.post_delay;
+  titlemessage_initial_first_default.auto_delay =
+    title_initial_first_default.auto_delay;
+  titlemessage_first_default.fade_mode  = title_first_default.fade_mode;
+  titlemessage_first_default.fade_delay = title_first_default.fade_delay;
+  titlemessage_first_default.post_delay = title_first_default.post_delay;
+  titlemessage_first_default.auto_delay = title_first_default.auto_delay;
+
   titlescreen_initial_default.fade_mode  = title_initial_default.fade_mode;
   titlescreen_initial_default.fade_delay = title_initial_default.fade_delay;
   titlescreen_initial_default.post_delay = title_initial_default.post_delay;
@@ -8782,6 +8909,11 @@ static void InitMenuDesignSettings_SpecialPreProcessing()
   /* (e.g., init "titlemessage_1.fade_mode" from "[titlemessage].fade_mode") */
   for (i = 0; i < MAX_NUM_TITLE_MESSAGES; i++)
   {
+    titlescreen_initial_first[i] = titlescreen_initial_first_default;
+    titlescreen_first[i] = titlescreen_first_default;
+    titlemessage_initial_first[i] = titlemessage_initial_first_default;
+    titlemessage_first[i] = titlemessage_first_default;
+
     titlescreen_initial[i] = titlescreen_initial_default;
     titlescreen[i] = titlescreen_default;
     titlemessage_initial[i] = titlemessage_initial_default;
@@ -8839,12 +8971,48 @@ static void InitMenuDesignSettings_SpecialPostProcessing()
 
   /* set default position for snapshot buttons to stop/pause/play buttons */
   for (i = 0; game_buttons_xy[i].dst != NULL; i++)
-  {
     if ((*game_buttons_xy[i].dst).x == -1 &&
        (*game_buttons_xy[i].dst).y == -1)
+      *game_buttons_xy[i].dst = *game_buttons_xy[i].src;
+}
+
+static void InitMenuDesignSettings_SpecialPostProcessing_AfterGraphics()
+{
+  static struct
+  {
+    struct XYTileSize *dst, *src;
+    int graphic;
+  }
+  editor_buttons_xy[] =
+  {
+    {
+      &editor.button.element_left,     &editor.palette.element_left,
+      IMG_GFX_EDITOR_BUTTON_ELEMENT_LEFT
+    },
     {
-      (*game_buttons_xy[i].dst).x = (*game_buttons_xy[i].src).x;
-      (*game_buttons_xy[i].dst).y = (*game_buttons_xy[i].src).y;
+      &editor.button.element_middle,   &editor.palette.element_middle,
+      IMG_GFX_EDITOR_BUTTON_ELEMENT_MIDDLE
+    },
+    {
+      &editor.button.element_right,    &editor.palette.element_right,
+      IMG_GFX_EDITOR_BUTTON_ELEMENT_RIGHT
+    },
+
+    { NULL,                    NULL                    }
+  };
+  int i;
+
+  /* set default position for element buttons to element graphics */
+  for (i = 0; editor_buttons_xy[i].dst != NULL; i++)
+  {
+    if ((*editor_buttons_xy[i].dst).x == -1 &&
+       (*editor_buttons_xy[i].dst).y == -1)
+    {
+      struct GraphicInfo *gd = &graphic_info[editor_buttons_xy[i].graphic];
+
+      gd->width = gd->height = editor_buttons_xy[i].src->tile_size;
+
+      *editor_buttons_xy[i].dst = *editor_buttons_xy[i].src;
     }
   }
 }
@@ -8891,6 +9059,10 @@ static void LoadMenuDesignSettingsFromFilename(char *filename)
   }
   title_info[] =
   {
+    /* initialize first titles from "enter screen" definitions, if defined */
+    { &title_initial_first_default,    "menu.enter_screen.TITLE"       },
+    { &title_first_default,            "menu.enter_screen.TITLE"       },
+
     /* initialize title screens from "next screen" definitions, if defined */
     { &title_initial_default,          "menu.next_screen.TITLE"        },
     { &title_default,                  "menu.next_screen.TITLE"        },
@@ -9228,6 +9400,11 @@ void LoadMenuDesignSettings()
   InitMenuDesignSettings_SpecialPostProcessing();
 }
 
+void LoadMenuDesignSettings_AfterGraphics()
+{
+  InitMenuDesignSettings_SpecialPostProcessing_AfterGraphics();
+}
+
 void LoadUserDefinedEditorElementList(int **elements, int *num_elements)
 {
   char *filename = getEditorSetupFilename();
@@ -9865,15 +10042,15 @@ void ConvertLevels()
 
   convert_level_nr = convert_leveldir->first_level;
 
-  printf_line("=", 79);
-  printf("Converting levels\n");
-  printf_line("-", 79);
-  printf("Level series identifier: '%s'\n", convert_leveldir->identifier);
-  printf("Level series name:       '%s'\n", convert_leveldir->name);
-  printf("Level series author:     '%s'\n", convert_leveldir->author);
-  printf("Number of levels:        %d\n",   convert_leveldir->levels);
-  printf_line("=", 79);
-  printf("\n");
+  PrintLine("=", 79);
+  Print("Converting levels\n");
+  PrintLine("-", 79);
+  Print("Level series identifier: '%s'\n", convert_leveldir->identifier);
+  Print("Level series name:       '%s'\n", convert_leveldir->name);
+  Print("Level series author:     '%s'\n", convert_leveldir->author);
+  Print("Number of levels:        %d\n",   convert_leveldir->levels);
+  PrintLine("=", 79);
+  Print("\n");
 
   for (i = 0; i < MAX_NUM_CONVERT_LEVELS; i++)
     levels_failed[i] = FALSE;
@@ -9885,16 +10062,16 @@ void ConvertLevels()
 
     level_nr = convert_level_nr++;
 
-    printf("Level %03d: ", level_nr);
+    Print("Level %03d: ", level_nr);
 
     LoadLevel(level_nr);
     if (level.no_valid_file)
     {
-      printf("(no level)\n");
+      Print("(no level)\n");
       continue;
     }
 
-    printf("converting level ... ");
+    Print("converting level ... ");
 
     level_filename = getDefaultLevelFilename(level_nr);
     new_level = !fileExists(level_filename);
@@ -9905,28 +10082,28 @@ void ConvertLevels()
 
       num_levels_converted++;
 
-      printf("converted.\n");
+      Print("converted.\n");
     }
     else
     {
       if (level_nr >= 0 && level_nr < MAX_NUM_CONVERT_LEVELS)
        levels_failed[level_nr] = TRUE;
 
-      printf("NOT CONVERTED -- LEVEL ALREADY EXISTS.\n");
+      Print("NOT CONVERTED -- LEVEL ALREADY EXISTS.\n");
     }
 
     num_levels_handled++;
   }
 
-  printf("\n");
-  printf_line("=", 79);
-  printf("Number of levels handled: %d\n", num_levels_handled);
-  printf("Number of levels converted: %d (%d%%)\n", num_levels_converted,
+  Print("\n");
+  PrintLine("=", 79);
+  Print("Number of levels handled: %d\n", num_levels_handled);
+  Print("Number of levels converted: %d (%d%%)\n", num_levels_converted,
         (num_levels_handled ?
          num_levels_converted * 100 / num_levels_handled : 0));
-  printf_line("-", 79);
-  printf("Summary (for automatic parsing by scripts):\n");
-  printf("LEVELDIR '%s', CONVERTED %d/%d (%d%%)",
+  PrintLine("-", 79);
+  Print("Summary (for automatic parsing by scripts):\n");
+  Print("LEVELDIR '%s', CONVERTED %d/%d (%d%%)",
         convert_leveldir->identifier, num_levels_converted,
         num_levels_handled,
         (num_levels_handled ?
@@ -9934,14 +10111,14 @@ void ConvertLevels()
 
   if (num_levels_handled != num_levels_converted)
   {
-    printf(", FAILED:");
+    Print(", FAILED:");
     for (i = 0; i < MAX_NUM_CONVERT_LEVELS; i++)
       if (levels_failed[i])
-       printf(" %03d", i);
+       Print(" %03d", i);
   }
 
-  printf("\n");
-  printf_line("=", 79);
+  Print("\n");
+  PrintLine("=", 79);
 
   CloseAllAndExit(0);
 }