feat(render): implement Campaign AR and terrain fidelity
This commit is contained in:
parent
99cf26e00c
commit
7a5f96ede5
368 changed files with 50611 additions and 950 deletions
|
|
@ -298,12 +298,13 @@ public sealed class RuntimeSettingsControllerTests
|
|||
var target = new SilkRuntimeDisplayWindowTarget(
|
||||
surface, switcher, _ => false);
|
||||
|
||||
target.Apply(DisplaySettings.Default with
|
||||
RuntimeDisplayApplyResult result = target.Apply(DisplaySettings.Default with
|
||||
{
|
||||
Fullscreen = true,
|
||||
Resolution = "1234x777",
|
||||
});
|
||||
|
||||
Assert.False(result.Fullscreen);
|
||||
Assert.Empty(switcher.Calls);
|
||||
Assert.Equal(0, surface.Writes);
|
||||
}
|
||||
|
|
@ -318,12 +319,13 @@ public sealed class RuntimeSettingsControllerTests
|
|||
var target = new SilkRuntimeDisplayWindowTarget(
|
||||
surface, switcher, _ => true);
|
||||
|
||||
target.Apply(DisplaySettings.Default with
|
||||
RuntimeDisplayApplyResult result = target.Apply(DisplaySettings.Default with
|
||||
{
|
||||
Fullscreen = true,
|
||||
Resolution = "1920x1080",
|
||||
});
|
||||
|
||||
Assert.False(result.Fullscreen);
|
||||
Assert.False(switcher.IsFullscreen);
|
||||
Assert.Equal(0, surface.Writes);
|
||||
}
|
||||
|
|
@ -879,6 +881,80 @@ public sealed class RuntimeSettingsControllerTests
|
|||
Assert.Contains(logs, line => line.Contains("display save failed", StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RefusedFullscreenRequest_ReconcilesPersistedAndPublishedState()
|
||||
{
|
||||
var events = new List<string>();
|
||||
var storage = new FakeStorage(events);
|
||||
var controller = new RuntimeSettingsController(
|
||||
storage,
|
||||
static preset => QualitySettings.From(preset),
|
||||
static _ => { });
|
||||
storage.ClearEvents();
|
||||
var targets = new FakeRuntimeTargets(events)
|
||||
{
|
||||
DisplayResult = new RuntimeDisplayApplyResult(Fullscreen: false),
|
||||
};
|
||||
controller.BindRuntimeTargets(targets);
|
||||
var observed = new List<DisplaySettings>();
|
||||
controller.DisplayChanged += observed.Add;
|
||||
|
||||
controller.SaveDisplay(controller.Display with
|
||||
{
|
||||
Fullscreen = true,
|
||||
Resolution = "2056x1290",
|
||||
});
|
||||
|
||||
Assert.Equal(2, storage.DisplaySaves);
|
||||
Assert.False(storage.DisplayValue.Fullscreen);
|
||||
Assert.False(controller.Display.Fullscreen);
|
||||
Assert.False(Assert.Single(observed).Fullscreen);
|
||||
Assert.Equal(
|
||||
["save-display", "target-display", "save-display", "target-quality"],
|
||||
events);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Successful_display_commit_publishes_render_pack_selection_once()
|
||||
{
|
||||
var storage = new FakeStorage();
|
||||
RuntimeSettingsController controller = CreateController(storage);
|
||||
var observed = new List<DisplaySettings>();
|
||||
controller.DisplayChanged += observed.Add;
|
||||
DisplaySettings selected = controller.Display with
|
||||
{
|
||||
RenderPack = new RenderPackSelectionSettings(
|
||||
"acdream.atmospheric",
|
||||
"1.0.0",
|
||||
"medium"),
|
||||
};
|
||||
|
||||
controller.SaveDisplay(selected);
|
||||
|
||||
Assert.Same(selected, controller.Display);
|
||||
Assert.Equal([selected], observed);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Failed_display_commit_does_not_publish_render_pack_selection()
|
||||
{
|
||||
var storage = new FakeStorage { ThrowOnDisplaySave = true };
|
||||
RuntimeSettingsController controller = CreateController(storage);
|
||||
int observed = 0;
|
||||
controller.DisplayChanged += _ => observed++;
|
||||
|
||||
controller.SaveDisplay(controller.Display with
|
||||
{
|
||||
RenderPack = new RenderPackSelectionSettings(
|
||||
"acdream.atmospheric",
|
||||
"1.0.0",
|
||||
"high"),
|
||||
});
|
||||
|
||||
Assert.Equal(0, observed);
|
||||
Assert.True(controller.Display.RenderPack.IsRetail);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NonDisplayPersistenceFailuresContinueAndPreserveControllerState()
|
||||
{
|
||||
|
|
@ -1132,7 +1208,7 @@ public sealed class RuntimeSettingsControllerTests
|
|||
|
||||
public int RemainingAudioFailures { get; set; }
|
||||
|
||||
public void ApplyDisplay(DisplaySettings display)
|
||||
public RuntimeDisplayApplyResult ApplyDisplay(DisplaySettings display)
|
||||
{
|
||||
events.Add("startup-display");
|
||||
|
||||
|
|
@ -1141,6 +1217,7 @@ public sealed class RuntimeSettingsControllerTests
|
|||
RemainingDisplayFailures--;
|
||||
throw new InvalidOperationException("display startup failed");
|
||||
}
|
||||
return new RuntimeDisplayApplyResult(display.Fullscreen);
|
||||
}
|
||||
|
||||
public void ApplyAudio(AudioSettings audio)
|
||||
|
|
@ -1161,15 +1238,18 @@ public sealed class RuntimeSettingsControllerTests
|
|||
|
||||
public bool ThrowOnQuality { get; init; }
|
||||
|
||||
public RuntimeDisplayApplyResult? DisplayResult { get; init; }
|
||||
|
||||
public int RemainingUiLockFailures { get; set; }
|
||||
|
||||
public int UiLockCalls { get; private set; }
|
||||
|
||||
public void ApplyDisplayWindowState(DisplaySettings display)
|
||||
public RuntimeDisplayApplyResult ApplyDisplayWindowState(DisplaySettings display)
|
||||
{
|
||||
events.Add("target-display");
|
||||
if (ThrowOnDisplay)
|
||||
throw new InvalidOperationException("display target failed");
|
||||
return DisplayResult ?? new RuntimeDisplayApplyResult(display.Fullscreen);
|
||||
}
|
||||
|
||||
public void ApplyQuality(QualitySettings quality)
|
||||
|
|
@ -1235,10 +1315,11 @@ public sealed class RuntimeSettingsControllerTests
|
|||
{
|
||||
public int ApplyCount { get; private set; }
|
||||
|
||||
public void Apply(DisplaySettings display)
|
||||
public RuntimeDisplayApplyResult Apply(DisplaySettings display)
|
||||
{
|
||||
ApplyCount++;
|
||||
apply(display);
|
||||
return new RuntimeDisplayApplyResult(display.Fullscreen);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue