From 2f2ec196a620b925a0a287b2ac297d6375e0e8ea Mon Sep 17 00:00:00 2001 From: Flowaria Date: Tue, 1 Oct 2024 19:03:26 +0900 Subject: [PATCH] Slightly modified drawcode to handle guidelined sheets --- Tiles/BaseTiles/BaseMonolith.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tiles/BaseTiles/BaseMonolith.cs b/Tiles/BaseTiles/BaseMonolith.cs index e79b4860e2..39221e8685 100644 --- a/Tiles/BaseTiles/BaseMonolith.cs +++ b/Tiles/BaseTiles/BaseMonolith.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Tiles.BaseTiles public abstract int AnimationFrameCount { get; } public abstract int AnimationDelay { get; } public abstract int CursorItemType { get; } + public virtual bool HasBottomTile18PixelsHeight => true; public int EnabledFrameY => AnimationFrameHeight; /// @@ -122,7 +123,10 @@ namespace CalamityMod.Tiles.BaseTiles var drawPos = new Vector2(i * 16, j * 16) - Main.screenPosition + zero; var animateFrameOffset = (tile.TileFrameY >= EnabledFrameY) ? Main.tileFrame[Type] * AnimationFrameHeight : 0; - var rect = new Rectangle(tile.TileFrameX, tile.TileFrameY + animateFrameOffset, 18, 18); + var isHeight18Pixels = HasBottomTile18PixelsHeight && (tile.TileFrameY % AnimationFrameHeight) >= (18 * (TileHeight - 1)); + var height = isHeight18Pixels ? 18 : 16; + + var rect = new Rectangle(tile.TileFrameX, tile.TileFrameY + animateFrameOffset, 16, height); var drawColor = Lighting.GetColor(i, j); var glowColor = GetGlowMaskDrawColor(i, j);