/src/GameSwitcher.h

http://github.com/clintbellanger/flare · C Header · 65 lines · 26 code · 11 blank · 28 comment · 0 complexity · 21b8071eab95df9d500e4681175d54a4 MD5 · raw file

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