Make autopackage work
[crack-attack.git] / src / MessageManager.h
blob68f36f4db0fbb9602e327ae3bd13421f3ee7faec
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 using namespace std;
31 #include "Displayer.h"
33 // message shapes
34 #define MS_1x1 (1 << 0)
35 #define MS_2x1 (1 << 1)
36 #define MS_4x1 (1 << 2)
38 // messages
39 #define MS_COUNT_DOWN_GO (0)
40 #define MS_COUNT_DOWN_1 (1)
41 #define MS_COUNT_DOWN_2 (2)
42 #define MS_COUNT_DOWN_3 (3)
43 #define MS_ANYKEY (4)
44 #define MS_WAITING (5)
45 #define MS_PAUSED (6)
46 #define MS_WINNER (7)
47 #define MS_LOSER (8)
48 #define MS_GAME_OVER (9)
50 // message modes
51 #define MM_NORMAL (1 << 0)
52 #define MM_CELEBRATION (1 << 1)
54 /* static */ class MessageManager {
55 public:
56 static inline void readyMessage ( int message )
58 Displayer::readyMessage(message);
59 message_shape = Displayer::message_shape[message];
60 time_step = 0;
63 static inline void nextMessage ( int message )
65 Displayer::nextMessage(message);
66 message_shape = Displayer::message_shape[message];
67 time_step = 0;
70 static inline void freeMessage ( )
72 Displayer::freeMessage();
73 message_shape = 0;
76 static inline void timeStep ( )
78 if (!message_shape) return;
79 if (++time_step == DC_MESSAGE_PULSE_PERIOD)
80 time_step = 0;
83 static int message_shape;
84 static int time_step;
85 static int mode;
88 #endif