From 7b1c27df577b63da7ab2d0643a03f66fdefea324 Mon Sep 17 00:00:00 2001 From: Daniel Wong Date: Wed, 2 Feb 2022 14:03:04 +1100 Subject: [PATCH] Disable character rotation in 4:3 mode to avoid artifacting (#72) - Currently the method used to clip sprites to the 4:3 window doesn't work with rotation - As there are only 2 places across all the games where this issue happens, we just disable character rotation in those scenes rather than trying to fix it properly - This should only affect images from the `sprite` or `portrait` folder --- Assets.Scripts.Core.Scene/Layer.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Assets.Scripts.Core.Scene/Layer.cs b/Assets.Scripts.Core.Scene/Layer.cs index 4515dfb7..0021e5e3 100644 --- a/Assets.Scripts.Core.Scene/Layer.cs +++ b/Assets.Scripts.Core.Scene/Layer.cs @@ -389,6 +389,13 @@ private void EnsureCorrectlySizedMesh(int width, int height, LayerAlignment alig this.ForceSize = forceSize; this.aspectRatio = (float)width / height; cachedStretchToFit = stretchToFit; + + // Do not rotate character sprites when using 4:3 letterboxing as current method does not handle it properly + if (ryukishiClamp) + { + targetAngle = 0; + transform.localRotation = Quaternion.AngleAxis(targetAngle, Vector3.forward); + } } public void DrawLayerWithMask(string textureName, string maskName, int x, int y, Vector2? origin, Vector2? forceSize, bool isBustshot, int style, float wait, bool isBlocking, Action afterLayerUpdated) @@ -561,6 +568,12 @@ public void DrawLayer(string textureName, int x, int y, int z, Vector2? origin, public void SetAngle(float angle, float wait) { + // Do not rotate character sprites when using 4:3 letterboxing as current method does not handle it properly + if(cachedRyukishiClamp) + { + return; + } + base.transform.localRotation = Quaternion.AngleAxis(targetAngle, Vector3.forward); targetAngle = angle; GameSystem.Instance.RegisterAction(delegate