public static void BlackOut(byte[] pixels, int shape, int orientation, int w, int h)
{
//Blacks out the pixels that aren't part of the shape.
for (int y = 0; y < h; y++)
{
for (int x = 0; x < w; x++)
{
if (!Tetronimos.IsIn(shape, orientation, x, y, w, h))
{
//blacken pixel
int index = x + y * w;
pixels[3 * index] = 0;
pixels[3 * index + 1] = 0;
pixels[3 * index + 2] = 0;
}
}
}
}