]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
radiant: fix alpha channel for palette-with-transparency png
authorThomas Debesse <dev@illwieckz.net>
Sun, 15 Jul 2018 18:44:12 +0000 (20:44 +0200)
committerThomas Debesse <dev@illwieckz.net>
Tue, 2 Oct 2018 23:24:04 +0000 (01:24 +0200)
plugins/imagepng/plugin.cpp

index 8a9f582d0fad1d13b5011086096cf4043a01c454..65ae59509b5c9c84368386f6580a12a6a8ee29e7 100644 (file)
@@ -114,9 +114,7 @@ Image *LoadPNGBuff(unsigned char *fbuffer)
 
     if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
         png_set_tRNS_to_alpha(png_ptr);
-    }
-
-    if (!(color_type & PNG_COLOR_MASK_ALPHA)) {
+    } else if (!(color_type & PNG_COLOR_MASK_ALPHA)) {
         // Set the background color to draw transparent and alpha images over.
         png_color_16 my_background, *image_background;