added enabling/disabling virtual button overlay depending on input events
[rocksndiamonds.git] / src / libgame / sdl.c
index 04fa05e8c5151be5721ad9c07bcce1e1f06173ca..8751f1b999dfa4de510e8eacf78aee61a9684e11 100644 (file)
@@ -2966,11 +2966,12 @@ static void DrawTouchInputOverlay()
   static int alpha_step = 5;
   static int alpha_last = 0;
   static int alpha = 0;
+  boolean active = (overlay.enabled && overlay.active);
 
-  if (!overlay.active && deactivated)
+  if (!active && deactivated)
     return;
 
-  if (overlay.active)
+  if (active)
   {
     if (alpha < alpha_max)
       alpha = MIN(alpha + alpha_step, alpha_max);