projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cleanup of gadget handling for Android/non-Android platforms
[rocksndiamonds.git]
/
src
/
events.c
diff --git
a/src/events.c
b/src/events.c
index 0edb3288b3eb61332992f298917806b6f1d31d6a..8d1fb9749eb0364fc6872aeac23abeed12124b69 100644
(file)
--- 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;
{
static int old_mx = 0, old_my = 0;
boolean button_hold = FALSE;
+ boolean handle_gadgets = TRUE;
if (button_nr < 0)
{
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
#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));
(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 */
}
{
/* 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))
{
if (HandleGlobalAnimClicks(mx, my, button))
{