From 2cc17f780a4b50ac3eebeb7e6865639926a611cd Mon Sep 17 00:00:00 2001 From: Rangi Date: Mon, 21 Feb 2022 08:58:22 -0500 Subject: [PATCH] Explain why make_frames works --- tools/pokemon_animation.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/pokemon_animation.c b/tools/pokemon_animation.c index cb5766896..1d2d8c6cd 100644 --- a/tools/pokemon_animation.c +++ b/tools/pokemon_animation.c @@ -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));