]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - plugins/imagepng/plugin.cpp
radiant: redo 6011367, fix alpha channel for tRNS cheap transparency PNG
[xonotic/netradiant.git] / plugins / imagepng / plugin.cpp
index bf0874165c71dbbbfd8294970d2589063ac77826..4bdf2b0a9833d9c1ca7d7d3e902e25f739a4de47 100644 (file)
@@ -19,8 +19,6 @@
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "plugin.h"
-
 #include "debugging/debugging.h"
 
 #include "ifilesystem.h"
@@ -115,7 +113,7 @@ Image* LoadPNGBuff( unsigned char* fbuffer ){
                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;
 
@@ -182,11 +180,13 @@ class ImagePNGAPI
 _QERPlugImageTable m_imagepng;
 public:
 typedef _QERPlugImageTable Type;
+
 STRING_CONSTANT( Name, "png" );
 
 ImagePNGAPI(){
        m_imagepng.loadImage = LoadPNG;
 }
+
 _QERPlugImageTable* getTable(){
        return &m_imagepng;
 }