I was just porting Blocky World to the latest version of the simulator and I noticed a little issue. Apparently the code for the invisible color had disappeared in the Display::directPixel() function. It might be a good idea to add that back
Good catch! Will be replaced
Itâs missing again! Iâm not that experienced with Github, so I donât know how to make a PR, but you might want to fix it ASAP. I had purple lines all over my game at first
I also had a strange issue where the invisible color was looping around, so an invisible color of 16 did not draw pixels with color 0. I have no idea whatâs going on, but a quick addition of && invisiblecolor < 16
did the trick for now.
If you tell me what file and line number (if you know them) I can have a quick look and make a PR or something.
Pokitto\POKITTO_CORE\PokittoDisplay.cpp
Line 211
Sorry for the delay, was fixing code on another project.
Line 211 according to github is Display::directPixel
:
That doesnât seem right?
If you look on the page and find the bit of code youâre talking about, click the line number and itâll take your browser to the line number.
You can then either copy the url in your address bar or click on the ...
and there will be a Copy permalink
option which should copy the address into your clipboard.
Paste that here with the proposed change and Iâll turn it into a fork or a branch and make a PR for review.
(If none of that makes any sense, it basically means Iâll get the code change ready and let the others read it to make sure itâs right before it gets accepted.)
In between lines 211 and 212, add
if ((invisiblecolor<PALETTE_SIZE && invisiblecolor < 16 && color==palette[invisiblecolor])) return; //do not draw transparent pixels
I donât know whatâs going on with the PALETTE_SIZE, because when I put that without invisiblecolor < 16
, the invisible color was wrapping around to color 0. Someone might want to look into that, but this is at least a temporary fix thatâll work for 16-color palettes. I guess you could in theory add another argument to the function?
For the record Iâm not entirely sure this is the right solution, but I donât know enough about the display modes to judge either way.
Iâve made a PR out of it regardless and hopefully someone will come along and say âno this is wrongâ or âyes this is rightâ.
You could put a breakpoint in code and see why it fails in that line.
The PR has been merged.