From 97f6271412599659eb0900551d229acb5e73e245 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Tue, 26 May 2020 14:55:40 -0230 Subject: [PATCH] Add support for loading grayscale PNG. Fixes #644. If I'd known it would be that easy, I'd have done it long ago. --- Changes.txt | 2 ++ src/common/PNGLibrary.cxx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Changes.txt b/Changes.txt index 3d7a18ef4..df70e30c0 100644 --- a/Changes.txt +++ b/Changes.txt @@ -57,6 +57,8 @@ * Removed unused CV+ and DASH bank switching types. + * Added support for loading grayscale PNG images in the ROM launcher. + -Have fun! diff --git a/src/common/PNGLibrary.cxx b/src/common/PNGLibrary.cxx index e1980a975..23dd798d6 100644 --- a/src/common/PNGLibrary.cxx +++ b/src/common/PNGLibrary.cxx @@ -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) { - loadImageERROR("Greyscale PNG images not supported"); + png_set_gray_to_rgb(png_ptr); } else if(color_type == PNG_COLOR_TYPE_PALETTE) {