Don't show selection cursor when help is being displayed.
[supertux.git] / src / timer.h
1 //  $Id$
2 // 
3 //  SuperTux
4 //  Copyright (C) 2004 Tobias Glaesser <tobi.web@gmx.de>
5 //
6 //  This program is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU General Public License
8 //  as published by the Free Software Foundation; either version 2
9 //  of the License, or (at your option) any later version.
10 //
11 //  This program is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 //  GNU General Public License for more details.
15 // 
16 //  You should have received a copy of the GNU General Public License
17 //  along with this program; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 //  02111-1307, USA.
20
21 #ifndef SUPERTUX_TIMER_H
22 #define SUPERTUX_TIMER_H
23
24 extern unsigned int st_pause_ticks, st_pause_count;
25
26 unsigned int st_get_ticks(void);
27 void st_pause_ticks_init(void);
28 void st_pause_ticks_start(void);
29 void st_pause_ticks_stop(void);
30
31 class Timer
32 {
33  public:
34   unsigned int period;
35   unsigned int time;
36   unsigned int (*get_ticks) (void);  
37
38  public:
39   Timer();
40   
41   void init(bool st_ticks);
42   void start(unsigned int period);
43   void stop();
44
45   /*======================================================================
46     return: NO  = the timer is not started
47     or it is over
48     YES = otherwise
49     ======================================================================*/
50   int check();
51   int started();
52
53   /*======================================================================
54     return: the time left (in millisecond)
55     note  : the returned value can be negative
56     ======================================================================*/
57   int get_left();
58
59   int  get_gone();
60   void fwrite(FILE* fi);
61   void fread(FILE* fi);
62 };
63
64 #endif /*SUPERTUX_TIMER_H*/
65
66 /* Local Variables: */
67 /* mode:c++ */
68 /* End: */