added restoring initial value for game element transparency
authorHolger Schemel <info@artsoft.org>
Sat, 27 Nov 2021 23:53:52 +0000 (00:53 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 22 Jan 2022 16:58:29 +0000 (17:58 +0100)
src/game.c
src/game.h
src/init.c

index 367a86a4e38ed0663bc41a4ad40075ff393e0880..d197e6b32f96a2e0bac70b6a366c86a362a53aa3 100644 (file)
@@ -3845,6 +3845,9 @@ void InitGame(void)
 
   game.envelope_active = FALSE;
 
+  // special case: set custom artwork setting to initial value
+  game.use_masked_elements = game.use_masked_elements_initial;
+
   for (i = 0; i < NUM_BELTS; i++)
   {
     game.belt_dir[i] = MV_NONE;
index 89ec940c23a33818c77b5ae80771645f409d4435..94144e3ee098210028344015c60bab38432b8e5e 100644 (file)
@@ -162,6 +162,7 @@ struct GameInfo
   boolean use_native_sp_graphics_engine;
   boolean use_masked_pushing;
   boolean use_masked_elements;
+  boolean use_masked_elements_initial;
   int forced_scroll_delay_value;
   int scroll_delay_value;
   int tile_size;
index 0f5a74cc0a9d2eb488aa507356b51adf4b9ed348..079ece2f796b6f6071b82fb5e413329393cf90ab 100644 (file)
@@ -2236,6 +2236,13 @@ static void InitMusicInfo(void)
   }
 }
 
+
+static void InitGameInfoFromArtworkInfo(void)
+{
+  // special case: store initial value of custom artwork setting
+  game.use_masked_elements_initial = game.use_masked_elements;
+}
+
 static void ReinitializeGraphics(void)
 {
   print_timestamp_init("ReinitializeGraphics");
@@ -2279,6 +2286,8 @@ static void ReinitializeGraphics(void)
   InitDoors();
   print_timestamp_time("InitDoors");
 
+  InitGameInfoFromArtworkInfo();
+
   print_timestamp_done("ReinitializeGraphics");
 }
 
@@ -5307,6 +5316,8 @@ static void InitGameInfo(void)
 
   game.request_active = FALSE;
   game.request_active_or_moving = FALSE;
+
+  game.use_masked_elements_initial = FALSE;
 }
 
 static void InitPlayerInfo(void)