changed setup option to disable global animations to only affect toons
authorHolger Schemel <info@artsoft.org>
Wed, 13 Dec 2023 16:56:35 +0000 (17:56 +0100)
committerHolger Schemel <info@artsoft.org>
Wed, 13 Dec 2023 16:57:26 +0000 (17:57 +0100)
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
src/files.c
src/init.c
src/libgame/system.h
src/screens.c

index cdc0fd0574363fc39f82a6dd9c19fd5f1060a77d..b651ac6fc5cbe1e31556d82b2585415a6149a180 100644 (file)
@@ -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)
index c4881f64fff85756c90754a210f51a4dbf834b5b..671a85154fdbe4656ce468e2bc83e55cbcbe2cf3 100644 (file)
@@ -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;
index af11e4c7a5242329fcab1d5c112ddf05c50b90bb..62a5d0ff860865ef4d203e8b71f2b30da8b23ff7 100644 (file)
@@ -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);
index bcfee01ebb66f28c7c2de13e41861bf6bef76bc1..73d50ddc0b4ccfcb2b9df2c6b908aa197fae4b61 100644 (file)
@@ -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;
index c919220ef8f8b680792b44d25b9a8564755b9acf..fc344373d34d7734a24d93d5bc79d49d828bba97 100644 (file)
@@ -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,                   ""                      },