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

Method popup

src/Interface/Window.cpp:129–154  ·  view source on GitHub ↗

* Plays the window popup animation. */

Source from the content-addressed store, hash-verified

127 * Plays the window popup animation.
128 */
129void Window::popup()
130{
131 if (AreSame(_popupStep, 0.0))
132 {
133 int sound = SDL_GetTicks() % 3; // this is a hack to avoid calling RNG::generate(0, 2) and skewing our seed.
134 if (soundPopup[sound] != 0)
135 {
136 soundPopup[sound]->play(Mix_GroupAvailable(0));
137 }
138 }
139 if (_popupStep < 1.0)
140 {
141 _popupStep += POPUP_SPEED;
142 }
143 else
144 {
145 if (_screen)
146 {
147 _state->toggleScreen();
148 }
149 _state->showAll();
150 _popupStep = 1.0;
151 _timer->stop();
152 }
153 _redraw = true;
154}
155
156/**
157 * Draws the bordered window with a graphic background.

Callers

nothing calls this directly

Calls 5

AreSameFunction · 0.85
toggleScreenMethod · 0.80
showAllMethod · 0.80
playMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected