From: Holger Schemel Date: Tue, 3 Dec 2024 19:58:21 +0000 (+0100) Subject: fixed initializing color template images before fading out game screen X-Git-Tag: 4.4.0.0-test-5~16 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=0563c4e6ee7e79695e7d3656729ba0625a208a3d;p=rocksndiamonds.git fixed initializing color template images before fading out game screen --- diff --git a/src/game.c b/src/game.c index 5a58b1c2..b9b8f2f7 100644 --- a/src/game.c +++ b/src/game.c @@ -3723,6 +3723,9 @@ void InitGame(void) FadeOut(fade_mask); + if (game.InitColorTemplateImagesNeeded) + InitColorTemplateImages(); + if (restarting) { // force restarting global animations displayed during game play diff --git a/src/game.h b/src/game.h index 0553d8da..430e3775 100644 --- a/src/game.h +++ b/src/game.h @@ -291,6 +291,8 @@ struct GameInfo boolean RestartGameRequested; boolean InitGameRequested; + + boolean InitColorTemplateImagesNeeded; }; struct PlayerInfo diff --git a/src/init.c b/src/init.c index acb25874..1355af88 100644 --- a/src/init.c +++ b/src/init.c @@ -381,15 +381,27 @@ void InitColorTemplateImages(void) CreateImgesFromColorTemplate(i, GetColoredBitmapFromTemplate_BD); InitImageTextures(); + + game.InitColorTemplateImagesNeeded = FALSE; } void InitColorTemplateImagesIfNeeded(void) { + game.InitColorTemplateImagesNeeded = FALSE; + if (program.headless) return; - if (anyImagehasColorTemplate()) - InitColorTemplateImages(); + if (!anyImagehasColorTemplate()) + return; + + game.InitColorTemplateImagesNeeded = TRUE; + + // if game still playing, init color template images later + if (game_status == GAME_MODE_PLAYING) + return; + + InitColorTemplateImages(); } void InitImageTextures(void)