X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=7f9821bf0d1f7a2d53adf17a3c8d20fdf1ba01a5;hb=e89a21e95b3cb84d1515c0fb3378ce902a48c1c8;hp=727dcf30be2cfe03197b82bd9d436bf4dfdb808c;hpb=21859f94b784d557113a6470ed8fd7bceb48ba15;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 727dcf30..7f9821bf 100644 --- a/src/init.c +++ b/src/init.c @@ -138,11 +138,12 @@ static void DrawInitAnim(boolean only_when_loading) game_status == GAME_MODE_LOADING ? &init_last.busy : &init_last.busy_playfield); - static unsigned int action_delay = 0; - unsigned int action_delay_value = GameFrameDelay; + static DelayCounter action_delay = { 0 }; int sync_frame = FrameCounter; int x, y; + action_delay.value = GameFrameDelay; + // prevent OS (Windows) from complaining about program not responding CheckQuitEvent(); @@ -152,7 +153,7 @@ static void DrawInitAnim(boolean only_when_loading) if (image_initial[graphic].bitmap == NULL || window == NULL) return; - if (!DelayReached(&action_delay, action_delay_value)) + if (!DelayReached(&action_delay)) return; if (busy->x == -1) @@ -6610,8 +6611,7 @@ void OpenAll(void) static boolean WaitForApiThreads(void) { - unsigned int thread_delay = 0; - unsigned int thread_delay_value = 10000; + DelayCounter thread_delay = { 10000 }; if (program.api_thread_count == 0) return TRUE; @@ -6627,7 +6627,7 @@ static boolean WaitForApiThreads(void) // wait for threads to finish (and fail on timeout) while (program.api_thread_count > 0) { - if (DelayReached(&thread_delay, thread_delay_value)) + if (DelayReached(&thread_delay)) { Error("failed waiting for threads - TIMEOUT");