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);
while (tag != GDI_END)
{
- switch(tag)
+ switch (tag)
{
case GDI_IMAGE_ID:
gi->image_id = va_arg(ap, int);
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)