Game end works this way now:
[crack-attack.git] / src / DrawCountDown.cxx
blob8dcd311bd08a0a91040e3a4db5eebc10cb8f00e0
1 /*
2 * DrawCountDown.cxx
3 * Daniel Nelson - 10/27/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
25 * Draws the game start count down.
28 #include <GL/glut.h>
30 #include "glext.h"
32 using namespace std;
34 #include "Game.h"
35 #include "Displayer.h"
36 #include "CountDownManager.h"
37 #include "MessageManager.h"
39 void Displayer::drawCountDown_inline_split_ ( )
41 glBindTexture(GL_TEXTURE_2D, message_texture);
43 glPushMatrix();
45 GLfloat lambda = CountDownManager::message_switch_alarm
46 * (1.0f / (GLfloat) (GC_START_PAUSE_DELAY / 3));
48 if (CountDownManager::state != 0) {
49 glColor4f(1.0f, 1.0f, 1.0f, lambda);
51 glTranslatef(0.0f, lambda * lambda * (DC_GRID_ELEMENT_LENGTH
52 * GC_SAFE_HEIGHT * (1.0f - DC_COUNT_DOWN_HEIGHT_RATIO))
53 + (DC_PLAY_OFFSET_Y + DC_GRID_ELEMENT_LENGTH * GC_SAFE_HEIGHT
54 * DC_COUNT_DOWN_HEIGHT_RATIO), DC_PLAY_OFFSET_Z);
56 glScalef((1.0f - lambda) * (1.0f - lambda)
57 * (DC_COUNT_DOWN_MAX_SCALE - 1.0f) + 1.0f,
58 (1.0f - lambda) * (1.0f - lambda)
59 * (DC_COUNT_DOWN_MAX_SCALE - 1.0f) + 1.0f, 1.0f);
61 } else {
62 if (lambda > DC_COUNT_DOWN_GO_INFLECTION)
63 lambda = 1.0f;
64 else
65 lambda = Game::sqrt(lambda * (1.0f / DC_COUNT_DOWN_GO_INFLECTION));
67 glColor4f(1.0f, 1.0f, 1.0f, lambda);
69 glTranslatef(0.0f, DC_PLAY_OFFSET_Y + DC_GRID_ELEMENT_LENGTH
70 * GC_SAFE_HEIGHT * 0.5f, DC_PLAY_OFFSET_Z);
72 glScalef(DC_COUNT_DOWN_MAX_SCALE, DC_COUNT_DOWN_MAX_SCALE, 1.0f);
75 if (MessageManager::message_shape & MS_1x1)
76 glCallList(message_1x1_list);
77 else if (MessageManager::message_shape & MS_2x1)
78 glCallList(message_2x1_list);
79 else
80 glCallList(message_4x1_list);
83 glPopMatrix();