X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fmisc.c;h=5fdbe85b42b800d323ace39fd28c5ef1b28d3bcf;hb=2e99b0c26d334eb287486b8933b52b5048c6cc0c;hp=7c2f4353851cb803d8dc8bd43fd1474e65711df8;hpb=959794cfda1f83edc51512211ae5a9f6b1e0b179;p=rocksndiamonds.git diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 7c2f4353..5fdbe85b 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -233,20 +233,7 @@ static unsigned int getCurrentMS() { return SDL_GetTicks(); } - -#else /* !TARGET_SDL */ - -#if defined(PLATFORM_UNIX) -static unsigned int getCurrentMS() -{ - struct timeval current_time; - - gettimeofday(¤t_time, NULL); - - return current_time.tv_sec * 1000 + current_time.tv_usec / 1000; -} -#endif /* PLATFORM_UNIX */ -#endif /* !TARGET_SDL */ +#endif static unsigned int mainCounter(int mode) { @@ -283,29 +270,7 @@ static unsigned int mainCounter(int mode) return counter_ms; /* return milliseconds since last init */ } - -#else /* !TARGET_SDL */ - -#if defined(PLATFORM_UNIX) -static unsigned int mainCounter(int mode) -{ - static struct timeval base_time = { 0, 0 }; - struct timeval current_time; - unsigned int counter_ms; - - gettimeofday(¤t_time, NULL); - - /* reset base time in case of counter initializing or wrap-around */ - if (mode == INIT_COUNTER || current_time.tv_sec < base_time.tv_sec) - base_time = current_time; - - counter_ms = (current_time.tv_sec - base_time.tv_sec) * 1000 - + (current_time.tv_usec - base_time.tv_usec) / 1000; - - return counter_ms; /* return milliseconds since last init */ -} -#endif /* PLATFORM_UNIX */ -#endif /* !TARGET_SDL */ +#endif #endif @@ -340,8 +305,6 @@ static void sleep_milliseconds(unsigned int milliseconds_delay) { #if defined(TARGET_SDL) SDL_Delay(milliseconds_delay); -#elif defined(TARGET_ALLEGRO) - rest(milliseconds_delay); #else struct timeval delay;