Plombo said:Look into the possibility of using 24-bit PNGs for backgrounds (not sprites). The framework for this is already in place, wejust don't have a 24-bit PNG loadereven already have a 24-bit PNG loader which we use for the OpenBOR logo/menu graphics.
Well, I looked into it. Here's the rundown:
- For static backgrounds (title screen, loading screens, etc.) it should be doable with a bit of work. In 16/32-bit mode, these use a global s_screen variable called "background" with pixelformat PIXEL_x8, and loading one of these backgrounds just updates the contents of the background without reallocating it. The load_background() and unload_background() functions (and load_cached_background() used by the Wii) will need to be changed to allow PIXEL_32 backgrounds to be loaded as well by reallocating the background if necessary.
- For the furthest-back layer of level background, there are no glaring issues.
- For other background/foreground layers, there is the glaring issue of transparency. 32-bit images don't have a transparent color like 8-bit ones, so we have the problem of defining which colors should be transparent. The easiest solution to this problem would be to use the unused color channel in PIXEL_32 color for an alpha channel, and add a new blending mode to drawmethod where the source color replaces the destination color if and only if its alpha != 0.