@Override
    public void setPixel(int x, int y, int c)
    {
        int bx = x / 8;
        int by = y / 8;

        int offs = bx + by * (width / 8) - tileOffset;
        if (offs < 0)
            return;

        offs *= 64;
        offs += x % 8 + 8 * (y % 8);
        if (offs < 0)
            return;
        if (offs >= data.length)
            return;
        data[offs] = (byte) c;
    }