Skip to content

Commit

Permalink
wip2
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed Nov 15, 2023
1 parent 2190f6c commit e4ba3c2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 2 additions & 0 deletions osu.Framework/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ protected Game()
{
RelativeSizeAxes = Axes.Both;

ExtraRotation = Matrix3.CreateRotationX(MathF.PI / 4);

base.AddInternal(content = new Container
{
Anchor = Anchor.Centre,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ protected class CompositeDrawableDrawNode : DrawNode, ICompositeDrawNode

private int sourceChildrenCount;

private bool hasExtraRotation;

Check failure on line 69 in osu.Framework/Graphics/Containers/CompositeDrawable_DrawNode.cs

View workflow job for this annotation

GitHub Actions / Code Quality

Private member 'CompositeDrawableDrawNode.hasExtraRotation' can be removed as the value assigned to it is never read

Check failure on line 69 in osu.Framework/Graphics/Containers/CompositeDrawable_DrawNode.cs

View workflow job for this annotation

GitHub Actions / Code Quality

Private member 'CompositeDrawableDrawNode.hasExtraRotation' can be removed as the value assigned to it is never read

public CompositeDrawableDrawNode(CompositeDrawable source)
: base(source)
{
Expand All @@ -88,6 +90,8 @@ public override void ApplyState()
RectangleF shrunkDrawRectangle = Source.DrawRectangle.Normalize();
shrunkDrawRectangle = shrunkDrawRectangle.Shrink(new Vector2(Math.Min(shrunkDrawRectangle.Width / 2, shrinkage), Math.Min(shrunkDrawRectangle.Height / 2, shrinkage)));

hasExtraRotation = Source.ExtraRotation != Matrix3.Identity;

maskingInfo = !Source.Masking
? null
: new MaskingInfo
Expand Down
11 changes: 1 addition & 10 deletions osu.Framework/Graphics/Rendering/Renderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,7 @@ public void ScheduleDisposal<T>(Action<T> disposalAction, T target)
/// The draw depth is written to every vertex added to <see cref="IVertexBuffer"/>s.
/// </summary>
/// <param name="drawDepth">The draw depth.</param>
internal void SetDrawDepth(float drawDepth)
{
BackbufferDrawDepth = 1.5f;
}
internal void SetDrawDepth(float drawDepth) => BackbufferDrawDepth = drawDepth;

/// <summary>
/// Performs a once-off initialisation of this <see cref="Renderer"/>.
Expand Down Expand Up @@ -484,43 +481,37 @@ private void setViewport(RectangleI viewport)
public void PushScissor(RectangleI scissor)
{
scissorRectStack.Push(scissor);
setScissor(scissor);
}

public void PushScissorState(bool enabled)
{
scissorStateStack.Push(enabled);
setScissorState(enabled);
}

public void PushScissorOffset(Vector2I offset)
{
scissorOffsetStack.Push(offset);
setScissorOffset(offset);
}

public void PopScissor()
{
Trace.Assert(scissorRectStack.Count > 1);

scissorRectStack.Pop();
setScissor(scissorRectStack.Peek());
}

public void PopScissorState()
{
Trace.Assert(scissorStateStack.Count > 1);

scissorStateStack.Pop();
setScissorState(scissorStateStack.Peek());
}

public void PopScissorOffset()
{
Trace.Assert(scissorOffsetStack.Count > 1);

scissorOffsetStack.Pop();
setScissorOffset(scissorOffsetStack.Peek());
}

private void setScissor(RectangleI scissor)
Expand Down
7 changes: 5 additions & 2 deletions osu.Framework/Resources/Shaders/sh_Texture2D.vs
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,19 @@ layout(location = 4) out mediump vec2 v_BlendRange;
void main(void)
{
// Transform from screen space to masking space.
highp vec4 maskingPos = g_ToMaskingSpace * vec4(m_Position, 1.0, 1.0);
highp vec4 maskingPos = g_ToMaskingSpace * vec4(m_Position, 1.0 , 1.0);
v_MaskingPosition = maskingPos.xy / maskingPos.w;

v_Colour = m_Colour;
v_TexCoord = m_TexCoord;
v_TexRect = m_TexRect;
v_BlendRange = m_BlendRange;

gl_Position = g_ProjMatrix * vec4(m_Position, m_BackbufferDrawDepth, 1.0);
gl_Position = g_ProjMatrix * vec4(m_Position, 1.0, 1.0);
gl_Position /= gl_Position.w;

if (g_BackbufferDraw)
gl_Position.z = m_BackbufferDrawDepth;
}

#endif

0 comments on commit e4ba3c2

Please sign in to comment.