projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed bug with reanimating killed player by CE condition
[rocksndiamonds.git]
/
src
/
libgame
/
gadgets.c
diff --git
a/src/libgame/gadgets.c
b/src/libgame/gadgets.c
index 1004199f40d45bdd9cf405ca4398a71f1e75d045..cbe1cabc2e23200c04961b7733fa49ce4db9fa99 100644
(file)
--- a/
src/libgame/gadgets.c
+++ b/
src/libgame/gadgets.c
@@
-808,7
+808,8
@@
static void DrawGadget_OverlayTouchButton(struct GadgetInfo *gi)
int alpha_max = SDL_ALPHA_OPAQUE;
int alpha_step = ALPHA_FADING_STEPSIZE(alpha_max);
int alpha_max = SDL_ALPHA_OPAQUE;
int alpha_step = ALPHA_FADING_STEPSIZE(alpha_max);
- if (gi->mapped)
+ // only show mapped overlay touch buttons if touch screen is really used
+ if (gi->mapped && runtime.uses_touch_device)
{
if (alpha < alpha_max)
alpha = MIN(alpha + alpha_step, alpha_max);
{
if (alpha < alpha_max)
alpha = MIN(alpha + alpha_step, alpha_max);
@@
-883,7
+884,7
@@
static void HandleGadgetTags(struct GadgetInfo *gi, int first_tag, va_list ap)
while (tag != GDI_END)
{
while (tag != GDI_END)
{
- switch(tag)
+ switch
(tag)
{
case GDI_IMAGE_ID:
gi->image_id = va_arg(ap, int);
{
case GDI_IMAGE_ID:
gi->image_id = va_arg(ap, int);
@@
-1478,6
+1479,10
@@
static void MapGadgetExt(struct GadgetInfo *gi, boolean redraw)
if (gi == NULL || gi->deactivated || gi->mapped)
return;
if (gi == NULL || gi->deactivated || gi->mapped)
return;
+ // do not map overlay touch buttons if touch screen is not used
+ if (gi->overlay_touch_button && !runtime.uses_touch_device)
+ return;
+
gi->mapped = TRUE;
if (redraw)
gi->mapped = TRUE;
if (redraw)