From 773295842ac5cae66da0361d6c4914faee80fb00 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Sun, 10 Nov 2019 12:40:44 +0000 Subject: IMAGE: Remove unnecessary check from Image::writePNG() Surfaces with pixel formats not supported by libpng are already converted to RGBA, meaning that the check isn't needed.--- image/png.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'image') diff --git a/image/png.cpp b/image/png.cpp index e854651da6..9532840f2f 100644 --- a/image/png.cpp +++ b/image/png.cpp @@ -265,16 +265,6 @@ bool writePNG(Common::WriteStream &out, const Graphics::Surface &input, const bo const Graphics::PixelFormat requiredFormat_4byte(4, 8, 8, 8, 8, 24, 16, 8, 0); #endif - if (input.format.bytesPerPixel == 3) { - if (input.format != requiredFormat_3byte) { - warning("Cannot currently write PNG with 3-byte pixel format other than %s", requiredFormat_3byte.toString().c_str()); - return false; - } - } else if (input.format.bytesPerPixel != 4) { - warning("Cannot currently write PNG with pixel format of bpp other than 3, 4"); - return false; - } - int colorType; Graphics::Surface *tmp = NULL; const Graphics::Surface *surface; -- cgit v1.2.3