Skip to content

Commit

Permalink
Disable character rotation in 4:3 mode to avoid artifacting (#72)
Browse files Browse the repository at this point in the history
 - 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
  • Loading branch information
drojf committed Sep 21, 2022
1 parent 0e2f77a commit 7fbac57
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Assets.Scripts.Core.Scene/Layer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,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, System.Action<Texture2D> afterLayerUpdated)
Expand Down Expand Up @@ -549,6 +556,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
Expand Down

0 comments on commit 7fbac57

Please sign in to comment.