code cleanup (by using function to reset delay counter)
authorHolger Schemel <info@artsoft.org>
Sun, 13 Jun 2021 09:57:37 +0000 (11:57 +0200)
committerHolger Schemel <info@artsoft.org>
Sun, 13 Jun 2021 09:57:37 +0000 (11:57 +0200)
src/events.c
src/game_mm/mm_tools.c
src/libgame/gadgets.c
src/tools.c

index fe82932a746867dcfd26d64f01208ecf2e8e0a2f..c2548e5f0e065959b917399a795faf078dbbd6b5 100644 (file)
@@ -108,7 +108,7 @@ static int FilterEvents(const Event *event)
     {
       SetMouseCursor(CURSOR_DEFAULT);
 
-      DelayReached(&special_cursor_delay, 0);
+      ResetDelayCounter(&special_cursor_delay);
 
       cursor_mode_last = CURSOR_DEFAULT;
     }
@@ -336,7 +336,7 @@ static void HandleMouseCursor(void)
 
     // display normal pointer if mouse pressed
     if (button_status != MB_RELEASED)
-      DelayReached(&special_cursor_delay, 0);
+      ResetDelayCounter(&special_cursor_delay);
 
     if (gfx.cursor_mode != CURSOR_PLAYFIELD &&
        cursor_inside_playfield &&
index e71fb1d444955acaf32a19dab121d76f3cfc9b77..21ad08144351dab725e4e6ec23be4330767a3056 100644 (file)
@@ -946,7 +946,7 @@ static void DrawTileCursor_Xsn(int draw_target)
     debug = TRUE;
     active = FALSE;
 
-    DelayReached(&check_delay, 0);
+    ResetDelayCounter(&check_delay);
 
     setup.debug.xsn_mode = (debug_value > 0);
     tile_cursor.xsn_debug = FALSE;
@@ -1000,7 +1000,7 @@ static void DrawTileCursor_Xsn(int draw_target)
                         (XSN_START_DELAY + XSN_RND(XSN_START_DELAY)) * 1000);
     started = FALSE;
 
-    DelayReached(&start_delay, 0);
+    ResetDelayCounter(&start_delay);
 
     reinitialize = TRUE;
   }
@@ -1079,9 +1079,9 @@ static void DrawTileCursor_Xsn(int draw_target)
     growth_delay_value = XSN_GROWTH_DELAY * 1000;
     change_delay_value = XSN_CHANGE_DELAY * 1000;
 
-    DelayReached(&growth_delay, 0);
-    DelayReached(&update_delay, 0);
-    DelayReached(&change_delay, 0);
+    ResetDelayCounter(&growth_delay);
+    ResetDelayCounter(&update_delay);
+    ResetDelayCounter(&change_delay);
 
     started = TRUE;
   }
index 6c394d7ab2a6993ad080bc7a2b51de61aebd95ba..e150a089809ae1f633b3d377a69219b42dd742fa 100644 (file)
@@ -1934,7 +1934,7 @@ boolean HandleGadgets(int mx, int my, int button)
     if (gadget_pressed)                // gadget pressed the first time
     {
       // initialize delay counter
-      DelayReached(&pressed_delay, 0);
+      ResetDelayCounter(&pressed_delay);
 
       // start gadget delay with longer delay after first click on gadget
       pressed_delay_value = GADGET_FRAME_DELAY_FIRST;
index d032f9884d56fb0a4bbf28397a1a4c3b77bb0114..c859e633975d4e6819e78a298c16ba0db0d3e134 100644 (file)
@@ -3531,8 +3531,8 @@ static void DrawPreviewLevelExt(boolean restart)
     DrawPreviewLevelInfo(MICROLABEL_LEVEL_AUTHOR);
 
     // initialize delay counters
-    DelayReached(&scroll_delay, 0);
-    DelayReached(&label_delay, 0);
+    ResetDelayCounter(&scroll_delay);
+    ResetDelayCounter(&label_delay);
 
     if (leveldir_current->name)
     {