mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-03 21:06:58 +00:00
(svn r19628) -Change: support the tRNS chunk to read transparency information for RGB PNGs (Szvengar)
This commit is contained in:
parent
ac6e8a211c
commit
51ea33f92f
@ -132,8 +132,13 @@ static bool LoadPNG(SpriteLoader::Sprite *sprite, const char *filename, uint32 i
|
||||
}
|
||||
|
||||
if (colour_type == PNG_COLOR_TYPE_RGB) {
|
||||
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);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user