added centering levels that are smaller than the playfield (MM engine)
[rocksndiamonds.git] / src / init.c
index 895e9185173e2f5e1c52481005795ebead8430b2..45f08cd69aac51c75b34b248260252107111dc1f 100644 (file)
@@ -551,6 +551,11 @@ void InitFontGraphicInfo()
       font_bitmap_info[font_bitmap_id].width  = graphic_info[graphic].width;
       font_bitmap_info[font_bitmap_id].height = graphic_info[graphic].height;
 
+      font_bitmap_info[font_bitmap_id].offset_x =
+       graphic_info[graphic].offset_x;
+      font_bitmap_info[font_bitmap_id].offset_y =
+       graphic_info[graphic].offset_y;
+
       font_bitmap_info[font_bitmap_id].draw_xoffset =
        graphic_info[graphic].draw_xoffset;
       font_bitmap_info[font_bitmap_id].draw_yoffset =
@@ -5059,6 +5064,7 @@ static void InitSetup()
 static void InitGameInfo()
 {
   game.restart_level = FALSE;
+  game.restart_game_message = NULL;
 }
 
 static void InitPlayerInfo()
@@ -5118,6 +5124,10 @@ static void InitArtworkConfig()
   {
     "name",
     "sort_priority",
+    "program_title",
+    "program_copyright",
+    "program_company",
+
     NULL
   };
   static char **ignore_image_tokens;
@@ -5422,6 +5432,7 @@ void InitGfx()
   InitGfxDrawBusyAnimFunction(DrawInitAnim);
   InitGfxDrawGlobalAnimFunction(DrawGlobalAnimations);
   InitGfxDrawGlobalBorderFunction(DrawMaskedBorderToTarget);
+  InitGfxDrawTileCursorFunction(DrawTileCursor);
 
   gfx.fade_border_source_status = global.border_status;
   gfx.fade_border_target_status = global.border_status;
@@ -5878,6 +5889,10 @@ void KeyboardAutoRepeatOffUnlessAutoplay()
 
 void DisplayExitMessage(char *format, va_list ap)
 {
+  // also check for initialized video (headless flag may be temporarily unset)
+  if (program.headless || !video.initialized)
+    return;
+
   // check if draw buffer and fonts for exit message are already available
   if (drawto == NULL || font_initial[NUM_INITIAL_FONTS - 1].bitmap == NULL)
     return;
@@ -5991,9 +6006,11 @@ void OpenAll()
 
   print_timestamp_time("[init setup/config stuff]");
 
+  InitVideoDefaults();
   InitVideoDisplay();
   InitVideoBuffer(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH, setup.fullscreen);
 
+  InitTileCursorInfo();
   InitOverlayInfo();
 
   print_timestamp_time("[init video stuff]");