diff --git a/DuckGame/AddedContent/DGRSettings.cs b/DuckGame/AddedContent/DGRSettings.cs index 05db001d..1a793ade 100644 --- a/DuckGame/AddedContent/DGRSettings.cs +++ b/DuckGame/AddedContent/DGRSettings.cs @@ -314,19 +314,10 @@ public static bool UseVSync set { MonoMain.graphics.SynchronizeWithVerticalRetrace = value; - //when vsync is ON we never want to use the draw rate limiter because vsync will do that - if (value) - { - Program.main.UseDrawRateLimiter = false; - } - //when vsync is OFF we only want to use the rate limiter if: - //Uncapped FPS is on && The user has set a target fps that is not 0 - else - { - Program.main.UseDrawRateLimiter = (UncappedFPS && TargetFrameRate != 0); - } - S_UseVSync = value; + // Rate limiter is also applied as a safety net: vsync silently fails to cap on some + // setups (G-Sync / FreeSync / certain windowed configs), so honor FPS Target regardless. + Program.main.UseDrawRateLimiter = UncappedFPS && TargetFrameRate >= 60; MonoMain.graphics.ApplyChanges(); } } @@ -343,17 +334,9 @@ public static int TargetFrameRate } set { - if (value >= 60) - { - Program.main.DrawRateLimiterTarget = S_TargetFrameRate; - Program.main.UseDrawRateLimiter = true; - S_TargetFrameRate = value; - } - else - { - Program.main.UseDrawRateLimiter = false; - S_TargetFrameRate = 0; - } + S_TargetFrameRate = value >= 60 ? value : 0; + Program.main.DrawRateLimiterTarget = Math.Max(S_TargetFrameRate, 60); + Program.main.UseDrawRateLimiter = UncappedFPS && S_TargetFrameRate >= 60; } } @@ -362,7 +345,7 @@ public static void InitalizeFPSThings() MonoMain.graphics.SynchronizeWithVerticalRetrace = UseVSync; Program.main.UnFixedDraw = UncappedFPS; Program.main.DrawRateLimiterTarget = Math.Max(TargetFrameRate,60); - Program.main.UseDrawRateLimiter = !UseVSync && UncappedFPS && TargetFrameRate >= 60; + Program.main.UseDrawRateLimiter = UncappedFPS && TargetFrameRate >= 60; Program.main.TargetElapsedTime = TimeSpan.FromTicks(163934); // Default to 61ups -Lucky diff --git a/DuckGame/src/MonoTime/Options.cs b/DuckGame/src/MonoTime/Options.cs index 534273b6..1aac87bf 100644 --- a/DuckGame/src/MonoTime/Options.cs +++ b/DuckGame/src/MonoTime/Options.cs @@ -534,7 +534,7 @@ public static UIMenu CreateDGRGraphicsMenu(UIMenu pPrev) }); menu.Add(new UIMenuItemToggle("Use V-Sync", field: new FieldBinding(typeof(DGRSettings), nameof(DGRSettings.UseVSync))) { - dgrDescription = "Verticaly synced drawing, overrides FPS target (REQUIRES RESTART)" + dgrDescription = "Vertically synced drawing. Works alongside FPS Target as a cap (REQUIRES RESTART)" }); menu.Add(new UIMenuItemNumber("FPS Target", field: new FieldBinding(typeof(DGRSettings), nameof(DGRSettings.TargetFrameRate), 0, 1000, 60), step: 60)