Mercurial > sdl-ios-xcode
comparison src/timer/nds/SDL_systimer.c @ 2698:e1da92da346c gsoc2008_nds
Clean up.
author | Darren Alton <dalton@stevens.edu> |
---|---|
date | Wed, 27 Aug 2008 04:23:38 +0000 |
parents | 0b395a60deff |
children |
comparison
equal
deleted
inserted
replaced
2697:c9121b04cffa | 2698:e1da92da346c |
---|---|
35 static Uint32 timer_ticks; | 35 static Uint32 timer_ticks; |
36 | 36 |
37 void | 37 void |
38 SDL_StartTicks(void) | 38 SDL_StartTicks(void) |
39 { | 39 { |
40 if(!timer_alive) { | 40 if (!timer_alive) { |
41 SDL_SYS_TimerInit(); | 41 SDL_SYS_TimerInit(); |
42 SDL_SYS_StartTimer(); | 42 SDL_SYS_StartTimer(); |
43 } | 43 } |
44 | 44 |
45 timer_ticks = 0; | 45 timer_ticks = 0; |
53 | 53 |
54 void | 54 void |
55 SDL_Delay(Uint32 ms) | 55 SDL_Delay(Uint32 ms) |
56 { | 56 { |
57 Uint32 start = SDL_GetTicks(); | 57 Uint32 start = SDL_GetTicks(); |
58 while(timer_alive) { | 58 while (timer_alive) { |
59 if((SDL_GetTicks() - start) >= ms) break; | 59 if ((SDL_GetTicks() - start) >= ms) |
60 break; | |
60 } | 61 } |
61 } | 62 } |
62 | 63 |
63 static int | 64 static int |
64 RunTimer(void *unused) | 65 RunTimer(void *unused) |
69 SDL_Delay(1); | 70 SDL_Delay(1); |
70 } | 71 } |
71 return (0); | 72 return (0); |
72 } | 73 } |
73 | 74 |
74 void NDS_TimerInterrupt(void) { | 75 void |
75 timer_ticks++; | 76 NDS_TimerInterrupt(void) |
77 { | |
78 timer_ticks++; | |
76 } | 79 } |
77 | 80 |
78 /* This is only called if the event thread is not running */ | 81 /* This is only called if the event thread is not running */ |
79 int | 82 int |
80 SDL_SYS_TimerInit(void) | 83 SDL_SYS_TimerInit(void) |