29 class InteractiveSurface;
32 class SavedBattleGame;
49 std::vector<Surface*> _surfaces;
55 SDL_Color _palette[256];
67 void add(
Surface *surface,
const std::string &
id,
const std::string &category,
Surface *parent = 0);
103 void setPalette(SDL_Color *colors,
int firstcolor = 0,
int ncolors = 256,
bool immediately =
true);
105 void setPalette(
const std::string &palette,
int backpals = -1);
109 virtual void resize(
int &dX,
int &dY);
111 virtual void recenter(
int dX,
int dY);
void setModal(InteractiveSurface *surface)
Sets a modal surface.
Definition: State.cpp:445
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:32
void centerAllSurfaces()
center all surfaces relative to the screen.
Definition: State.cpp:372
virtual void recenter(int dX, int dY)
Re-orients all the surfaces in the state.
Definition: State.cpp:534
State()
Creates a new state linked to a game.
Definition: State.cpp:53
A game state that receives user input and reacts accordingly.
Definition: State.h:43
Timer used to run code in fixed intervals.
Definition: Timer.h:35
Surface that the user can interact with.
Definition: InteractiveSurface.h:37
void hideAll()
Hides all the state surfaces.
Definition: State.cpp:314
bool isScreen() const
Gets whether the state is a full-screen.
Definition: State.cpp:219
const LocalizedText & tr(const std::string &id) const
Get the localized text.
Definition: State.cpp:352
virtual void think()
Runs state functionality every cycle.
Definition: State.cpp:273
Definition: RuleInterface.h:35
static Game * _game
Initializes static member.
Definition: State.h:48
void showAll()
Shws all the state surfaces.
Definition: State.cpp:323
A string that is already translated.
Definition: LocalizedText.h:43
void toggleScreen()
Toggles whether the state is a full-screen.
Definition: State.cpp:229
void applyBattlescapeTheme()
switch the colours to use the battlescape palette.
Definition: State.cpp:395
SDL_Color * getPalette()
Gets the state's 8bpp palette.
Definition: State.cpp:513
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:457
void resetAll()
Resets all the state surfaces.
Definition: State.cpp:333
static void setGamePtr(Game *game)
Sets game object pointer.
Definition: State.cpp:543
Element that is blit (rendered) onto the screen.
Definition: Surface.h:36
virtual void init()
Initializes the state.
Definition: State.cpp:242
void setInterface(const std::string &s, bool alterPal=false, SavedBattleGame *battleGame=0)
Set interface rules.
Definition: State.cpp:77
virtual void blit()
Blits the state to the screen.
Definition: State.cpp:305
The battlescape data that gets written to disk when the game is saved.
Definition: SavedBattleGame.h:47
virtual void handle(Action *action)
Handles any events.
Definition: State.cpp:284
The core of the game engine, manages the game's entire contents and structure.
Definition: Game.h:41
virtual void resize(int &dX, int &dY)
Let the state know the window has been resized.
Definition: State.cpp:524
void lowerAllSurfaces()
lower all surfaces by half the screen height.
Definition: State.cpp:384
void add(Surface *surface)
Adds a child element to the state.
Definition: State.cpp:133
Definition: BaseInfoState.cpp:40
void redrawText()
redraw all the text-type surfaces.
Definition: State.cpp:423
virtual ~State()
Cleans up the state.
Definition: State.cpp:63