fix(world): remove non-retail portal exit fade
This commit is contained in:
parent
842bd89c16
commit
dded9e6b17
21 changed files with 919 additions and 347 deletions
|
|
@ -53,6 +53,21 @@ public sealed class PortalTunnelAssetTests
|
|||
Assert.Equal(DatReaderWriter.Enums.AnimationHookType.SoundTweaked, hook.HookType);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RequiredAssets_MissingSetupOrAnimationFailsWithActionableIds()
|
||||
{
|
||||
var error = Assert.Throws<InvalidOperationException>(() =>
|
||||
PortalTunnelPresentation.EnsureRequiredAssets(
|
||||
setupDid: 0u,
|
||||
setupLoaded: false,
|
||||
animationDid: 0x030005ACu,
|
||||
animationLoaded: true));
|
||||
|
||||
Assert.Contains("required retail DAT assets unavailable", error.Message);
|
||||
Assert.Contains("setup=0x00000000 (missing)", error.Message);
|
||||
Assert.Contains("animation=0x030005AC (ok)", error.Message);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PortalTunnelCamera_RollsAroundForwardAxisWithoutLeavingPassage()
|
||||
{
|
||||
|
|
@ -96,7 +111,7 @@ public sealed class PortalTunnelAssetTests
|
|||
|
||||
controller.Update(new TeleportAnimSnapshot(
|
||||
TeleportAnimState.TunnelFadeOut,
|
||||
FadeAlpha: 0.5f,
|
||||
ViewPlaneBlend: 0.5f,
|
||||
ShowTunnel: true,
|
||||
ShowPleaseWait: false));
|
||||
System.Numerics.Matrix4x4 projection = controller.Apply(baseProjection);
|
||||
|
|
@ -126,7 +141,7 @@ public sealed class PortalTunnelAssetTests
|
|||
|
||||
controller.Update(new TeleportAnimSnapshot(
|
||||
TeleportAnimState.WorldFadeIn,
|
||||
FadeAlpha: 1f,
|
||||
ViewPlaneBlend: 1f,
|
||||
ShowTunnel: false,
|
||||
ShowPleaseWait: false));
|
||||
System.Numerics.Matrix4x4 wideProjection = controller.Apply(baseProjection);
|
||||
|
|
@ -139,7 +154,7 @@ public sealed class PortalTunnelAssetTests
|
|||
|
||||
controller.Update(new TeleportAnimSnapshot(
|
||||
TeleportAnimState.Off,
|
||||
FadeAlpha: 0f,
|
||||
ViewPlaneBlend: 0f,
|
||||
ShowTunnel: false,
|
||||
ShowPleaseWait: false));
|
||||
|
||||
|
|
@ -147,6 +162,101 @@ public sealed class PortalTunnelAssetTests
|
|||
Assert.Equal(baseProjection, controller.Apply(baseProjection));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TeleportViewPlane_ApplyToSuppliesOverrideToEveryCameraConsumer()
|
||||
{
|
||||
var source = new PortalTunnelCamera
|
||||
{
|
||||
Aspect = 16f / 9f,
|
||||
FovRadians = MathF.PI / 3f,
|
||||
Near = 0.1f,
|
||||
Far = 5000f,
|
||||
};
|
||||
var controller = new TeleportViewPlaneController();
|
||||
controller.Begin(source.Projection);
|
||||
controller.Update(new TeleportAnimSnapshot(
|
||||
TeleportAnimState.WorldFadeIn,
|
||||
ViewPlaneBlend: 1f,
|
||||
ShowTunnel: false,
|
||||
ShowPleaseWait: false));
|
||||
|
||||
ICamera renderCamera = controller.ApplyTo(source);
|
||||
|
||||
Assert.Equal(source.View, renderCamera.View);
|
||||
Assert.Equal(
|
||||
TeleportViewPlaneController.TransitionViewPlaneDistance,
|
||||
renderCamera.Projection.M22,
|
||||
precision: 5);
|
||||
renderCamera.Aspect = 4f / 3f;
|
||||
Assert.Equal(4f / 3f, source.Aspect, precision: 5);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TeleportViewPlane_TunnelPreservesLogoutOverrideUntilTunnelContinue()
|
||||
{
|
||||
var capturedProjection = System.Numerics.Matrix4x4.CreatePerspectiveFieldOfView(
|
||||
MathF.PI / 3f,
|
||||
16f / 9f,
|
||||
0.1f,
|
||||
5000f);
|
||||
var changedProjection = System.Numerics.Matrix4x4.CreatePerspectiveFieldOfView(
|
||||
MathF.PI / 2f,
|
||||
16f / 9f,
|
||||
0.1f,
|
||||
5000f);
|
||||
var controller = new TeleportViewPlaneController();
|
||||
controller.Begin(capturedProjection);
|
||||
|
||||
controller.Update(new TeleportAnimSnapshot(
|
||||
TeleportAnimState.WorldFadeOut,
|
||||
ViewPlaneBlend: 1f,
|
||||
ShowTunnel: false,
|
||||
ShowPleaseWait: false));
|
||||
controller.Update(new TeleportAnimSnapshot(
|
||||
TeleportAnimState.TunnelFadeIn,
|
||||
ViewPlaneBlend: 0f,
|
||||
ShowTunnel: true,
|
||||
ShowPleaseWait: false));
|
||||
controller.Update(new TeleportAnimSnapshot(
|
||||
TeleportAnimState.Tunnel,
|
||||
ViewPlaneBlend: 0f,
|
||||
ShowTunnel: true,
|
||||
ShowPleaseWait: false));
|
||||
|
||||
Assert.True(controller.Enabled);
|
||||
Assert.Equal(capturedProjection.M22, controller.Apply(changedProjection).M22, precision: 5);
|
||||
|
||||
controller.Update(new TeleportAnimSnapshot(
|
||||
TeleportAnimState.TunnelContinue,
|
||||
ViewPlaneBlend: 0f,
|
||||
ShowTunnel: true,
|
||||
ShowPleaseWait: false));
|
||||
|
||||
Assert.False(controller.Enabled);
|
||||
Assert.Equal(changedProjection, controller.Apply(changedProjection));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TeleportViewPlane_NormalPortalTunnelDoesNotEnableOverride()
|
||||
{
|
||||
var baseProjection = System.Numerics.Matrix4x4.CreatePerspectiveFieldOfView(
|
||||
MathF.PI / 3f,
|
||||
16f / 9f,
|
||||
0.1f,
|
||||
5000f);
|
||||
var controller = new TeleportViewPlaneController();
|
||||
controller.Begin(baseProjection);
|
||||
|
||||
controller.Update(new TeleportAnimSnapshot(
|
||||
TeleportAnimState.Tunnel,
|
||||
ViewPlaneBlend: 0f,
|
||||
ShowTunnel: true,
|
||||
ShowPleaseWait: false));
|
||||
|
||||
Assert.False(controller.Enabled);
|
||||
Assert.Equal(baseProjection, controller.Apply(baseProjection));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(45f)]
|
||||
[InlineData(60f)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue