Move gene value check

negligible speed ++ lul
This commit is contained in:
Kurt
2020-05-18 10:23:56 -07:00
parent 09711ff43e
commit 0be1bb87a1

View File

@@ -102,6 +102,8 @@ private static void DrawDirectionals(int[] data, ItemLayer layer, int w, int x0,
tile = layer.GetTile(x - tile.ExtensionX, y - tile.ExtensionY);
}
var geneValue = ((uint)tile.Genes >> (geneIndex * 2)) & 3;
if (geneValue == 0)
continue;
DrawGene(data, (x - x0) * scale, (y - y0) * scale, scale, w, geneValue, geneIndex);
}
}
@@ -110,8 +112,6 @@ private static void DrawDirectionals(int[] data, ItemLayer layer, int w, int x0,
private static void DrawGene(int[] data, int x0, int y0, int scale, int w, uint geneValue, int geneIndex)
{
if (geneValue == 0)
return;
var c = ShiftToGeneCoordinate(ref x0, ref y0, scale, geneIndex);
FillSquare(data, x0, y0, scale / 2, w, c, geneValue == 3 ? 1 : 2);