From: Holger Schemel Date: Sat, 25 May 2024 10:02:34 +0000 (+0200) Subject: added setup option for fast game start from level editor X-Git-Tag: 4.4.0.0-test-2~18 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=3186a3cfcac48b25b8de9f77c78bc76f932c1e30;p=rocksndiamonds.git added setup option for fast game start from level editor --- diff --git a/src/editor.c b/src/editor.c index 0ab57221..c105afcd 100644 --- a/src/editor.c +++ b/src/editor.c @@ -7389,9 +7389,9 @@ static struct XY xy_directions[] = // functions // ---------------------------------------------------------------------------- -boolean isLevelEditorTestGame(void) +boolean isLevelEditorFastStart(void) { - return level_editor_test_game; + return (level_editor_test_game && setup.editor.fast_game_start); } static int getMaxInfoTextLength(void) diff --git a/src/editor.h b/src/editor.h index 96fe6f29..8dd3e390 100644 --- a/src/editor.h +++ b/src/editor.h @@ -14,7 +14,7 @@ #include "main.h" -boolean isLevelEditorTestGame(void); +boolean isLevelEditorFastStart(void); void CreateLevelEditorGadgets(void); void FreeLevelEditorGadgets(void); diff --git a/src/files.c b/src/files.c index 9779f83f..7d4dc9d0 100644 --- a/src/files.c +++ b/src/files.c @@ -11064,6 +11064,10 @@ static struct TokenInfo editor_setup_tokens[] = TYPE_SWITCH, &setup.editor.show_element_token, "editor.show_element_token" }, + { + TYPE_SWITCH, + &setup.editor.fast_game_start, "editor.fast_game_start" + }, { TYPE_SWITCH, &setup.editor.show_read_only_warning, "editor.show_read_only_warning" @@ -11826,6 +11830,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->editor.el_headlines = TRUE; si->editor.show_element_token = FALSE; + si->editor.fast_game_start = FALSE; si->editor.show_read_only_warning = TRUE; diff --git a/src/game_bd/import_bd.h b/src/game_bd/import_bd.h index ace426db..53af1639 100644 --- a/src/game_bd/import_bd.h +++ b/src/game_bd/import_bd.h @@ -38,6 +38,6 @@ byte *TapePlayAction_BD(void); byte *TapeCorrectAction_BD(byte *); boolean TapeIsPlaying_ReplayBD(void); -boolean isLevelEditorTestGame(void); +boolean isLevelEditorFastStart(void); #endif // IMPORT_BD_H diff --git a/src/game_bd/main_bd.c b/src/game_bd/main_bd.c index 574edc3f..333bddea 100644 --- a/src/game_bd/main_bd.c +++ b/src/game_bd/main_bd.c @@ -360,10 +360,10 @@ void InitGameEngine_BD(void) // when skipping uncovering, continue with uncovered playfield if (setup.bd_skip_uncovering) game_bd.game->state_counter = GAME_INT_UNCOVER_ALL + 1; - else if (isLevelEditorTestGame()) + else if (isLevelEditorFastStart()) game_bd.game->state_counter = GAME_INT_UNCOVER_ALL - 8; - if (setup.bd_skip_uncovering || isLevelEditorTestGame()) + if (setup.bd_skip_uncovering || isLevelEditorFastStart()) gd_scroll(game_bd.game, TRUE, TRUE); ClearRectangle(gd_screen_bitmap, 0, 0, SXSIZE, SYSIZE); diff --git a/src/libgame/system.h b/src/libgame/system.h index 7669474f..85c26a5f 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1322,6 +1322,7 @@ struct SetupEditorInfo boolean el_by_type; boolean show_element_token; + boolean fast_game_start; boolean show_read_only_warning; diff --git a/src/screens.c b/src/screens.c index d518304b..0a891b6b 100644 --- a/src/screens.c +++ b/src/screens.c @@ -8047,6 +8047,7 @@ static struct TokenInfo setup_info_editor[] = { TYPE_EMPTY, NULL, "" }, #endif { TYPE_SWITCH, &setup.editor.show_element_token, "Show element token:" }, + { TYPE_SWITCH, &setup.editor.fast_game_start, "Fast game start:" }, { TYPE_EMPTY, NULL, "" }, { TYPE_SWITCH, &setup.editor.show_read_only_warning, "Show read-only warning:" }, { TYPE_EMPTY, NULL, "" },