From: Holger Schemel Date: Sat, 27 Nov 2021 23:53:52 +0000 (+0100) Subject: added restoring initial value for game element transparency X-Git-Tag: 4.3.1.0~6 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=3a9fc7d57928ecf8fbd12c525bcd2cb74dd5fc2d added restoring initial value for game element transparency --- diff --git a/src/game.c b/src/game.c index 367a86a4..d197e6b3 100644 --- a/src/game.c +++ b/src/game.c @@ -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; diff --git a/src/game.h b/src/game.h index 89ec940c..94144e3e 100644 --- a/src/game.h +++ b/src/game.h @@ -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; diff --git a/src/init.c b/src/init.c index 0f5a74cc..079ece2f 100644 --- a/src/init.c +++ b/src/init.c @@ -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)