Make autopackage work
[crack-attack.git] / src / SignManager.h
blob36a21283c440334fe8767114984c731ab007a5a8
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
29 using namespace std;
31 #include "Displayer.h"
33 // sign types
34 #define ST_MAGNITUDE (0)
35 #define ST_MULTIPLIER (1)
36 #define ST_SPECIAL (2)
38 // sign textures
39 #define ST_SMALL_TEXTURE (0)
40 #define ST_LARGE_TEXTURE (1)
42 // content bases
43 #define SC_BASE_MAGNITUDE_CONTENT (0)
44 #define SC_BASE_MULTIPLIER_CONTENT (13)
46 class Sign {
47 public:
48 bool active;
49 float x, y;
50 int texture;
51 GLfloat subtexture_s;
52 GLfloat subtexture_t;
53 GLfloat size;
54 int life_time;
55 int g_x, g_y;
56 int color;
59 /* static */ class SignManager {
60 public:
61 static void initialize ( );
63 static inline void timeStep ( )
65 if (sign_count > 0) timeStep_inline_split_();
68 static void createSign ( int x, int y, int type, int level );
70 static int sign_count;
71 static Sign signs[DC_MAX_SIGN_NUMBER];
73 private:
74 static void timeStep_inline_split_ ( );
76 static inline bool confirmSignLocation ( Sign &sign )
78 if (sign.g_y <= 0) return false;
79 if (sign.g_x <= 0 || sign.g_x >= GC_PLAY_WIDTH) return false;
81 // sign being created is still inactive
82 int c = sign_count;
83 for (int n = 0; c; n++)
84 if (signs[n].active) {
85 c--;
86 if (sign.g_x == signs[n].g_x && sign.g_y == signs[n].g_y) return false;
89 return true;
93 #endif