From: Holger Schemel Date: Sun, 13 Jun 2021 09:57:37 +0000 (+0200) Subject: code cleanup (by using function to reset delay counter) X-Git-Tag: 4.3.0.0~138 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=18643936792bd4166fb7aee3d14299a463dc9ef5;p=rocksndiamonds.git code cleanup (by using function to reset delay counter) --- diff --git a/src/events.c b/src/events.c index fe82932a..c2548e5f 100644 --- a/src/events.c +++ b/src/events.c @@ -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 && diff --git a/src/game_mm/mm_tools.c b/src/game_mm/mm_tools.c index e71fb1d4..21ad0814 100644 --- a/src/game_mm/mm_tools.c +++ b/src/game_mm/mm_tools.c @@ -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; } diff --git a/src/libgame/gadgets.c b/src/libgame/gadgets.c index 6c394d7a..e150a089 100644 --- a/src/libgame/gadgets.c +++ b/src/libgame/gadgets.c @@ -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; diff --git a/src/tools.c b/src/tools.c index d032f988..c859e633 100644 --- a/src/tools.c +++ b/src/tools.c @@ -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) {