refactor(app): compose content effects and audio startup
Move Phase-2 startup behind typed composition/publication boundaries, replace the GameWindow-capturing PhysicsScript gate with a focused deferred source, and own animation-hook registrations reversibly. Make OpenAL construction and teardown transactional so every device, context, source, and buffer prefix is retryable without replay.
This commit is contained in:
parent
1d51e35c14
commit
60a1698ce7
12 changed files with 1901 additions and 152 deletions
|
|
@ -54,7 +54,8 @@ public sealed class GameWindowSlice8BoundaryTests
|
|||
"GameWindowPlatformResult<GL, IInputContext> platform = AcquirePlatform();",
|
||||
"new HostInputCameraCompositionPhase(",
|
||||
"this).Compose(platform);",
|
||||
"_dats = RuntimeDatCollectionFactory.OpenReadOnly(_datDir);",
|
||||
"new ContentEffectsAudioCompositionPhase(",
|
||||
"this).Compose(platform, hostInputCamera);",
|
||||
"_runtimeSettings.ApplyStartup(",
|
||||
"new RuntimeSettingsStartupTargets(",
|
||||
"_uiHost = _retailUiLease.AcquireHost(",
|
||||
|
|
@ -342,6 +343,7 @@ public sealed class GameWindowSlice8BoundaryTests
|
|||
"new ResourceShutdownStage(\"frame borrowers\"",
|
||||
"new ResourceShutdownStage(\"session dependents\"",
|
||||
"new ResourceShutdownStage(\"live entities\"",
|
||||
"new ResourceShutdownStage(\"effect dispatch edges\"",
|
||||
"new ResourceShutdownStage(\"live entity dependents\"",
|
||||
"new ResourceShutdownStage(\"submitted GPU work\"",
|
||||
"new ResourceShutdownStage(\"render frontends\"",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
using AcDream.App.Rendering.Vfx;
|
||||
|
||||
namespace AcDream.App.Tests.Rendering.Vfx;
|
||||
|
||||
public sealed class EntityEffectAdvanceSourceTests
|
||||
{
|
||||
[Fact]
|
||||
public void DefaultsOpenThenForwardsOneExactOwnerAndUnbindsOnlyThatOwner()
|
||||
{
|
||||
var source = new DeferredEntityEffectAdvanceSource();
|
||||
var first = new Target(false);
|
||||
var other = new Target(true);
|
||||
|
||||
Assert.True(source.CanAdvanceOwner(42));
|
||||
source.Bind(first);
|
||||
Assert.False(source.CanAdvanceOwner(42));
|
||||
source.Unbind(other);
|
||||
Assert.False(source.CanAdvanceOwner(42));
|
||||
source.Unbind(first);
|
||||
Assert.True(source.CanAdvanceOwner(42));
|
||||
source.Bind(other);
|
||||
Assert.True(source.CanAdvanceOwner(42));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RejectsASecondOwnerAndDeactivationIsTerminalAndOpenForShutdown()
|
||||
{
|
||||
var source = new DeferredEntityEffectAdvanceSource();
|
||||
var first = new Target(false);
|
||||
source.Bind(first);
|
||||
|
||||
Assert.Throws<InvalidOperationException>(() => source.Bind(new Target(true)));
|
||||
source.Deactivate();
|
||||
|
||||
Assert.True(source.CanAdvanceOwner(1));
|
||||
Assert.Throws<ObjectDisposedException>(() => source.Bind(first));
|
||||
}
|
||||
|
||||
private sealed class Target(bool result) : IEntityEffectAdvanceSource
|
||||
{
|
||||
public bool CanAdvanceOwner(uint ownerLocalId) => result;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue