Fixes for datatype size on amd64.
[crack-attack.git] / src / MessageManager.h
blobfa91ac06a31d6092905de6f67ecb0541bc73b34b
1 /*
2 * MessageManager.h
3 * Daniel Nelson - 8/24/0
5 * Copyright (C) 2000 Daniel Nelson
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 * Daniel Nelson - aluminumangel.org
22 * 174 W. 18th Ave.
23 * Columbus, OH 43210
26 #ifndef MESSAGEMANAGER_H
27 #define MESSAGEMANAGER_H
29 #include "Displayer.h"
31 // message shapes
32 #define MS_1x1 (1 << 0)
33 #define MS_2x1 (1 << 1)
34 #define MS_4x1 (1 << 2)
36 // messages
37 #define MS_COUNT_DOWN_GO (0)
38 #define MS_COUNT_DOWN_1 (1)
39 #define MS_COUNT_DOWN_2 (2)
40 #define MS_COUNT_DOWN_3 (3)
41 #define MS_ANYKEY (4)
42 #define MS_WAITING (5)
43 #define MS_PAUSED (6)
44 #define MS_WINNER (7)
45 #define MS_LOSER (8)
46 #define MS_GAME_OVER (9)
48 // message modes
49 #define MM_NORMAL (1 << 0)
50 #define MM_CELEBRATION (1 << 1)
52 /* static */ class MessageManager {
53 public:
54 static inline void readyMessage ( int message )
56 Displayer::readyMessage(message);
57 message_shape = Displayer::message_shape[message];
58 time_step = 0;
61 static inline void nextMessage ( int message )
63 Displayer::nextMessage(message);
64 message_shape = Displayer::message_shape[message];
65 time_step = 0;
68 static inline void freeMessage ( )
70 Displayer::freeMessage();
71 message_shape = 0;
74 static inline void timeStep ( )
76 if (!message_shape) return;
77 if (++time_step == DC_MESSAGE_PULSE_PERIOD)
78 time_step = 0;
81 static int message_shape;
82 static int time_step;
83 static int mode;
86 #endif