added optional button to restart game (door, panel and touch variants)
[rocksndiamonds.git] / src / init.c
index ea7167fe566996f283d05e97b6d9354b2afd865a..62a5d0ff860865ef4d203e8b71f2b30da8b23ff7 100644 (file)
@@ -1412,6 +1412,7 @@ static void set_graphic_parameters_ext(int graphic, int *parameter,
   g->sort_priority = 0;                        // default for title screens
   g->class = 0;
   g->style = STYLE_DEFAULT;
+  g->alpha = -1;
 
   g->bitmaps = src_bitmaps;
   g->bitmap = src_bitmap;
@@ -1648,7 +1649,7 @@ static void set_graphic_parameters_ext(int graphic, int *parameter,
   g->draw_yoffset = parameter[GFX_ARG_DRAW_YOFFSET];
 
   // use a different default value for global animations and toons
-  if ((graphic >= IMG_GFX_GLOBAL_ANIM_1 && graphic <= IMG_GFX_GLOBAL_ANIM_8) ||
+  if ((graphic >= IMG_GFX_GLOBAL_ANIM_1 && graphic <= IMG_GFX_GLOBAL_ANIM_32) ||
       (graphic >= IMG_TOON_1            && graphic <= IMG_TOON_20))
     g->draw_masked = TRUE;
 
@@ -1686,6 +1687,8 @@ static void set_graphic_parameters_ext(int graphic, int *parameter,
     g->class = parameter[GFX_ARG_CLASS];
   if (parameter[GFX_ARG_STYLE] != ARG_UNDEFINED_VALUE)
     g->style = parameter[GFX_ARG_STYLE];
+  if (parameter[GFX_ARG_ALPHA] != ARG_UNDEFINED_VALUE)
+    g->alpha = parameter[GFX_ARG_ALPHA];
 
   // this is only used for drawing menu buttons and text
   g->active_xoffset = parameter[GFX_ARG_ACTIVE_XOFFSET];
@@ -5490,9 +5493,7 @@ static void InitSetup(void)
 static void InitGameInfo(void)
 {
   game.restart_level = FALSE;
-
   game.request_active = FALSE;
-  game.request_active_or_moving = FALSE;
 
   game.use_masked_elements_initial = FALSE;
 }
@@ -5890,6 +5891,9 @@ static void InitGfx(void)
     checked_free(filename_image_initial[i]);
   }
 
+  for (i = 0; i < NUM_INITIAL_IMAGES; i++)
+    image_initial[i].use_image_size = TRUE;
+
   graphic_info = image_initial;                // graphic == 0 => image_initial
 
   for (i = 0; i < NUM_INITIAL_IMAGES; i++)
@@ -5914,6 +5918,7 @@ static void InitGfx(void)
   InitGfxDrawGlobalAnimFunction(DrawGlobalAnimations);
   InitGfxDrawGlobalBorderFunction(DrawMaskedBorderToTarget);
   InitGfxDrawTileCursorFunction(DrawTileCursor);
+  InitGfxDrawEnvelopeRequestFunction(DrawEnvelopeRequestToScreen);
 
   gfx.fade_border_source_status = global.border_status;
   gfx.fade_border_target_status = global.border_status;
@@ -6472,8 +6477,8 @@ void DisplayExitMessage(char *format, va_list ap)
 
   BackToFront();
 
-  // deactivate toons on error message screen
-  setup.toons = FALSE;
+  // deactivate toons and global animations on error message screen
+  setup.global_animations = FALSE;
 
   WaitForEventToContinue();
 }
@@ -6666,7 +6671,7 @@ static boolean WaitForApiThreads(void)
     return TRUE;
 
   // deactivate global animations (not accessible in game state "loading")
-  setup.toons = FALSE;
+  setup.global_animations = FALSE;
 
   // set game state to "loading" to be able to show busy animation
   SetGameStatus(GAME_MODE_LOADING);