Browse Source

engine: common: imagelib: img_png.c: set IMAGE_HAS_ALPHA flag only for RGBA images.

pull/2/head
Andrey Akhmichin 4 years ago committed by Alibek Omarov
parent
commit
e69956c9ea
  1. 6
      engine/common/imagelib/img_png.c

6
engine/common/imagelib/img_png.c

@ -232,7 +232,11 @@ qboolean Image_LoadPNG( const char *name, const byte *buffer, fs_offset_t filesi
image.width = png_hdr.ihdr_chunk.width; image.width = png_hdr.ihdr_chunk.width;
image.height = png_hdr.ihdr_chunk.height; image.height = png_hdr.ihdr_chunk.height;
image.size = image.height * image.width * 4; image.size = image.height * image.width * 4;
image.flags |= IMAGE_HAS_ALPHA | IMAGE_HAS_COLOR; image.flags |= IMAGE_HAS_COLOR;
if( png_hdr.ihdr_chunk.colortype == PNG_CT_RGBA )
image.flags |= IMAGE_HAS_ALPHA;
image.depth = 1; image.depth = 1;
rowsize = pixel_size * image.width; rowsize = pixel_size * image.width;

Loading…
Cancel
Save