added enabling/disabling virtual button overlay depending on input events
[rocksndiamonds.git] / src / libgame / system.c
index b42c7e9823ce2a209c10a980a5b0e750e5c65a14..2b283c1a0c5d6813b7b533d30a1c10b1c66f21d6 100644 (file)
@@ -107,6 +107,21 @@ void InitScoresInfo()
   program.global_scores = directoryExists(global_scores_dir);
   program.many_scores_per_name = !program.global_scores;
 
+  if (options.debug)
+  {
+    if (program.global_scores)
+    {
+      Error(ERR_DEBUG, "Using global, multi-user scores directory '%s'.",
+           global_scores_dir);
+      Error(ERR_DEBUG, "Remove to enable single-user scores directory.");
+      Error(ERR_DEBUG, "(This enables multipe score entries per user.)");
+    }
+    else
+    {
+      Error(ERR_DEBUG, "Using private, single-user scores directory.");
+    }
+  }
+
   free(global_scores_dir);
 }
 
@@ -285,7 +300,18 @@ void InitGfxOtherSettings()
 
 void InitOverlayInfo()
 {
+  overlay.enabled = FALSE;
   overlay.active = FALSE;
+
+#if defined(PLATFORM_ANDROID)
+  if (strEqual(setup.touch.control_type, TOUCH_CONTROL_VIRTUAL_BUTTONS))
+    overlay.enabled = TRUE;
+#endif
+}
+
+void SetOverlayEnabled(boolean enabled)
+{
+  overlay.enabled = enabled;
 }
 
 void SetOverlayActive(boolean active)
@@ -1605,7 +1631,7 @@ void InitJoysticks()
   /* always start with reliable default values */
   joystick.status = JOYSTICK_NOT_AVAILABLE;
   for (i = 0; i < MAX_PLAYERS; i++)
-    joystick.fd[i] = -1;               /* joystick device closed */
+    joystick.nr[i] = -1;               /* no joystick configured */
 
   SDLInitJoysticks();
 }
@@ -1614,3 +1640,8 @@ boolean ReadJoystick(int nr, int *x, int *y, boolean *b1, boolean *b2)
 {
   return SDLReadJoystick(nr, x, y, b1, b2);
 }
+
+boolean CheckJoystickOpened(int nr)
+{
+  return SDLCheckJoystickOpened(nr);
+}