Fixes for datatype size on amd64.
[crack-attack.git] / src / Controller.h
blob4ad76c71774e696f13c4e65a68795db801b6bb4e
1 /*
2 * Controller.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 CONTORLLER_H
27 #define CONTORLLER_H
29 #define CC_LEFT (1 << 0)
30 #define CC_RIGHT (1 << 1)
31 #define CC_UP (1 << 2)
32 #define CC_DOWN (1 << 3)
33 #define CC_SWAP (1 << 4)
34 #define CC_ADVANCE (1 << 5)
35 #define CC_PAUSE (1 << 6)
37 /* static */ class Controller {
38 public:
39 static void gameStart ( );
40 static void keyboardPlay ( unsigned char key, int x, int y );
41 static void keyboardUpPlay ( unsigned char key, int x, int y );
42 static void specialPlay ( int key, int x, int y );
43 static void specialUpPlay ( int key, int x, int y );
44 static void keyboardMeta ( unsigned char key, int x, int y );
45 static void keyboardUpMeta ( unsigned char key, int x, int y );
46 static void specialMeta ( int key, int x, int y );
47 static void specialUpMeta ( int key, int x, int y );
48 static void entry ( int mouse_state );
50 static inline int moveCommand ( )
51 { return state & (CC_LEFT | CC_RIGHT | CC_UP | CC_DOWN); }
53 static inline bool swapCommand ( )
54 { return state & CC_SWAP; }
56 static inline bool advanceCommand ( )
57 { return state & CC_ADVANCE; }
59 static inline bool pauseCommand ( )
60 { return state & CC_PAUSE; }
62 private:
63 static int state;
66 #endif