feat(A.5 T22.5): QualityPreset schema + tests (commit 1/2)
Add QualityPreset enum + QualitySettings readonly record struct with From(preset) table and WithEnvOverrides() env-var override layer. Four presets (Low/Medium/High/Ultra) drive NearRadius, FarRadius, MsaaSamples, AnisotropicLevel, AlphaToCoverage, MaxCompletionsPerFrame. Env vars (ACDREAM_NEAR_RADIUS, ACDREAM_FAR_RADIUS, ACDREAM_MSAA_SAMPLES, ACDREAM_ANISOTROPIC, ACDREAM_A2C, ACDREAM_MAX_COMPLETIONS_PER_FRAME) override individual preset fields for dev spot-testing. DisplaySettings gains a Quality: QualityPreset field (default High); SettingsStore persists/loads it under display."quality" as an enum name string with Enum.TryParse fallback. 12 new QualityPresetTests cover the preset table (radii, msaa, aniso, a2c, completions) and all six env-var override paths. 415 UI.Abstractions tests passing. Wiring into GameWindow / WbDrawDispatcher / TerrainAtlas follows in commit 2 of this task. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c473feedb3
commit
afa4200107
5 changed files with 272 additions and 9 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using AcDream.UI.Abstractions.Settings;
|
||||
|
||||
namespace AcDream.UI.Abstractions.Panels.Settings;
|
||||
|
||||
|
|
@ -20,7 +21,8 @@ public sealed record DisplaySettings(
|
|||
bool VSync,
|
||||
float FieldOfView,
|
||||
float Gamma,
|
||||
bool ShowFps)
|
||||
bool ShowFps,
|
||||
QualityPreset Quality)
|
||||
{
|
||||
/// <summary>Values used on first launch / when settings.json is absent.
|
||||
/// All defaults pinned to the pre-L.0 runtime state — Resolution
|
||||
|
|
@ -35,7 +37,8 @@ public sealed record DisplaySettings(
|
|||
VSync: false,
|
||||
FieldOfView: 60f,
|
||||
Gamma: 1.0f,
|
||||
ShowFps: true);
|
||||
ShowFps: true,
|
||||
Quality: QualityPreset.High);
|
||||
|
||||
/// <summary>16:9 resolution presets offered in the dropdown.</summary>
|
||||
public static IReadOnlyList<string> AvailableResolutions { get; } = new[]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue