mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 18:32:55 +08:00
Fix invalid GC latency mode being set
This commit is contained in:
parent
1a51e5b56a
commit
ce367bcc42
@ -13,15 +13,18 @@ namespace osu.Game.Overlays.Settings.Sections.Debug
|
|||||||
{
|
{
|
||||||
protected override string Header => "Garbage Collector";
|
protected override string Header => "Garbage Collector";
|
||||||
|
|
||||||
|
private readonly Bindable<LatencyMode> latencyMode = new Bindable<LatencyMode>();
|
||||||
|
private Bindable<GCLatencyMode> configLatencyMode;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(FrameworkDebugConfigManager config)
|
private void load(FrameworkDebugConfigManager config)
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new SettingsEnumDropdown<GCLatencyMode>
|
new SettingsEnumDropdown<LatencyMode>
|
||||||
{
|
{
|
||||||
LabelText = "Active mode",
|
LabelText = "Active mode",
|
||||||
Bindable = config.GetBindable<GCLatencyMode>(DebugSetting.ActiveGCMode)
|
Bindable = latencyMode
|
||||||
},
|
},
|
||||||
new SettingsButton
|
new SettingsButton
|
||||||
{
|
{
|
||||||
@ -29,6 +32,18 @@ namespace osu.Game.Overlays.Settings.Sections.Debug
|
|||||||
Action = GC.Collect
|
Action = GC.Collect
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
configLatencyMode = config.GetBindable<GCLatencyMode>(DebugSetting.ActiveGCMode);
|
||||||
|
configLatencyMode.BindValueChanged(v => latencyMode.Value = (LatencyMode)v, true);
|
||||||
|
latencyMode.BindValueChanged(v => configLatencyMode.Value = (GCLatencyMode)v);
|
||||||
|
}
|
||||||
|
|
||||||
|
private enum LatencyMode
|
||||||
|
{
|
||||||
|
Batch = GCLatencyMode.Batch,
|
||||||
|
Interactive = GCLatencyMode.Interactive,
|
||||||
|
LowLatency = GCLatencyMode.LowLatency,
|
||||||
|
SustainedLowLatency = GCLatencyMode.SustainedLowLatency
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user