(svn r19628) -Change: support the tRNS chunk to read transparency information for RGB PNGs (Szvengar)

pull/155/head
rubidium 14 years ago
parent 87097a8fb2
commit 0f6d129840

@ -132,7 +132,12 @@ static bool LoadPNG(SpriteLoader::Sprite *sprite, const char *filename, uint32 i
}
if (colour_type == PNG_COLOR_TYPE_RGB) {
png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER);
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
/* Create an alpha channel when there is a tRNS chunk */
png_set_tRNS_to_alpha(png_ptr);
} else {
png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER);
}
}
pixelsize = sizeof(uint32);

Loading…
Cancel
Save