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

Method unpress

src/Engine/InteractiveSurface.cpp:228–239  ·  view source on GitHub ↗

* Simulates a "mouse button release". Used in circumstances * where the surface is unpressed without user input. * @param state Pointer to running state. */

Source from the content-addressed store, hash-verified

226 * @param state Pointer to running state.
227 */
228void InteractiveSurface::unpress(State *state)
229{
230 if (isButtonPressed())
231 {
232 _buttonsPressed = 0;
233 SDL_Event ev;
234 ev.type = SDL_MOUSEBUTTONUP;
235 ev.button.button = SDL_BUTTON_LEFT;
236 Action a = Action(&ev, 0.0, 0.0, 0, 0);
237 mouseRelease(&a, state);
238 }
239}
240
241/**
242 * Called every time there's a mouse press over the surface.

Callers 1

resetAllMethod · 0.45

Calls 1

ActionClass · 0.70

Tested by

no test coverage detected