From 072f6feabac70a6c4ed1a16f4e983bf31ad62d50 Mon Sep 17 00:00:00 2001 From: kobewi Date: Fri, 22 Jul 2022 20:06:19 +0200 Subject: Make some Image methods static --- editor/import/resource_importer_layered_texture.cpp | 4 +--- editor/import/resource_importer_texture_atlas.cpp | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'editor/import') diff --git a/editor/import/resource_importer_layered_texture.cpp b/editor/import/resource_importer_layered_texture.cpp index 9dafa47c1c..e1df78e741 100644 --- a/editor/import/resource_importer_layered_texture.cpp +++ b/editor/import/resource_importer_layered_texture.cpp @@ -186,9 +186,7 @@ void ResourceImporterLayeredTexture::_save_tex(Vector> p_images, cons int mm_d = MAX(1, d >> 1); for (int i = 0; i < mm_d; i++) { - Ref mm; - mm.instantiate(); - mm->create(mm_w, mm_h, false, p_images[0]->get_format()); + Ref mm = Image::create_empty(mm_w, mm_h, false, p_images[0]->get_format()); Vector3 pos; pos.z = float(i) * float(d) / float(mm_d) + 0.5; for (int x = 0; x < mm_w; x++) { diff --git a/editor/import/resource_importer_texture_atlas.cpp b/editor/import/resource_importer_texture_atlas.cpp index 9171f04f42..bf22a9377e 100644 --- a/editor/import/resource_importer_texture_atlas.cpp +++ b/editor/import/resource_importer_texture_atlas.cpp @@ -273,9 +273,7 @@ Error ResourceImporterTextureAtlas::import_group_file(const String &p_group_file EditorAtlasPacker::chart_pack(charts, atlas_width, atlas_height); //blit the atlas - Ref new_atlas; - new_atlas.instantiate(); - new_atlas->create(atlas_width, atlas_height, false, Image::FORMAT_RGBA8); + Ref new_atlas = Image::create_empty(atlas_width, atlas_height, false, Image::FORMAT_RGBA8); for (int i = 0; i < pack_data_files.size(); i++) { PackData &pack_data = pack_data_files.write[i]; -- cgit v1.2.3