* Initializes the Scanner State. * @param game Pointer to the core game. * @param action Pointer to an action. */
| 44 | * @param action Pointer to an action. |
| 45 | */ |
| 46 | ScannerState::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 | |
| 84 | ScannerState::~ScannerState() |
| 85 | { |
nothing calls this directly
no test coverage detected