support 16bit png loading in radiant

This commit is contained in:
Garux 2024-03-30 09:22:58 +05:00
parent ecab0a6522
commit f3ffdf9f28

View File

@ -107,6 +107,9 @@ Image* LoadPNGBuff( unsigned char* fbuffer ){
if ( color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8 ) {
png_set_expand_gray_1_2_4_to_8( png_ptr );
}
else if( bit_depth == 16 ){
png_set_strip_16( png_ptr );
}
if ( png_get_valid( png_ptr, info_ptr, PNG_INFO_tRNS ) ) {
png_set_tRNS_to_alpha( png_ptr );