From: Holger Schemel Date: Fri, 1 Dec 2017 20:46:31 +0000 (+0100) Subject: cleanup of gadget handling for Android/non-Android platforms X-Git-Tag: 4.1.0.0~39 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=ee7fcac2432fb3514501711605c5f01a1bf1a13f;p=rocksndiamonds.git cleanup of gadget handling for Android/non-Android platforms --- diff --git a/src/events.c b/src/events.c index 0edb3288..8d1fb974 100644 --- a/src/events.c +++ b/src/events.c @@ -1389,6 +1389,7 @@ void HandleButton(int mx, int my, int button, int button_nr) { static int old_mx = 0, old_my = 0; boolean button_hold = FALSE; + boolean handle_gadgets = TRUE; if (button_nr < 0) { @@ -1406,24 +1407,17 @@ void HandleButton(int mx, int my, int button, int button_nr) #if defined(PLATFORM_ANDROID) // when playing, only handle gadgets when using "follow finger" controls // or when using touch controls in combination with the MM game engine - boolean handle_gadgets = + handle_gadgets = (game_status != GAME_MODE_PLAYING || level.game_engine_type == GAME_ENGINE_TYPE_MM || strEqual(setup.touch.control_type, TOUCH_CONTROL_FOLLOW_FINGER)); +#endif - if (handle_gadgets && - HandleGadgets(mx, my, button)) + if (handle_gadgets && HandleGadgets(mx, my, button)) { /* do not handle this button event anymore */ mx = my = -32; /* force mouse event to be outside screen tiles */ } -#else - if (HandleGadgets(mx, my, button)) - { - /* do not handle this button event anymore */ - mx = my = -32; /* force mouse event to be outside screen tiles */ - } -#endif if (HandleGlobalAnimClicks(mx, my, button)) {