Skip to content

Commit

Permalink
autotile sort adjustment
Browse files Browse the repository at this point in the history
saint11 committed Oct 15, 2024
1 parent 7372acb commit 89011fb
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Murder/Assets/Graphics/TilesetAsset.cs
Original file line number Diff line number Diff line change
@@ -98,11 +98,11 @@ public void CalculateAndDrawAutoTile(RenderContext render, int x, int y, bool to

// Top Left Inside Corner
if (topLeft && topRight && botLeft && !botRight)
DrawTile(batch, x, y, 1, 3, alpha, color, blend, 1);
DrawTile(batch, x, y, 1, 3, alpha, color, blend, 0);

// Top Right Inside Corner
if (topLeft && topRight && !botLeft && botRight)
DrawTile(batch, x, y, 2, 3, alpha, color, blend, 1);
DrawTile(batch, x, y, 2, 3, alpha, color, blend, 0);

// Bottom Left Inside Corner
if (topLeft && !topRight && botLeft && botRight)
4 changes: 2 additions & 2 deletions src/Murder/Services/TileServices.cs
Original file line number Diff line number Diff line change
@@ -76,11 +76,11 @@ public static (int tile, int sortAdjust) GetAutoTile(bool topLeft, bool topRight

// Top Left Inside Corner
if (topLeft && topRight && botLeft && !botRight)
return (Calculator.OneD(1, 3, 3), 1);
return (Calculator.OneD(1, 3, 3), 0);

// Top Right Inside Corner
if (topLeft && topRight && !botLeft && botRight)
return (Calculator.OneD(2, 3, 3), 1);
return (Calculator.OneD(2, 3, 3), 0);

// Bottom Left Inside Corner
if (topLeft && !topRight && botLeft && botRight)
4 changes: 2 additions & 2 deletions src/Murder/Systems/Graphics/TilemapNoFloorRenderSystem.cs
Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ public void Draw(RenderContext render, Context context)
rectangle.X - Grid.HalfCellSize, rectangle.Y - Grid.HalfCellSize,
tile.tile % 3, Calculator.FloorToInt(tile.tile / 3f),
1f, Color.White,
RenderServices.BLEND_NORMAL, tile.sortAdjust);
RenderServices.BLEND_NORMAL, tile.sortAdjust - 1);
}

for (int j = 0; j < asset.AdditionalTiles.Length; j++)
@@ -86,7 +86,7 @@ public void Draw(RenderContext render, Context context)
rectangle.X - Grid.HalfCellSize, rectangle.Y - Grid.HalfCellSize,
tile.tile % 3, Calculator.FloorToInt(tile.tile / 3f),
1f, Color.White,
RenderServices.BLEND_NORMAL, tile.sortAdjust);
RenderServices.BLEND_NORMAL, tile.sortAdjust - 1);
}

}

0 comments on commit 89011fb

Please sign in to comment.