Visually indicate dropped items instead of placed items

This commit is contained in:
Kurt
2020-05-10 11:27:47 -07:00
parent a801b1854f
commit 4d1bff3869

View File

@@ -84,12 +84,32 @@ private static void DrawDirectionals(int[] data, FieldItemLayer layer, int w, in
continue;
if (tile.IsBuried)
DrawX(data, (x - x0) * scale, (y - y0) * scale, scale, w);
else if (tile.IsDropped)
DrawPlus(data, (x - x0) * scale, (y - y0) * scale, scale, w);
else if (tile.IsExtension)
DrawDirectional(data, tile, (x - x0) * scale, (y - y0) * scale, scale, w);
}
}
}
private static void DrawPlus(int[] data, int x0, int y0, int scale, int w)
{
var x0y0 = (w * y0) + x0;
var s2 = scale / 2;
var ws2 = w * s2;
var v0 = x0y0 + s2;
var h0 = x0y0 + ws2;
for (int x = scale / 4; x <= 3 * (scale / 4); x++)
{
var vert = v0 + (w * x);
data[vert] ^= 0x808080;
var hori = h0 + x;
data[hori] ^= 0x808080;
}
}
private static void DrawX(int[] data, int x0, int y0, int scale, int w)
{
var opposite = scale - 1;