Fixed more inappropriate variable decl's.
[supertux.git] / src / timer.h
1 //
2 // C Interface: timer
3 //
4 // Description: 
5 //
6 //
7 // Author: Tobias Glaesser <tobi.web@gmx.de>, (C) 2004
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12
13 #ifndef SUPERTUX_TIMER_H
14 #define SUPERTUX_TIMER_H
15
16 /* Timer type */
17 typedef struct timer_type
18   {
19    unsigned int period;
20    unsigned int time;
21   }
22 timer_type;
23
24 unsigned int st_pause_ticks;
25 unsigned int st_pause_count;
26
27 unsigned int st_get_ticks(void);
28 void st_pause_ticks_init(void);
29 void st_pause_ticks_start(void);
30 void st_pause_ticks_stop(void);
31 void timer_init(timer_type* ptimer);
32 void timer_start(timer_type* ptimer, unsigned int period);
33 void timer_stop(timer_type* ptimer);
34 /*======================================================================
35      int timer_check(timer_type* ptimer);
36     
37      param : pointer to a timer which needs to be checked
38      return: NO  = the timer is not started
39                    or it is over
40              YES = otherwise
41 ======================================================================*/
42 int timer_check(timer_type* ptimer);
43 int timer_started(timer_type* ptimer);
44 /*======================================================================
45      int timer_get_left(timer_type* ptimer);
46
47      param : pointer to a timer that you want to get the time left
48      return: the time left (in millisecond)
49      note  : the returned value can be negative
50 ======================================================================*/
51 int timer_get_left(timer_type* ptimer);
52 int timer_get_gone(timer_type* ptimer);
53
54 #endif /*SUPERTUX_TIMER_H*/
55