1 /* mainMode.h 2 The main operation mode of the game. 3 4 Copyright (C) 2000 Mathias Broxvall 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2 of the License, or 9 (at your option) any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program; if not, write to the Free Software 18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 */ 20 21 #ifndef MAINMODE_H 22 #define MAINMODE_H 23 24 #include "gameMode.h" 25 #include "glHelp.h" 26 27 class Gamer; 28 29 class MainMode : public GameMode { 30 public: 31 MainMode(); 32 virtual ~MainMode(); 33 34 void display(); 35 void key(int); 36 void tick(Real td); 37 void doExpensiveComputations(); 38 void mouse(int state, int x, int y); 39 void mouseDown(int button, int x, int y); 40 41 void activated(); 42 void deactivated(); 43 44 void playerLose(); 45 void playerDie(); 46 void startGame(); 47 void restartPlayer(); 48 void showInfo(); 49 void showBonus(); 50 void levelComplete(); 51 void bonusLevelComplete(); 52 53 static void setupLighting(const Game *game, bool isNight); 54 void renderEnvironmentTexture(GLuint texture, const Coord3d &focus) const; 55 Real flash; 56 57 static MainMode *init(); 58 static void cleanup(); 59 static MainMode *mainMode; 60 61 Game *game; 62 63 double zAngle, wantedZAngle, xyAngle, wantedXYAngle; 64 Coord3d camFocus, camDelta; 65 Matrix4d cameraModelView; 66 Matrix4d cameraProjection; 67 68 protected: 69 private: 70 double statusCount; 71 double time; 72 double pause_time; 73 int go_to_pause; 74 75 enum { 76 statusBeforeGame, 77 statusGameOver, 78 statusInGame, 79 statusRestartPlayer, 80 statusNextLevel, 81 statusVictory, 82 statusLevelComplete, 83 statusBonusLevelComplete, 84 statusPaused 85 } gameStatus; 86 }; 87 88 #endif 89