* Sets up a blank window with the specified size and position. * @param state Pointer to state the window belongs to. * @param width Width in pixels. * @param height Height in pixels. * @param x X position in pixels. * @param y Y position in pixels. * @param popup Popup animation. */
| 40 | * @param popup Popup animation. |
| 41 | */ |
| 42 | Window::Window(State *state, int width, int height, int x, int y, WindowPopup popup) : Surface(width, height, x, y), _dx(-x), _dy(-y), _bg(0), _color(0), _popup(popup), _popupStep(0.0), _state(state), _contrast(false), _screen(false), _thinBorder(false) |
| 43 | { |
| 44 | _timer = new Timer(10); |
| 45 | _timer->onTimer((SurfaceHandler)&Window::popup); |
| 46 | |
| 47 | if (_popup == POPUP_NONE) |
| 48 | { |
| 49 | _popupStep = 1.0; |
| 50 | } |
| 51 | else |
| 52 | { |
| 53 | setHidden(true); |
| 54 | _timer->start(); |
| 55 | if (_state != 0) |
| 56 | { |
| 57 | _screen = state->isScreen(); |
| 58 | if (_screen) |
| 59 | _state->toggleScreen(); |
| 60 | } |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Deletes timers. |
nothing calls this directly
no test coverage detected