changed simple "printf()" debug output to new debug log function
[rocksndiamonds.git] / src / libgame / system.c
index af3e053607781e7e1b83ed5dfb911396584f6441..b0b8d4775236b8005ed1a5cae12ee39cb411be46 100644 (file)
@@ -4,7 +4,7 @@
 // (c) 1995-2014 by Artsoft Entertainment
 //                         Holger Schemel
 //                 info@artsoft.org
-//                 http://www.artsoft.org/
+//                 https://www.artsoft.org/
 // ----------------------------------------------------------------------------
 // system.c
 // ============================================================================
@@ -57,6 +57,7 @@ int                   button_status = MB_NOT_PRESSED;
 boolean                        motion_status = FALSE;
 int                    wheel_steps = DEFAULT_WHEEL_STEPS;
 boolean                        keyrepeat_status = TRUE;
+boolean                        textinput_status = FALSE;
 
 int                    redraw_mask = REDRAW_NONE;
 
@@ -136,14 +137,14 @@ void InitScoresInfo(void)
   {
     if (program.global_scores)
     {
-      Error(ERR_DEBUG, "Using global, multi-user scores directory '%s'.",
+      Debug("internal:path", "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.)");
+      Debug("internal:path", "Remove to enable single-user scores directory.");
+      Debug("internal:path", "(This enables multipe score entries per user.)");
     }
     else
     {
-      Error(ERR_DEBUG, "Using private, single-user scores directory.");
+      Debug("internal:path", "Using private, single-user scores directory.");
     }
   }
 #endif
@@ -1168,7 +1169,8 @@ void ReloadCustomImage(Bitmap *bitmap, char *basename)
 
   if (filename == NULL)                // (should never happen)
   {
-    Error(ERR_WARN, "ReloadCustomImage(): cannot find file '%s'", basename);
+    Warn("ReloadCustomImage(): cannot find file '%s'", basename);
+
     return;
   }
 
@@ -1183,16 +1185,19 @@ void ReloadCustomImage(Bitmap *bitmap, char *basename)
 
   if ((new_bitmap = LoadImage(filename)) == NULL)
   {
-    Error(ERR_WARN, "LoadImage('%s') failed: %s", basename, GetError());
+    Warn("LoadImage('%s') failed: %s", basename, GetError());
+
     return;
   }
 
   if (bitmap->width != new_bitmap->width ||
       bitmap->height != new_bitmap->height)
   {
-    Error(ERR_WARN, "ReloadCustomImage: new image '%s' has wrong dimensions",
+    Warn("ReloadCustomImage: new image '%s' has wrong dimensions",
          filename);
+
     FreeBitmap(new_bitmap);
+
     return;
   }
 
@@ -1753,6 +1758,8 @@ KeyMod GetKeyModStateFromEvents(void)
 
 void StartTextInput(int x, int y, int width, int height)
 {
+  textinput_status = TRUE;
+
 #if defined(HAS_SCREEN_KEYBOARD)
   SDL_StartTextInput();
 
@@ -1767,6 +1774,8 @@ void StartTextInput(int x, int y, int width, int height)
 
 void StopTextInput(void)
 {
+  textinput_status = FALSE;
+
 #if defined(HAS_SCREEN_KEYBOARD)
   SDL_StopTextInput();