/src/GameSwitcher.h
C Header | 65 lines | 26 code | 11 blank | 28 comment | 0 complexity | 21b8071eab95df9d500e4681175d54a4 MD5 | raw file
Possible License(s): GPL-3.0
1/* 2Copyright 2011 Clint Bellanger 3 4This file is part of FLARE. 5 6FLARE is free software: you can redistribute it and/or modify it under the terms 7of the GNU General Public License as published by the Free Software Foundation, 8either version 3 of the License, or (at your option) any later version. 9 10FLARE is distributed in the hope that it will be useful, but WITHOUT ANY 11WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 14You should have received a copy of the GNU General Public License along with 15FLARE. If not, see http://www.gnu.org/licenses/ 16*/ 17 18/** 19 * class GameSwitcher 20 * 21 * State machine handler between main game modes that take up the entire view/control 22 * 23 * Examples: 24 * - the main gameplay (GameEngine class) 25 * - title screen 26 * - new game screen (character create) 27 * - load game screen 28 * - maybe full-video cutscenes 29 */ 30 31#ifndef GAME_SWITCHER_H 32#define GAME_SWITCHER_H 33 34#include <SDL.h> 35#include <SDL_image.h> 36#include <SDL_mixer.h> 37#include "Settings.h" 38#include "InputState.h" 39#include "FontEngine.h" 40 41const int GAME_STATE_TITLE = 0; 42const int GAME_STATE_PLAY = 1; 43const int GAME_STATE_LOAD = 2; 44const int GAME_STATE_NEW = 3; 45 46class GameState; 47 48class GameSwitcher { 49private: 50 Mix_Music *music; 51 52 GameState *currentState; 53 54public: 55 GameSwitcher(); 56 void loadMusic(); 57 void logic(); 58 void render(); 59 ~GameSwitcher(); 60 61 bool done; 62}; 63 64#endif 65