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

Method ScannerState

src/Battlescape/ScannerState.cpp:46–82  ·  view source on GitHub ↗

* Initializes the Scanner State. * @param game Pointer to the core game. * @param action Pointer to an action. */

Source from the content-addressed store, hash-verified

44 * @param action Pointer to an action.
45 */
46ScannerState::ScannerState (Game * game, BattleAction *action) : State (game), _action(action)
47{
48 if (Options::maximizeInfoScreens)
49 {
50 Options::baseXResolution = Screen::ORIGINAL_WIDTH;
51 Options::baseYResolution = Screen::ORIGINAL_HEIGHT;
52 _game->getScreen()->resetDisplay(false);
53 }
54 _bg = new InteractiveSurface(320, 200);
55 _scan = new Surface(320, 200);
56 _scannerView = new ScannerView(152, 152, 56, 24, _game, _action->actor);
57
58 if (_game->getScreen()->getDY() > 50)
59 {
60 _screen = false;
61 }
62
63 // Set palette
64 setPalette("PAL_BATTLESCAPE");
65
66 add(_scan);
67 add(_scannerView);
68 add(_bg);
69
70 centerAllSurfaces();
71
72 _game->getResourcePack()->getSurface("DETBORD.PCK")->blit(_bg);
73 _game->getResourcePack()->getSurface("DETBORD2.PCK")->blit(_scan);
74 _bg->onMouseClick((ActionHandler)&ScannerState::exitClick);
75 _bg->onKeyboardPress((ActionHandler)&ScannerState::exitClick, Options::keyCancel);
76
77 _timerAnimate = new Timer(125);
78 _timerAnimate->onTimer((StateHandler)&ScannerState::animate);
79 _timerAnimate->start();
80
81 update();
82}
83
84ScannerState::~ScannerState()
85{

Callers

nothing calls this directly

Calls 10

resetDisplayMethod · 0.80
getScreenMethod · 0.80
getDYMethod · 0.80
onMouseClickMethod · 0.80
onKeyboardPressMethod · 0.80
onTimerMethod · 0.80
blitMethod · 0.45
getSurfaceMethod · 0.45
getResourcePackMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected