From 166696659e59d98bfab66c62d1b850284605ff04 Mon Sep 17 00:00:00 2001 From: Lucas Lima Date: Tue, 11 Oct 2022 11:35:39 -0300 Subject: Optimize Android export process --- platform/android/export/export_plugin.cpp | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'platform/android/export/export_plugin.cpp') diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index ef3b79b630..aaea59c900 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -2639,7 +2639,8 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref 0) { Ref fa = FileAccess::open(GDNATIVE_LIBS_PATH, FileAccess::WRITE); - fa->store_string(JSON::stringify(user_data.libs, "\t")); + JSON json; + fa->store_string(json.stringify(user_data.libs, "\t")); } } else { print_verbose("Saving apk expansion file.."); @@ -2901,20 +2902,22 @@ Error EditorExportPlatformAndroid::export_project_helper(const Refis_empty()) { - if (file == launcher_icons[i].export_path) { - _process_launcher_icons(file, main_image, launcher_icons[i].dimensions, data); + if (file.ends_with(".png") && file.contains("mipmap")) { + for (int i = 0; i < icon_densities_count; ++i) { + if (main_image.is_valid() && !main_image->is_empty()) { + if (file == launcher_icons[i].export_path) { + _process_launcher_icons(file, main_image, launcher_icons[i].dimensions, data); + } } - } - if (foreground.is_valid() && !foreground->is_empty()) { - if (file == launcher_adaptive_icon_foregrounds[i].export_path) { - _process_launcher_icons(file, foreground, launcher_adaptive_icon_foregrounds[i].dimensions, data); + if (foreground.is_valid() && !foreground->is_empty()) { + if (file == launcher_adaptive_icon_foregrounds[i].export_path) { + _process_launcher_icons(file, foreground, launcher_adaptive_icon_foregrounds[i].dimensions, data); + } } - } - if (background.is_valid() && !background->is_empty()) { - if (file == launcher_adaptive_icon_backgrounds[i].export_path) { - _process_launcher_icons(file, background, launcher_adaptive_icon_backgrounds[i].dimensions, data); + if (background.is_valid() && !background->is_empty()) { + if (file == launcher_adaptive_icon_backgrounds[i].export_path) { + _process_launcher_icons(file, background, launcher_adaptive_icon_backgrounds[i].dimensions, data); + } } } } -- cgit v1.2.3 From 975c588cf9a3d9f7d7901d0b658d5be0002f713a Mon Sep 17 00:00:00 2001 From: Lucas Lima Date: Tue, 11 Oct 2022 11:39:22 -0300 Subject: Revert change --- platform/android/export/export_plugin.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'platform/android/export/export_plugin.cpp') diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index aaea59c900..f17f1b58f4 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -2639,8 +2639,7 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref 0) { Ref fa = FileAccess::open(GDNATIVE_LIBS_PATH, FileAccess::WRITE); - JSON json; - fa->store_string(json.stringify(user_data.libs, "\t")); + fa->store_string(JSON::stringify(user_data.libs, "\t")); } } else { print_verbose("Saving apk expansion file.."); -- cgit v1.2.3