removed checking for debug mode when using debug logging
[rocksndiamonds.git] / src / screens.c
index a5d9d45fd62053da4df73f4d68912e6add29bdff..2917ac72ce3daada7afc78771278d21d17223c56 100644 (file)
@@ -1580,10 +1580,6 @@ void DrawMainMenu(void)
     return;
   }
 
-  // needed if last screen was the setup screen and fullscreen state changed
-  // (moved to "execSetupGraphics()" to change fullscreen state directly)
-  // ToggleFullscreenOrChangeWindowScalingIfNeeded();
-
   // leveldir_current may be invalid (level group, parent link)
   if (!validLevelSeries(leveldir_current))
     leveldir_current = getFirstValidTreeInfoEntry(leveldir_last_valid);
@@ -5327,7 +5323,7 @@ static void execSetupGraphics(void)
     ModifyGameSpeedIfNeeded();
 
   // window scaling may have changed at this point
-  ToggleFullscreenOrChangeWindowScalingIfNeeded();
+  ChangeWindowScalingIfNeeded();
 
   // window scaling quality may have changed at this point
   if (!strEqual(setup.window_scaling_quality, video.window_scaling_quality))
@@ -5336,8 +5332,23 @@ static void execSetupGraphics(void)
   // screen rendering mode may have changed at this point
   SDLSetScreenRenderingMode(setup.screen_rendering_mode);
 
+  int setup_vsync_mode = VSYNC_MODE_STR_TO_INT(setup.vsync_mode);
+  int video_vsync_mode = video.vsync_mode;
+
   // screen vsync mode may have changed at this point
   ChangeVsyncModeIfNeeded();
+
+  // check if setting vsync mode to selected value failed
+  if (setup_vsync_mode != video_vsync_mode &&
+      setup_vsync_mode != video.vsync_mode)
+  {
+    // changing vsync mode to selected value failed -- reset displayed value
+    execSetupGraphics_setVsyncModes(TRUE);
+
+    Request("Setting VSync failed!", REQ_CONFIRM);
+
+    DrawSetupScreen();
+  }
 }
 
 static void execSetupChooseWindowSize(void)
@@ -6861,7 +6872,7 @@ static void changeSetupValue(int screen_pos, int setup_info_pos_raw, int dx)
 
   // fullscreen state may have changed at this point
   if (si->value == &setup.fullscreen)
-    ToggleFullscreenOrChangeWindowScalingIfNeeded();
+    ToggleFullscreenIfNeeded();
 
   // network mode may have changed at this point
   if (si->value == &setup.network_mode)
@@ -7594,9 +7605,9 @@ static boolean ConfigureJoystickMapButtonsAndAxes(SDL_Joystick *joystick)
 
 #if DEBUG_JOYSTICKS
   // print info about the joystick we are watching
-  Error(ERR_DEBUG, "watching joystick %d: (%s)\n",
+  Debug("joystick", "watching joystick %d: (%s)",
        SDL_JoystickInstanceID(joystick), name);
-  Error(ERR_DEBUG, "joystick has %d axes, %d hats, %d balls, and %d buttons\n",
+  Debug("joystick", "joystick has %d axes, %d hats, %d balls, and %d buttons",
        SDL_JoystickNumAxes(joystick), SDL_JoystickNumHats(joystick),
        SDL_JoystickNumBalls(joystick), SDL_JoystickNumButtons(joystick));
 #endif
@@ -7853,7 +7864,7 @@ static boolean ConfigureJoystickMapButtonsAndAxes(SDL_Joystick *joystick)
   if (success)
   {
 #if DEBUG_JOYSTICKS
-    Error(ERR_DEBUG, "New game controller mapping:\n\n%s\n\n", mapping);
+    Debug("joystick", "New game controller mapping:\n\n%s\n\n", mapping);
 #endif
 
     // activate mapping for this game
@@ -8428,7 +8439,7 @@ void HandleGameActions(void)
   GameActions();       // main game loop
 
   if (tape.auto_play && !tape.playing)
-    AutoPlayTape();    // continue automatically playing next tape
+    AutoPlayTapes();   // continue automatically playing next tape
 }