20 #ifndef OPENXCOM_STATE_H
21 #define OPENXCOM_STATE_H
32 class InteractiveSurface;
50 std::vector<Surface*> _surfaces;
53 SDL_Color _palette[256];
94 void setPalette(SDL_Color *colors,
int firstcolor = 0,
int ncolors = 256,
bool immediately =
true);
96 void setPalette(
const std::string &palette,
int backpals = -1);
100 virtual void resize(
int &dX,
int &dY);
102 virtual void recenter(
int dX,
int dY);
const LocalizedText & tr(const std::string &id) const
Get the localized text.
Definition: State.cpp:214
void setModal(InteractiveSurface *surface)
Sets a modal surface.
Definition: State.cpp:339
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:34
void centerAllSurfaces()
center all surfaces relative to the screen.
Definition: State.cpp:234
virtual void recenter(int dX, int dY)
Re-orients all the surfaces in the state.
Definition: State.cpp:408
A game state that receives user input and reacts accordingly.
Definition: State.h:44
bool isScreen() const
Gets whether the state is a full-screen.
Definition: State.cpp:95
Timer used to run code in fixed intervals.
Definition: Timer.h:37
Surface that the user can interact with.
Definition: InteractiveSurface.h:39
void hideAll()
Hides all the state surfaces.
Definition: State.cpp:176
virtual void think()
Runs state functionality every cycle.
Definition: State.cpp:135
void showAll()
Shws all the state surfaces.
Definition: State.cpp:185
SDL_Color *const getPalette()
Gets the state's 8bpp palette.
Definition: State.cpp:387
A string that is already translated.
Definition: LocalizedText.h:45
void toggleScreen()
Toggles whether the state is a full-screen.
Definition: State.cpp:105
void applyBattlescapeTheme()
switch the colours to use the battlescape palette.
Definition: State.cpp:257
void setPalette(SDL_Color *colors, int firstcolor=0, int ncolors=256, bool immediately=true)
Changes a set of colors on the state's 8bpp palette.
Definition: State.cpp:351
void resetAll()
Resets all the state surfaces.
Definition: State.cpp:195
Element that is blit (rendered) onto the screen.
Definition: Surface.h:39
virtual void init()
Initializes the state.
Definition: State.cpp:118
virtual void blit()
Blits the state to the screen.
Definition: State.cpp:167
virtual void handle(Action *action)
Handles any events.
Definition: State.cpp:146
The core of the game engine, manages the game's entire contents and structure.
Definition: Game.h:44
virtual void resize(int &dX, int &dY)
Let the state know the window has been resized.
Definition: State.cpp:398
void lowerAllSurfaces()
lower all surfaces by half the screen height.
Definition: State.cpp:246
State(Game *game)
Creates a new state linked to a game.
Definition: State.cpp:48
void add(Surface *surface)
Adds a child element to the state.
Definition: State.cpp:75
void redrawText()
redraw all the text-type surfaces.
Definition: State.cpp:317
virtual ~State()
Cleans up the state.
Definition: State.cpp:57