瀏覽代碼

Merge pull request #45932 from goostengine/sprite-convert-compressed

Fix sprite editor conversion tools to handle compressed textures
Rémi Verschelde 4 年之前
父節點
當前提交
5011a22731
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      editor/plugins/sprite_2d_editor_plugin.cpp

+ 5 - 0
editor/plugins/sprite_2d_editor_plugin.cpp

@@ -173,6 +173,11 @@ void Sprite2DEditor::_update_mesh_data() {
 
 	Ref<Image> image = texture->get_data();
 	ERR_FAIL_COND(image.is_null());
+
+	if (image->is_compressed()) {
+		image->decompress();
+	}
+
 	Rect2 rect;
 	if (node->is_region()) {
 		rect = node->get_region_rect();