From: Holger Schemel Date: Thu, 20 Feb 2020 10:42:34 +0000 (+0100) Subject: added setup option to force scroll delay when using the EM engine X-Git-Tag: 4.2.0.0~82 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=a8167a69b6d4a308f4501b55609ec66dd3082375;p=rocksndiamonds.git added setup option to force scroll delay when using the EM engine The default value is not to force the configured scroll delay value when playing levels with the EM engine, but always center the screen. --- diff --git a/src/files.c b/src/files.c index 14f9f175..d4751ae5 100644 --- a/src/files.c +++ b/src/files.c @@ -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; diff --git a/src/game.c b/src/game.c index 23650858..862c5083 100644 --- a/src/game.c +++ b/src/game.c @@ -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); diff --git a/src/libgame/system.h b/src/libgame/system.h index 8b7de610..d9c1b002 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -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; diff --git a/src/screens.c b/src/screens.c index b4f2e5fc..b8c34820 100644 --- a/src/screens.c +++ b/src/screens.c @@ -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:" },