Add support for loading grayscale PNG. Fixes #644.

If I'd known it would be that easy, I'd have done it long ago.
This commit is contained in:
Stephen Anthony 2020-05-26 14:55:40 -02:30
parent 3728fb40b1
commit 97f6271412
2 changed files with 3 additions and 1 deletions

View File

@ -57,6 +57,8 @@
* Removed unused CV+ and DASH bank switching types. * Removed unused CV+ and DASH bank switching types.
* Added support for loading grayscale PNG images in the ROM launcher.
-Have fun! -Have fun!

View File

@ -89,7 +89,7 @@ void PNGLibrary::loadImage(const string& filename, FBSurface& surface)
} }
else if(color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) else if(color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
{ {
loadImageERROR("Greyscale PNG images not supported"); png_set_gray_to_rgb(png_ptr);
} }
else if(color_type == PNG_COLOR_TYPE_PALETTE) else if(color_type == PNG_COLOR_TYPE_PALETTE)
{ {