Skip to content

Commit

Permalink
Don't require TaskScheduler FPS flag (#1938)
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaboxer committed Jun 14, 2024
1 parent 989ba00 commit 5fdfc90
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 21 deletions.
17 changes: 0 additions & 17 deletions Bloxstrap/FastFlagManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,23 +245,6 @@ public override void Load()
string? val = GetPreset("UI.Menu.Style.EnableV4.1");
if (GetPreset("UI.Menu.Style.EnableV4.2") != val)
SetPreset("UI.Menu.Style.EnableV4.2", val);

if (GetPreset("Rendering.Framerate") is not null)
return;

// set it to be the framerate of the primary display by default

var screen = Screen.AllScreens.Where(x => x.Primary).Single();
var devmode = new DEVMODEW();

PInvoke.EnumDisplaySettings(screen.DeviceName, ENUM_DISPLAY_SETTINGS_MODE.ENUM_CURRENT_SETTINGS, ref devmode);

uint framerate = devmode.dmDisplayFrequency;

if (framerate <= 100)
framerate *= 2;

SetPreset("Rendering.Framerate", framerate);
}
}
}
11 changes: 9 additions & 2 deletions Bloxstrap/InstallChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ internal static void CheckUpgrade()

// update migrations

if (App.BuildMetadata.CommitRef.StartsWith("tag"))
if (App.BuildMetadata.CommitRef.StartsWith("tag") && currentVersionInfo.ProductVersion is not null)
{
if (existingVersionInfo.ProductVersion == "2.4.0")
{
Expand All @@ -227,7 +227,7 @@ internal static void CheckUpgrade()

App.FastFlags.Save();
}
else if (currentVersionInfo.ProductVersion == "2.6.0")
else if (currentVersionInfo.ProductVersion.StartsWith("2.6.0"))
{
if (App.Settings.Prop.UseDisableAppPatch)
{
Expand All @@ -246,6 +246,13 @@ internal static void CheckUpgrade()
if (App.Settings.Prop.BootstrapperStyle == BootstrapperStyle.ClassicFluentDialog)
App.Settings.Prop.BootstrapperStyle = BootstrapperStyle.FluentDialog;

_ = int.TryParse(App.FastFlags.GetPreset("Rendering.Framerate"), out int x);
if (x == 0)
{
App.FastFlags.SetPreset("Rendering.Framerate", null);
App.FastFlags.Save();
}

App.Settings.Save();
}
}
Expand Down
4 changes: 2 additions & 2 deletions Bloxstrap/UI/ViewModels/Menu/FastFlagsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public string StateOverlayFlags

public int FramerateLimit
{
get => int.TryParse(App.FastFlags.GetPreset("Rendering.Framerate"), out int x) ? x : 60;
set => App.FastFlags.SetPreset("Rendering.Framerate", value);
get => int.TryParse(App.FastFlags.GetPreset("Rendering.Framerate"), out int x) ? x : 0;
set => App.FastFlags.SetPreset("Rendering.Framerate", value == 0 ? null : value);
}

public IReadOnlyDictionary<RenderingMode, string> RenderingModes => FastFlagManager.RenderingModes;
Expand Down

0 comments on commit 5fdfc90

Please sign in to comment.