// accessor functions public int[] Get16x16TilePixels() { int[] pixels = new int[16 * 16]; int color = 0; if (subtile_tiles == null) { color = Color.Red.ToArgb(); } if (Bits.Empty(subtile_bytes)) { color = Color.Gray.ToArgb(); } if (subtile_tiles == null || Bits.Empty(subtile_bytes)) { for (int i = 0; i < 16; i++) { pixels[i * 16 + i] = color; // UL to LR pixels[i * 16 + 15 - i] = color; // UR to LL pixels[i] = color; // top line pixels[i * 16] = color; // left line pixels[i * 16 + 15] = color; // right line pixels[15 * 16 + i] = color; // bottom line } return(pixels); } for (int i = 0, a = 0, b = 0; i < 4; i++) { a = (i == 0) || (i == 2) ? 0 : 8; b = (i == 0) || (i == 1) ? 0 : 8; for (int y = 0; y < 8; y++) { for (int x = 0; x < 8; x++) { pixels[x + a + ((y + b) * 16)] = subtile_tiles[i].Pixels[y * 8 + x]; } } } if (mirror) { Do.FlipHorizontal(pixels, 16, 16); } if (invert) { Do.FlipVertical(pixels, 16, 16); } return(pixels); }