added setup option to force scroll delay when using the EM engine
authorHolger Schemel <info@artsoft.org>
Thu, 20 Feb 2020 10:42:34 +0000 (11:42 +0100)
committerHolger Schemel <info@artsoft.org>
Tue, 19 May 2020 16:19:59 +0000 (18:19 +0200)
The default value is not to force the configured scroll delay value
when playing levels with the EM engine, but always center the screen.

src/files.c
src/game.c
src/libgame/system.h
src/screens.c

index 14f9f175cd7ab6be38ee36b66432b63b85f5b2c3..d4751ae52b8a4cfb6622a499e9f4f5d3e302be84 100644 (file)
@@ -8367,6 +8367,10 @@ static struct TokenInfo global_setup_tokens[] =
     TYPE_SWITCH,
     &setup.scroll_delay,                       "scroll_delay"
   },
+  {
+    TYPE_SWITCH,
+    &setup.forced_scroll_delay,                        "forced_scroll_delay"
+  },
   {
     TYPE_INTEGER,
     &setup.scroll_delay_value,                 "scroll_delay_value"
@@ -9112,6 +9116,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   si->sound_simple = TRUE;
   si->toons = TRUE;
   si->scroll_delay = TRUE;
+  si->forced_scroll_delay = FALSE;
   si->scroll_delay_value = STD_SCROLL_DELAY;
   si->engine_snapshot_mode = getStringCopy(STR_SNAPSHOT_MODE_DEFAULT);
   si->engine_snapshot_memory = SNAPSHOT_MEMORY_DEFAULT;
index 23650858360e773404ce8b050b1bbffba1234266..862c5083d0c2d974b13eeadf6754b9fcfcf162c4 100644 (file)
@@ -3255,6 +3255,8 @@ static void InitGameEngine(void)
   // ---------- initialize graphics engine ------------------------------------
   game.scroll_delay_value =
     (game.forced_scroll_delay_value != -1 ? game.forced_scroll_delay_value :
+     level.game_engine_type == GAME_ENGINE_TYPE_EM &&
+     !setup.forced_scroll_delay           ? 0 :
      setup.scroll_delay                   ? setup.scroll_delay_value       : 0);
   game.scroll_delay_value =
     MIN(MAX(MIN_SCROLL_DELAY, game.scroll_delay_value), MAX_SCROLL_DELAY);
index 8b7de610cc551a6f61802e3deaaaa4ca1f1d9752..d9c1b002be000dcaaefd3ce61c451eaebc35d66c 100644 (file)
@@ -1359,6 +1359,7 @@ struct SetupInfo
   boolean sound_simple;
   boolean toons;
   boolean scroll_delay;
+  boolean forced_scroll_delay;
   int scroll_delay_value;
   char *engine_snapshot_mode;
   int engine_snapshot_memory;
index b4f2e5fc8d46003189d0d2abf4c0435be3226116..b8c34820eecdb12837868ce57088e204a65c3222 100644 (file)
@@ -6255,6 +6255,7 @@ static struct TokenInfo setup_info_game[] =
   { TYPE_ENTER_LIST,   execSetupChooseScrollDelay, "Scroll Delay:"     },
   { TYPE_STRING,       &scroll_delay_text,     ""                      },
 #endif
+  { TYPE_SWITCH,       &setup.forced_scroll_delay,"Scroll Delay in EM engine:" },
   { TYPE_ENTER_LIST, execSetupChooseSnapshotMode,"Game Engine Snapshot Mode:" },
   { TYPE_STRING,       &snapshot_mode_text,    ""                      },
   { TYPE_SWITCH,       &setup.show_snapshot_buttons,"Show Snapshot Buttons:" },