MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / add

Method add

src/Engine/State.cpp:75–85  ·  view source on GitHub ↗

* Adds a new child surface for the state to take care of, * giving it the game's display palette. Once associated, * the state handles all of the surface's behaviour * and management automatically. * @param surface Child surface. * @note Since visible elements can overlap one another, * they have to be added in ascending Z-Order to be blitted * correctly onto the screen. */

Source from the content-addressed store, hash-verified

73 * correctly onto the screen.
74 */
75void State::add(Surface *surface)
76{
77 // Set palette
78 surface->setPalette(_palette);
79
80 // Set default text resources
81 if (_game->getLanguage() && _game->getResourcePack())
82 surface->initText(_game->getResourcePack()->getFont("FONT_BIG"), _game->getResourcePack()->getFont("FONT_SMALL"), _game->getLanguage());
83
84 _surfaces.push_back(surface);
85}
86
87/**
88 * Returns whether this is a full-screen state.

Callers

nothing calls this directly

Calls 5

getLanguageMethod · 0.80
setPaletteMethod · 0.45
getResourcePackMethod · 0.45
initTextMethod · 0.45
getFontMethod · 0.45

Tested by

no test coverage detected