Fixes for datatype size on amd64.
[crack-attack.git] / src / WinRecord.h
blob16811423f214afa5e7d5105614caa81f71c3c7e6
1 /*
2 * WinRecord.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 WINRECORD_H
27 #define WINRECORD_H
30 #include "Game.h"
31 #include "MetaState.h"
33 // game results
34 #define GR_NOT_PLAYED (1 << 0)
35 #define GR_BEING_PLAYED (1 << 1)
36 #define GR_WON (1 << 2)
37 #define GR_LOST (1 << 3)
39 class Star {
40 public:
41 GLfloat a;
42 GLfloat v_a;
43 GLfloat size;
44 GLfloat v_size;
47 /* static */ class WinRecord {
48 public:
49 static void initialize ( );
50 static void timeStep ( );
51 static void gameStart ( );
52 static void gameWon ( );
53 static void gameLoss ( );
55 static inline bool isMatchFinished ( )
57 if (concession) return true;
58 if (MetaState::mode & CM_SOLO) return true;
59 if (won) {
60 if (games_won == 1 + GC_GAMES_PER_MATCH / 2)
61 return true;
62 } else
63 if (games_lost == 1 + GC_GAMES_PER_MATCH / 2)
64 return true;
65 return false;
68 static inline void matchConceded ( )
70 concession = true;
73 static int current_game;
74 static bool won;
75 static bool concession;
76 static int games_won;
77 static int games_lost;
79 static int record[GC_GAMES_PER_MATCH];
81 static Star stars[GC_GAMES_PER_MATCH];
83 static int dynamic_star;
84 static int displaced_star;
85 static GLfloat win_star_x;
86 static GLfloat win_star_y;
87 static GLfloat win_star_v_x;
88 static GLfloat win_star_v_y;
89 static GLfloat old_star_a;
90 static GLfloat old_star_size;
92 static bool draw_old_star;
95 #endif