From 0fa270ea50e806d9af79d08a9bf9386593a4e6cb Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 30 Mar 2007 13:58:55 +0200 Subject: [PATCH] rnd-20070330-1-src * added (currently invisible) setup option to define scroll delay value * fixed small bug in priority handling when auto-detecting level start position in levels without player element (but player from CE etc.) --- ChangeLog | 5 ++++ src/conftime.h | 2 +- src/files.c | 53 ++++++++++++++++++++++-------------------- src/game.c | 13 +++++++---- src/game_em/graphics.c | 4 ++-- src/libgame/system.h | 1 + 6 files changed, 45 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8c5aafdb..de283ca8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-03-30 + * added (currently invisible) setup option to define scroll delay value + * fixed small bug in priority handling when auto-detecting level start + position in levels without player element (but player from CE etc.) + 2007-03-28 * added displaying of most game panel control elements (not animated) diff --git a/src/conftime.h b/src/conftime.h index b19271da..aa902697 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2007-03-29 01:00" +#define COMPILE_DATE_STRING "2007-03-30 13:31" diff --git a/src/files.c b/src/files.c index 88ca1817..be1bd3c7 100644 --- a/src/files.c +++ b/src/files.c @@ -7684,31 +7684,32 @@ void SaveScore(int nr) #define SETUP_TOKEN_SOUND_SIMPLE 4 #define SETUP_TOKEN_TOONS 5 #define SETUP_TOKEN_SCROLL_DELAY 6 -#define SETUP_TOKEN_SOFT_SCROLLING 7 -#define SETUP_TOKEN_FADE_SCREENS 8 -#define SETUP_TOKEN_AUTORECORD 9 -#define SETUP_TOKEN_SHOW_TITLESCREEN 10 -#define SETUP_TOKEN_QUICK_DOORS 11 -#define SETUP_TOKEN_TEAM_MODE 12 -#define SETUP_TOKEN_HANDICAP 13 -#define SETUP_TOKEN_SKIP_LEVELS 14 -#define SETUP_TOKEN_TIME_LIMIT 15 -#define SETUP_TOKEN_FULLSCREEN 16 -#define SETUP_TOKEN_FULLSCREEN_MODE 17 -#define SETUP_TOKEN_ASK_ON_ESCAPE 18 -#define SETUP_TOKEN_ASK_ON_ESCAPE_EDITOR 19 -#define SETUP_TOKEN_QUICK_SWITCH 20 -#define SETUP_TOKEN_INPUT_ON_FOCUS 21 -#define SETUP_TOKEN_PREFER_AGA_GRAPHICS 22 -#define SETUP_TOKEN_GAME_FRAME_DELAY 23 -#define SETUP_TOKEN_GRAPHICS_SET 24 -#define SETUP_TOKEN_SOUNDS_SET 25 -#define SETUP_TOKEN_MUSIC_SET 26 -#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS 27 -#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS 28 -#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC 29 - -#define NUM_GLOBAL_SETUP_TOKENS 30 +#define SETUP_TOKEN_SCROLL_DELAY_VALUE 7 +#define SETUP_TOKEN_SOFT_SCROLLING 8 +#define SETUP_TOKEN_FADE_SCREENS 9 +#define SETUP_TOKEN_AUTORECORD 10 +#define SETUP_TOKEN_SHOW_TITLESCREEN 11 +#define SETUP_TOKEN_QUICK_DOORS 12 +#define SETUP_TOKEN_TEAM_MODE 13 +#define SETUP_TOKEN_HANDICAP 14 +#define SETUP_TOKEN_SKIP_LEVELS 15 +#define SETUP_TOKEN_TIME_LIMIT 16 +#define SETUP_TOKEN_FULLSCREEN 17 +#define SETUP_TOKEN_FULLSCREEN_MODE 18 +#define SETUP_TOKEN_ASK_ON_ESCAPE 19 +#define SETUP_TOKEN_ASK_ON_ESCAPE_EDITOR 20 +#define SETUP_TOKEN_QUICK_SWITCH 21 +#define SETUP_TOKEN_INPUT_ON_FOCUS 22 +#define SETUP_TOKEN_PREFER_AGA_GRAPHICS 23 +#define SETUP_TOKEN_GAME_FRAME_DELAY 24 +#define SETUP_TOKEN_GRAPHICS_SET 25 +#define SETUP_TOKEN_SOUNDS_SET 26 +#define SETUP_TOKEN_MUSIC_SET 27 +#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS 28 +#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS 29 +#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC 30 + +#define NUM_GLOBAL_SETUP_TOKENS 31 /* editor setup */ #define SETUP_TOKEN_EDITOR_EL_BOULDERDASH 0 @@ -7812,6 +7813,7 @@ static struct TokenInfo global_setup_tokens[] = { TYPE_SWITCH, &si.sound_simple, "simple_sound_effects" }, { TYPE_SWITCH, &si.toons, "toons" }, { TYPE_SWITCH, &si.scroll_delay, "scroll_delay" }, + { TYPE_INTEGER,&si.scroll_delay_value,"scroll_delay_value" }, { TYPE_SWITCH, &si.soft_scrolling, "soft_scrolling" }, { TYPE_SWITCH, &si.fade_screens, "fade_screens" }, { TYPE_SWITCH, &si.autorecord, "automatic_tape_recording" }, @@ -7966,6 +7968,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->double_buffering = TRUE; si->direct_draw = !si->double_buffering; si->scroll_delay = TRUE; + si->scroll_delay_value = 9; si->soft_scrolling = TRUE; si->fade_screens = TRUE; si->autorecord = TRUE; diff --git a/src/game.c b/src/game.c index 25407197..68267071 100644 --- a/src/game.c +++ b/src/game.c @@ -3403,7 +3403,8 @@ void InitGame() content = element_info[element].change_page[i].target_element; is_player = ELEM_IS_PLAYER(content); - if (is_player && (found_rating < 3 || element < found_element)) + if (is_player && (found_rating < 3 || + (found_rating == 3 && element < found_element))) { start_x = x; start_y = y; @@ -3420,7 +3421,8 @@ void InitGame() content = element_info[element].content.e[xx][yy]; is_player = ELEM_IS_PLAYER(content); - if (is_player && (found_rating < 2 || element < found_element)) + if (is_player && (found_rating < 2 || + (found_rating == 2 && element < found_element))) { start_x = x + xx - 1; start_y = y + yy - 1; @@ -3440,7 +3442,8 @@ void InitGame() is_player = ELEM_IS_PLAYER(content); - if (is_player && (found_rating < 1 || element < found_element)) + if (is_player && (found_rating < 1 || + (found_rating == 1 && element < found_element))) { start_x = x + xx - 1; start_y = y + yy - 1; @@ -4520,7 +4523,7 @@ void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir, if (quick_relocation) { - int offset = (setup.scroll_delay ? 3 : 0); + int offset = (setup.scroll_delay ? setup.scroll_delay_value : 0); if (!IN_VIS_FIELD(SCREENX(x), SCREENY(y)) || center_screen) { @@ -12143,7 +12146,7 @@ boolean MovePlayer(struct PlayerInfo *player, int dx, int dy) #endif { int old_scroll_x = scroll_x, old_scroll_y = scroll_y; - int offset = (setup.scroll_delay ? 3 : 0); + int offset = (setup.scroll_delay ? setup.scroll_delay_value : 0); if (!IN_VIS_FIELD(SCREENX(jx), SCREENY(jy))) { diff --git a/src/game_em/graphics.c b/src/game_em/graphics.c index b443991d..a55909af 100644 --- a/src/game_em/graphics.c +++ b/src/game_em/graphics.c @@ -522,7 +522,7 @@ void DrawRelocatePlayer(struct PlayerInfo *player, boolean quick_relocation) if (quick_relocation) { - int offset = (setup.scroll_delay ? 3 : 0); + int offset = (setup.scroll_delay ? setup.scroll_delay_value : 0); if (!IN_VIS_FIELD(SCREENX(jx), SCREENY(jy))) { @@ -726,7 +726,7 @@ void RedrawPlayfield_EM(boolean force_redraw) int player_nr = game_em.last_moving_player; #endif int stepsize = TILEX / 8; - int offset = (setup.scroll_delay ? 3 : 0) * TILEX; + int offset = (setup.scroll_delay ? setup.scroll_delay_value : 0) * TILEX; int offset_x = offset; int offset_y = offset; int screen_x_old = screen_x; diff --git a/src/libgame/system.h b/src/libgame/system.h index 12fea19b..8de71071 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -812,6 +812,7 @@ struct SetupInfo boolean double_buffering; boolean direct_draw; /* !double_buffering (redundant!) */ boolean scroll_delay; + boolean scroll_delay_value; boolean soft_scrolling; boolean fade_screens; boolean autorecord; -- 2.34.1