Skip to content

Commit

Permalink
Fix some rendering glitches
Browse files Browse the repository at this point in the history
  • Loading branch information
Rampastring committed Sep 23, 2024
1 parent c0db86a commit 659e732
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/TSMapEditor/Rendering/MapView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ public void DrawVisibleMapPortion()
ReferenceStencil = 1,
DepthBufferEnable = true,
DepthBufferWriteEnable = false,
DepthBufferFunction = CompareFunction.GreaterEqual,
DepthBufferFunction = CompareFunction.Greater,
};
}

Expand Down
8 changes: 4 additions & 4 deletions src/TSMapEditor/Rendering/ObjectRenderers/ObjectRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ protected virtual void DrawShadow(T gameObject, in CommonDrawParams drawParams,
protected virtual float GetDepth(T gameObject, Texture2D texture)
{
var tile = Map.GetTile(gameObject.Position);
int textureHeightInCells = texture.Height / Constants.CellHeight;
if (textureHeightInCells == 0)
textureHeightInCells++;
// int textureHeightInCells = texture.Height / Constants.CellHeight;
// if (textureHeightInCells == 0)
// textureHeightInCells++;

return (tile.Level + textureHeightInCells) * Constants.DepthRenderStep;
return (tile.Level + 1) * Constants.DepthRenderStep;
}

protected void DrawShapeImage(T gameObject, ShapeImage image, int frameIndex, Color color,
Expand Down

0 comments on commit 659e732

Please sign in to comment.