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

Method init

src/Engine/State.cpp:118–129  ·  view source on GitHub ↗

* Initializes the state and its child elements. This is * used for settings that have to be reset every time the * state is returned to focus (eg. palettes), so can't * just be put in the constructor (remember there's a stack * of states, so they can be created once while being * repeatedly switched back into focus). */

Source from the content-addressed store, hash-verified

116 * repeatedly switched back into focus).
117 */
118void State::init()
119{
120 _game->getScreen()->setPalette(_palette);
121 _game->getCursor()->setPalette(_palette);
122 _game->getCursor()->draw();
123 _game->getFpsCounter()->setPalette(_palette);
124 _game->getFpsCounter()->draw();
125 if (_game->getResourcePack() != 0)
126 {
127 _game->getResourcePack()->setPalette(_palette);
128 }
129}
130
131/**
132 * Runs any code the state needs to keep updating every

Callers

nothing calls this directly

Calls 6

getScreenMethod · 0.80
getCursorMethod · 0.80
getFpsCounterMethod · 0.80
setPaletteMethod · 0.45
drawMethod · 0.45
getResourcePackMethod · 0.45

Tested by

no test coverage detected