From e9dfd457c1cd5969fc73d5bf03e98507cee0946f Mon Sep 17 00:00:00 2001 From: iobyte Date: Fri, 4 Nov 2022 16:54:14 +0000 Subject: [PATCH] trackgen: fix libpng warning: interlace handling should be turned on when using png_read_image. git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@8623 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: bc73eb15f1e79cfcb2065d53d559cbd4653143de Former-commit-id: 4f328da75b7060bc26b93d1e5edda53f1fc23e3b --- src/libs/tgfclient/guitexture.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/tgfclient/guitexture.cpp b/src/libs/tgfclient/guitexture.cpp index 605680ffb..0ec73cf8b 100644 --- a/src/libs/tgfclient/guitexture.cpp +++ b/src/libs/tgfclient/guitexture.cpp @@ -203,6 +203,9 @@ GfTexReadImageFromPNG(const char *filename, float screen_gamma, int *pWidth, int png_get_IHDR(png_ptr, info_ptr, &src_width, &src_height, &bit_depth, &color_type, &interlace_type, NULL, NULL); + if (interlace_type != PNG_INTERLACE_NONE) + png_set_interlace_handling(png_ptr); + if (bit_depth == 1 && color_type == PNG_COLOR_TYPE_GRAY) png_set_invert_mono(png_ptr);