1 /*
2   Copyright (C) 2000 Xavier Hosxe <xhosxe@free.fr>
3 
4   This program is free software; you can redistribute it and/or modify
5   it under the terms of the GNU General Public License as published by
6   the Free Software Foundation; either version 2 of the License, or
7   (at your option) any later version.
8 
9   This program is distributed in the hope that it will be useful,
10   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   GNU General Public License for more details.
13 
14   You should have received a copy of the GNU General Public License
15   along with this program; if not, write to the Free Software
16   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17 */
18 
19 
20 #ifndef __SCENE__
21 #define __SCENE__
22 
23 
24 #include <stdlib.h>
25 
26 #include "listsprite.hpp"
27 
28 #define STARS 300
29 
30 
31 class Scene {
32 public:
33     static Scene* getScene();
34     void drawFloor();
35     void drawSolidFloor();
36     void drawSky();
37     void drawPlayers();
38     void drawFPS();
39     void drawPresentation();
40     void drawGame();
41     void initOpenGl();
42     void presentationIdle();
43     void gameIdle() ;
44 
45     void toggleDisplayFPS();
46     void toggleFog();
47     void toggleSpecular();
48 	// create and return a list number
49     int createCube(float size);
50 	// return nothing
51   	 void createCube(float sizex,float sizey,float sizez);
52     // public variable
53     int globalScore ;
54     ListSprite *    globalList;
55 	int nStars;
56 	int benchState;
57 	float benchPeriod;
58 
59 
60 	// Benchmark
61 	void drawFPSBench();
62     void drawBench();
63     void benchIdle() ;
64 	// Benchmark
65     void drawMenu();
66     void menuIdle() ;
67 protected:
68     float stars[STARS][6];
69     void initVariables();
70 
71     void timediff() ;
72     Scene();
73     int dt,lasttime; // milliseconds since last frame
74     int displayFPS;
75 	int nFog;
76 	bool bSpecular;
77     int floorOffset;
78     float floorScrollOffset;
79 
80     int* aFloor;
81     int* aFloorMap;
82     GLfloat* m_fFloorY;
83 
84 };
85 
86 extern Scene* scene;
87 
88 #endif
89 
90