fixed wrong variable type
[rocksndiamonds.git] / src / libgame / gadgets.c
index 1004199f40d45bdd9cf405ca4398a71f1e75d045..b30082a296a74e4dfd45aeb34c82807e0692c607 100644 (file)
@@ -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);
 
-  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);
@@ -883,7 +884,7 @@ static void HandleGadgetTags(struct GadgetInfo *gi, int first_tag, va_list ap)
 
   while (tag != GDI_END)
   {
-    switch(tag)
+    switch (tag)
     {
       case GDI_IMAGE_ID:
        gi->image_id = va_arg(ap, int);