samhocevar/zepto8

Fill pattern is reversed

Closed this issue · 2 comments

It looks like the fill pattern layout is not behaving correctly. I believe that it is in reverse order of what is should be. Using the following test:

function _draw()
fillp(0b0001001101111111)
rectfill(0,0,127,127,0x18)
end

I get the following results (Pico 8 on the left, zepto 8 on the right)

FillP-zepto8-vs-pico8

I think this could be fixed by changing line 89 of gfx.cpp from

if ((color_bits >> ((x & 3) + 4 * (y & 3))) & 0x1)

to

if ((color_bits >> (15 - ((x & 3) + 4 * (y & 3)))) & 0x1)

and I would have opened a PR, but I'm having trouble getting it to build so I could validate the fix.

Good guess! That fixed it.

Let me know if you need assistance building zepto8; it should be as straightforward as initialising all submodules (recursively) and loading zepto8.sln inside Visual Studio.

Now I feel silly. I just had to modify my installation to include Universal CRT SDK (the errors I was getting were that it couldn't locate the standard c headers like string.h). Builds fine now. Thanks!