From 3ee3d6e3469c366c8960d23dea408355902f3d34 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 11 Jan 2023 10:11:11 -0500 Subject: [PATCH] Support reducing png bit depth --- tools/gbagfx/convert_png.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/gbagfx/convert_png.c b/tools/gbagfx/convert_png.c index 4f1b39e6d..a5fefbd8b 100644 --- a/tools/gbagfx/convert_png.c +++ b/tools/gbagfx/convert_png.c @@ -62,10 +62,7 @@ static unsigned char *ConvertBitDepth(unsigned char *src, int srcBitDepth, int d for (j = 8 - srcBitDepth; j >= 0; j -= srcBitDepth) { - unsigned char pixel = (srcByte >> j) % (1 << srcBitDepth); - - if (pixel >= (1 << destBitDepth)) - FATAL_ERROR("Image exceeds the maximum color value for a %ibpp image.\n", destBitDepth); + unsigned char pixel = (srcByte >> j) % (1 << destBitDepth); *dest |= pixel << destBit; destBit -= destBitDepth; if (destBit < 0)