Skip to content

Commit

Permalink
very very light cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Not Quite Hadouken committed Feb 4, 2025
1 parent 9898327 commit 7638708
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1330,16 +1330,16 @@ internal void RenderInternal(DrawingHandleWorld drawingHandle, Angle eyeRotation
switch (layer.RenderingStrategy)
{
case LayerRenderingStrategy.NoRotation:
layer.Render(drawingHandle, ref transformNoRot, angle, overrideDirection, (float)(eyeRotation + transformNoRot.Rotation()), normal: normal);
layer.Render(drawingHandle, ref transformNoRot, angle, overrideDirection, (float)eyeRotation, normal: normal);
break;
case LayerRenderingStrategy.SnapToCardinals:
layer.Render(drawingHandle, ref transformSnap, angle, overrideDirection, (float)(eyeRotation + transformSnap.Rotation()), normal: normal);
layer.Render(drawingHandle, ref transformSnap, angle, overrideDirection, (float)eyeRotation, normal: normal);
break;
case LayerRenderingStrategy.Default:
layer.Render(drawingHandle, ref transformDefault, angle, overrideDirection, (float)(eyeRotation + transformDefault.Rotation()), normal: normal);
layer.Render(drawingHandle, ref transformDefault, angle, overrideDirection, (float)eyeRotation, normal: normal);
break;
case LayerRenderingStrategy.UseSpriteStrategy:
layer.Render(drawingHandle, ref transformSprite, angle, overrideDirection, (float)(eyeRotation + transformSprite.Rotation()), normal: normal);
layer.Render(drawingHandle, ref transformSprite, angle, overrideDirection, (float)eyeRotation, normal: normal);
break;
default:
Logger.Error($"Tried to render a layer with unknown rendering stragegy: {layer.RenderingStrategy}");
Expand All @@ -1352,7 +1352,7 @@ internal void RenderInternal(DrawingHandleWorld drawingHandle, Angle eyeRotation
{
foreach (var layer in Layers)
{
layer.Render(drawingHandle, ref transformSprite, angle, overrideDirection, (float)(eyeRotation + transformSprite.Rotation()), normal: normal);
layer.Render(drawingHandle, ref transformSprite, angle, overrideDirection, (float)eyeRotation, normal: normal);
}
}
}
Expand Down Expand Up @@ -2023,7 +2023,7 @@ public static RsiDirection GetDirection(RsiDirectionType dirType, Angle angle)
/// <summary>
/// Render a layer. This assumes that the input angle is between 0 and 2pi.
/// </summary>
internal void Render(DrawingHandleWorld drawingHandle, ref Matrix3x2 spriteMatrix, Angle angle, Direction? overrideDirection, float textureRotation = 0f, bool normal = false)
internal void Render(DrawingHandleWorld drawingHandle, ref Matrix3x2 spriteMatrix, Angle angle, Direction? overrideDirection, float eyeRotation = 0f, bool normal = false)
{
if (!Visible || Blank)
return;
Expand All @@ -2048,7 +2048,7 @@ internal void Render(DrawingHandleWorld drawingHandle, ref Matrix3x2 spriteMatri
var transformMatrix = Matrix3x2.Multiply(layerMatrix, spriteMatrix);
drawingHandle.SetTransform(in transformMatrix);

RenderTexture(drawingHandle, texture, textureRotation, normal: normal);
RenderTexture(drawingHandle, texture, eyeRotation, normal: normal);
}
else
{
Expand Down Expand Up @@ -2084,7 +2084,7 @@ private void RenderTexture(DrawingHandleWorld drawingHandle, Texture texture, fl
{
NormalShader = normalShader.Mutable ? normalShader : normalShader.Duplicate();
drawingHandle.UseShader(NormalShader);
NormalShader.SetParameter("rotation", textureRotation);
NormalShader.SetParameter("rotation", textureRotation + (float)drawingHandle.GetTransform().Rotation());
}
else if (Shader != null)
drawingHandle.UseShader(Shader);
Expand Down

0 comments on commit 7638708

Please sign in to comment.