48 std::list<State*> _states, _deleted;
54 unsigned int _timeOfLastFrame;
55 int _timeUntilNextFrame;
56 static const double VOLUME_GRADIENT;
60 Game(
const std::string &title);
68 void setVolume(
int sound,
int music,
int ui);
Cursor * getCursor() const
Gets the game's cursor.
Definition: Game.cpp:387
void run()
Starts the game's state machine.
Definition: Game.cpp:139
A game state that receives user input and reacts accordingly.
Definition: State.h:43
The game data that gets written to disk when the game is saved.
Definition: SavedGame.h:99
void loadMods()
Loads the mods specified in the game options.
Definition: Game.cpp:525
Contains all the game-specific static data that never changes throughout the game, like rulesets and resources.
Definition: Mod.h:87
void popState()
Pops the last state from the state stack.
Definition: Game.cpp:434
void initAudio()
Sets up the audio.
Definition: Game.cpp:633
void defaultLanguage()
Sets up the default language.
Definition: Game.cpp:568
FpsCounter * getFpsCounter() const
Gets the FpsCounter.
Definition: Game.cpp:396
SavedGame * getSavedGame() const
Gets the currently loaded saved game.
Definition: Game.cpp:498
void quit()
Quits the game.
Definition: Game.cpp:319
void setState(State *state)
Resets the state stack to a new state.
Definition: Game.cpp:407
Language * getLanguage() const
Gets the currently loaded language.
Definition: Game.cpp:445
Contains strings used throughout the game for localization.
Definition: Language.h:39
void loadLanguage(const std::string &filename)
Loads a new language for the game.
Definition: Game.cpp:454
bool isState(State *state) const
Returns whether current state is the param state.
Definition: Game.cpp:550
void setMouseActive(bool active)
Sets whether the mouse cursor is activated.
Definition: Game.cpp:539
void setSavedGame(SavedGame *save)
Sets a new saved game for the game.
Definition: Game.cpp:507
Screen * getScreen() const
Gets the game's display screen.
Definition: Game.cpp:378
Game(const std::string &title)
Creates a new game and initializes SDL.
Definition: Game.cpp:52
static double volumeExponent(int volume)
Adjusts a linear volume level to an exponential one.
Definition: Game.cpp:369
Mouse cursor that replaces the system cursor.
Definition: Cursor.h:32
The core of the game engine, manages the game's entire contents and structure.
Definition: Game.h:41
Mod * getMod() const
Gets the currently loaded mod.
Definition: Game.cpp:517
void pushState(State *state)
Pushes a new state into the state stack.
Definition: Game.cpp:422
Counts the amount of frames each second and displays them in a NumberText surface.
Definition: FpsCounter.h:33
void setVolume(int sound, int music, int ui)
Sets the game's audio volume.
Definition: Game.cpp:337
~Game()
Cleans up all the game's resources and shuts down SDL.
Definition: Game.cpp:110
A display screen, handles rendering onto the game window.
Definition: Screen.h:38
bool isQuitting() const
Returns whether the game is shutting down.
Definition: Game.cpp:559
Definition: BaseInfoState.cpp:40