mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 05:31:01 +00:00 
			
		
		
		
	-Support the TRNS flag on libpng, fixes #3097
This commit is contained in:
		
							parent
							
								
									de7fe2fced
								
							
						
					
					
						commit
						08e536dbe0
					
				
					 2 changed files with 9 additions and 2 deletions
				
			
		|  | @ -124,6 +124,13 @@ Error ImageLoaderPNG::_load_image(void *rf_up,png_rw_ptr p_func,Image *p_image) | |||
| 		png_read_update_info(png, info); | ||||
| 	} | ||||
| 
 | ||||
| 	if (png_get_valid(png,info,PNG_INFO_tRNS)) { | ||||
| //		png_set_expand_gray_1_2_4_to_8(png);
 | ||||
| 		png_set_tRNS_to_alpha(png); | ||||
| 		png_read_update_info(png, info); | ||||
| 		png_get_IHDR(png, info, &width, &height, &depth, &color, NULL, NULL, NULL); | ||||
| 	} | ||||
| 
 | ||||
| 	int palette_colors = 0; | ||||
| 	int palette_components = 0; | ||||
| 	int components = 0; | ||||
|  |  | |||
|  | @ -2045,7 +2045,7 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String& p | |||
| 			if (img.empty()) | ||||
| 				p_item->set_text(1,"[Image (empty)]"); | ||||
| 			else | ||||
| 				p_item->set_text(1,"[Image "+itos(img.get_width())+"x"+itos(img.get_height())+"]"); | ||||
| 				p_item->set_text(1,"[Image "+itos(img.get_width())+"x"+itos(img.get_height())+"-"+String(Image::get_format_name(img.get_format()))+"]"); | ||||
| 
 | ||||
| 		} break; | ||||
| 		case Variant::NODE_PATH: { | ||||
|  | @ -3007,7 +3007,7 @@ void PropertyEditor::update_tree() { | |||
| 				if (img.empty()) | ||||
| 					item->set_text(1,"[Image (empty)]"); | ||||
| 				else | ||||
| 					item->set_text(1,"[Image "+itos(img.get_width())+"x"+itos(img.get_height())+"]"); | ||||
| 					item->set_text(1,"[Image "+itos(img.get_width())+"x"+itos(img.get_height())+"-"+String(Image::get_format_name(img.get_format()))+"]"); | ||||
| 				if (show_type_icons) | ||||
| 					item->set_icon( 0,get_icon("Image","EditorIcons") ); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Juan Linietsky
						Juan Linietsky