diff --git a/renderer/r_image.c b/renderer/r_image.c index 40a7e7f..0c67a8f 100644 --- a/renderer/r_image.c +++ b/renderer/r_image.c @@ -1127,7 +1127,11 @@ LoadPNG(char *filename, byte ** pic, int *width, int *height) if (my_png->ColorType == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png); if (my_png->ColorType == PNG_COLOR_TYPE_GRAY && my_png->BitDepth < 8) + #if PNG_LIBPNG_VER >= 10209 + png_set_expand_gray_1_2_4_to_8(png); + #else png_set_gray_1_2_4_to_8(png); + #endif /* Add alpha channel if present */ if (png_get_valid(png, pnginfo, PNG_INFO_tRNS))