Fixes for datatype size on amd64.
[crack-attack.git] / src / SignManager.h
blob6b9770935830c1f016ed4f317adbbc6fb227251b
1 /*
2 * SignManager.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 SIGNMANAGER_H
27 #define SIGNMANAGER_H
30 #include "Displayer.h"
32 // sign types
33 #define ST_MAGNITUDE (0)
34 #define ST_MULTIPLIER (1)
35 #define ST_SPECIAL (2)
37 // sign textures
38 #define ST_SMALL_TEXTURE (0)
39 #define ST_LARGE_TEXTURE (1)
41 // content bases
42 #define SC_BASE_MAGNITUDE_CONTENT (0)
43 #define SC_BASE_MULTIPLIER_CONTENT (13)
45 class Sign {
46 public:
47 bool active;
48 float x, y;
49 int texture;
50 GLfloat subtexture_s;
51 GLfloat subtexture_t;
52 GLfloat size;
53 int life_time;
54 int g_x, g_y;
55 int color;
58 /* static */ class SignManager {
59 public:
60 static void initialize ( );
62 static inline void timeStep ( )
64 if (sign_count > 0) timeStep_inline_split_();
67 static void createSign ( int x, int y, int type, int level );
69 static int sign_count;
70 static Sign signs[DC_MAX_SIGN_NUMBER];
72 private:
73 static void timeStep_inline_split_ ( );
75 static inline bool confirmSignLocation ( Sign &sign )
77 if (sign.g_y <= 0) return false;
78 if (sign.g_x <= 0 || sign.g_x >= GC_PLAY_WIDTH) return false;
80 // sign being created is still inactive
81 int c = sign_count;
82 for (int n = 0; c; n++)
83 if (signs[n].active) {
84 c--;
85 if (sign.g_x == signs[n].g_x && sign.g_y == signs[n].g_y) return false;
88 return true;
92 #endif