From 957bd13ee6bd1ab827435f4859d8e53f126891ef Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 13 Dec 2023 17:56:35 +0100 Subject: [PATCH] changed setup option to disable global animations to only affect toons All global animations can still be disabled in the setup config file, but this should probably only be used for testing purposes, as global animations are an integral part of certain custom level sets now. --- src/anim.c | 7 ++++++- src/files.c | 5 +++++ src/init.c | 6 +++--- src/libgame/system.h | 1 + src/screens.c | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/anim.c b/src/anim.c index cdc0fd05..b651ac6f 100644 --- a/src/anim.c +++ b/src/anim.c @@ -780,7 +780,7 @@ static void DrawGlobalAnimationsExt(int drawing_target, int drawing_stage) int mode_nr; int i; - if (!setup.toons) + if (!setup.global_animations) return; if (drawing_stage == DRAW_GLOBAL_ANIM_STAGE_1 && @@ -890,6 +890,11 @@ static void DrawGlobalAnimationsExt(int drawing_target, int drawing_stage) int frame; int last_anim_random_frame = gfx.anim_random_frame; + if (!setup.toons && + part->graphic >= IMG_TOON_1 && + part->graphic <= IMG_TOON_20) + continue; + // when preparing source fading buffer, only draw animations to be stopped if (drawing_target == DRAW_TO_FADE_SOURCE && game_mode_anim_action[part->mode_nr] != ANIM_STOP) diff --git a/src/files.c b/src/files.c index c4881f64..671a8515 100644 --- a/src/files.c +++ b/src/files.c @@ -9490,6 +9490,10 @@ static struct TokenInfo global_setup_tokens[] = TYPE_SWITCH, &setup.toons, "toons" }, + { + TYPE_SWITCH, + &setup.global_animations, "global_animations" + }, { TYPE_SWITCH, &setup.scroll_delay, "scroll_delay" @@ -10409,6 +10413,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->sound_music = TRUE; si->sound_simple = TRUE; si->toons = TRUE; + si->global_animations = TRUE; si->scroll_delay = TRUE; si->forced_scroll_delay = FALSE; si->scroll_delay_value = STD_SCROLL_DELAY; diff --git a/src/init.c b/src/init.c index af11e4c7..62a5d0ff 100644 --- a/src/init.c +++ b/src/init.c @@ -6477,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(); } @@ -6671,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); diff --git a/src/libgame/system.h b/src/libgame/system.h index bcfee01e..73d50ddc 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1518,6 +1518,7 @@ struct SetupInfo boolean sound_music; boolean sound_simple; boolean toons; + boolean global_animations; boolean scroll_delay; boolean forced_scroll_delay; int scroll_delay_value; diff --git a/src/screens.c b/src/screens.c index c919220e..fc344373 100644 --- a/src/screens.c +++ b/src/screens.c @@ -7548,7 +7548,7 @@ static struct TokenInfo setup_info_graphics[] = { TYPE_SWITCH, &setup.quick_switch, "Quick Player Focus Switch:" }, { TYPE_SWITCH, &setup.quick_doors, "Quick Menu Doors:" }, { TYPE_SWITCH, &setup.show_titlescreen,"Show Title Screens:" }, - { TYPE_SWITCH, &setup.toons, "Show Menu Animations:" }, + { TYPE_SWITCH, &setup.toons, "Show Toons:" }, { TYPE_SWITCH, &setup.small_game_graphics, "Small Game Graphics:" }, { TYPE_YES_NO_AUTO, &setup.debug.xsn_mode, debug_xsn_mode }, { TYPE_EMPTY, NULL, "" }, -- 2.34.1