Explain why make_frames works

This commit is contained in:
Rangi 2022-02-21 08:58:22 -05:00
parent 418b73bc6d
commit 2cc17f780a

View File

@ -107,8 +107,7 @@ void make_frames(const uint8_t *tilemap, long tilemap_size, int width, struct Fr
}
bitmask->bitlength++;
}
// I don't remember exactly why this works.
// I think it was that the bits are read backwards, but not indexed backwards.
// tile order ABCDEFGHIJKLMNOP... becomes db order %HGFEDCBA %PONMLKJI ...
int last = bitmask->bitlength - 1;
bitmask->data[last / 8] >>= (7 - (last % 8));