rnd-20070331-1-src
authorHolger Schemel <info@artsoft.org>
Fri, 30 Mar 2007 22:52:45 +0000 (00:52 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:55:14 +0000 (10:55 +0200)
* added option "game.forced_scroll_delay_value" to override user choice
  of scroll delay value for certain level sets with "graphicsinfo.conf"

ChangeLog
src/conf_gfx.c
src/conf_var.c
src/conftime.h
src/files.c
src/game.c
src/game.h
src/game_em/graphics.c
src/main.h

index de283ca87e0a3358b5e11e6daa18189c59d9dfaf..bbccc0d339e5009c7fb78f061d8e85142804d66b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
        * 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.)
+       * added option "game.forced_scroll_delay_value" to override user choice
+         of scroll delay value for certain level sets with "graphicsinfo.conf"
 
 2007-03-28
        * added displaying of most game panel control elements (not animated)
index 969f8b2814c3735c5113db379ba76a2020aa6be5..c61b062cfc3bafca7c51d567426da36831092b99 100644 (file)
@@ -5730,6 +5730,8 @@ struct ConfigInfo image_config[] =
   { "game.button.sound_simple.x",              "65"                    },
   { "game.button.sound_simple.y",              "245"                   },
 
+  { "game.forced_scroll_delay_value",          "-1"                    },
+
   { "[player].boring_delay_fixed",             "1000"                  },
   { "[player].boring_delay_random",            "1000"                  },
   { "[player].sleeping_delay_fixed",           "2000"                  },
index 349a5991e45aa6d485641ded8e33106e17938fb6..45ad7dc98ff699b510bb4479bf48db74da9ed4c8 100644 (file)
@@ -2840,6 +2840,10 @@ struct TokenIntPtrInfo image_config_vars[] =
     "game.button.sound_simple.y",
     &game.button.sound_simple.y
   },
+  {
+    "game.forced_scroll_delay_value",
+    &game.forced_scroll_delay_value
+  },
   {
     "[player].boring_delay_fixed",
     &game.player_boring_delay_fixed
index aa9026974be45b6afd55ad3be1755579e953bf53..1acac4851393c3c3b19152ac1ff98057b170666d 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "2007-03-30 13:31"
+#define COMPILE_DATE_STRING "2007-03-31 00:47"
index be1bd3c7fc3395550c1928bd6bed78cf837c3e58..8e686b897f17f87933c1ba6198a3532abdfaa459 100644 (file)
@@ -7968,7 +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->scroll_delay_value = STD_SCROLL_DELAY;
   si->soft_scrolling = TRUE;
   si->fade_screens = TRUE;
   si->autorecord = TRUE;
index 6826707146c02d55be3f7bfbd9aba33ea0fe7b7f..d580212fd8e725218ce9cb3cdc68ceff033ecbbc 100644 (file)
@@ -2875,6 +2875,13 @@ static void InitGameEngine()
   recursion_loop_depth = 0;
   recursion_loop_detected = FALSE;
   recursion_loop_element = EL_UNDEFINED;
+
+  /* ---------- initialize graphics engine ---------------------------------- */
+  game.scroll_delay_value =
+    (game.forced_scroll_delay_value != -1 ? game.forced_scroll_delay_value :
+     setup.scroll_delay                   ? setup.scroll_delay_value       : 0);
+  game.scroll_delay_value =
+    MIN(MAX(MIN_SCROLL_DELAY, game.scroll_delay_value), MAX_SCROLL_DELAY);
 }
 
 int get_num_special_action(int element, int action_first, int action_last)
@@ -4523,7 +4530,7 @@ void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir,
 
   if (quick_relocation)
   {
-    int offset = (setup.scroll_delay ? setup.scroll_delay_value : 0);
+    int offset = game.scroll_delay_value;
 
     if (!IN_VIS_FIELD(SCREENX(x), SCREENY(y)) || center_screen)
     {
@@ -12146,7 +12153,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 ? setup.scroll_delay_value : 0);
+    int offset = game.scroll_delay_value;
 
     if (!IN_VIS_FIELD(SCREENX(jx), SCREENY(jy)))
     {
index b658d1f4ec1052f22e4af97ab4b4437fff106597..d02c5cedc1a52d51fef6a8f6498be71eabb11f05 100644 (file)
@@ -118,6 +118,10 @@ struct GameInfo
   struct GamePanelInfo panel;
   struct GameButtonInfo button;
 
+  /* values for graphics engine customization */
+  int forced_scroll_delay_value;
+  int scroll_delay_value;
+
   /* values for engine initialization */
   int default_push_delay_fixed;
   int default_push_delay_random;
index a55909afc7540958beaf1909c03a9932f39bf513..68f1c297bf6dfae913ddef9b5c8b061ef5ba6db1 100644 (file)
@@ -522,7 +522,7 @@ void DrawRelocatePlayer(struct PlayerInfo *player, boolean quick_relocation)
 
   if (quick_relocation)
   {
-    int offset = (setup.scroll_delay ? setup.scroll_delay_value : 0);
+    int offset = game.scroll_delay_value;
 
     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 ? setup.scroll_delay_value : 0) * TILEX;
+  int offset = game.scroll_delay_value * TILEX;
   int offset_x = offset;
   int offset_y = offset;
   int screen_x_old = screen_x;
index 0ca05c7c94b7256f191fb4a398f37df8b084f730..32d81de6e43e9fa9a91281378a63033b364718b3 100644 (file)
 #define MAX_LEV_FIELDX                 MAX_PLAYFIELD_WIDTH
 #define MAX_LEV_FIELDY                 MAX_PLAYFIELD_HEIGHT
 
+#define MIN_SCROLL_DELAY               0
+#define STD_SCROLL_DELAY               3
+#define MAX_SCROLL_DELAY               9
+
 #define SCREENX(a)                     ((a) - scroll_x)
 #define SCREENY(a)                     ((a) - scroll_y)
 #define LEVELX(a)                      ((a) + scroll_x)