Screen rendering as pure white
finchco opened this issue · 9 comments
Running the examples it looks like everything renders pure white, with the exception of the lighting demo (which just looks really jacked up, but you can see stuff at least).
I loaded the CP437 png and colored it something other than white and now it shows up. Looks like the library is clearing the background to white instead of black maybe? Still looking at it.
Ok, it looks like it's something that's not playing right with the default bg color in ROT.Display's init function.
If I explicitly override the defaults in the constructor like this:
ROT.Display(80, 40, 1, {255,255,255,255}, {0,0,0,255})
then it works just fine.
Turns out that was just luck. The real problem is that Love2d changed how it handles color values since the last update to rotLove. They used to be 0->255
and now they're 0.0->1.0
floats.
I'll put a pull request together that has a few other fixes that I made today (setting the texture filtering to linear+nearest for the font png so it doesn't fuzz out when it scales above 1, a few other small things)
To fix the issue, simply replace lines 42 and 43 of Display.lua with:
self.defaultForegroundColor=dfg and dfg or { 1.0,1.0,1.0,1.0 }
self.defaultBackgroundColor=dbg and dbg or { 0.0,0.0,0.0,1.0 }
It looks like this project is abandoned, so I'll probably fork it and add my improvements there. This solution is for anyone that makes it as far as I did to save them the time I spent figuring out the problem.
not abandoned, I just don't really work on it anymore
happy to accept any and all pull requests!
Ok, cool! I'm making a few fixes outside of just the colors. Couple of questions:
- In display.lua why do you do
self.graphics=love.graphics
instead of just referencing love.graphics? - Is there a particular reason that you're using a canvas here rather than just writing directly to the screen?
I'll roll back to a clean version to make my PR for the color fixes, which will include some of the examples as well.
Thanks!
- That's likely just something I saw somewhere else and interpreted as a best practice at the time
- I don't think there was any specific reason I did that like that
Ok, cool. Thanks! I'm doing some optimization and also writing a simple rogue clone to include as a new example.
Ok, I FINALLY got back to cleaning up my changes for a PR. It's submitted and ready for your review!