]> icculus.org git repositories - btb/d2x.git/blob - arch/sdl/timer.c
use the orientation parameter of g3_draw_bitmap
[btb/d2x.git] / arch / sdl / timer.c
1 /*
2  *
3  * SDL library timer functions
4  *
5  *
6  */
7
8 #ifdef HAVE_CONFIG_H
9 #include <conf.h>
10 #endif
11
12 #include <SDL.h>
13
14 #include "maths.h"
15 #include "timer.h"
16
17 fix timer_get_approx_seconds(void)
18 {
19         return approx_msec_to_fsec(SDL_GetTicks());
20 }
21
22 fix timer_get_fixed_seconds(void)
23 {
24         fix x;
25         unsigned long tv_now = SDL_GetTicks();
26         x=i2f(tv_now/1000) | fixdiv(i2f(tv_now % 1000),i2f(1000));
27         return x;
28 }
29
30 void timer_delay(fix seconds)
31 {
32         SDL_Delay(f2i(fixmul(seconds, i2f(1000))));
33 }