support 16bit png loading in radiant
This commit is contained in:
parent
ecab0a6522
commit
f3ffdf9f28
|
|
@ -107,6 +107,9 @@ Image* LoadPNGBuff( unsigned char* fbuffer ){
|
||||||
if ( color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8 ) {
|
if ( color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8 ) {
|
||||||
png_set_expand_gray_1_2_4_to_8( png_ptr );
|
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 ) ) {
|
if ( png_get_valid( png_ptr, info_ptr, PNG_INFO_tRNS ) ) {
|
||||||
png_set_tRNS_to_alpha( png_ptr );
|
png_set_tRNS_to_alpha( png_ptr );
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user