@@ -212,11 +212,6 @@ static const char *android_perms[] = {
212212
213213static const char *MISMATCHED_VERSIONS_MESSAGE = " Android build version mismatch:\n | Template installed: %s\n | Requested version: %s\n Please reinstall Android build template from 'Project' menu." ;
214214
215- static const char *SPLASH_IMAGE_EXPORT_PATH = " res/drawable-nodpi/splash.png" ;
216- static const char *LEGACY_BUILD_SPLASH_IMAGE_EXPORT_PATH = " res/drawable-nodpi-v4/splash.png" ;
217- static const char *SPLASH_BG_COLOR_PATH = " res/drawable-nodpi/splash_bg_color.png" ;
218- static const char *LEGACY_BUILD_SPLASH_BG_COLOR_PATH = " res/drawable-nodpi-v4/splash_bg_color.png" ;
219- static const char *SPLASH_CONFIG_PATH = " res/drawable/splash_drawable.xml" ;
220215static const char *GDEXTENSION_LIBS_PATH = " libs/gdextensionlibs.json" ;
221216
222217static const int icon_densities_count = 6 ;
@@ -1642,67 +1637,6 @@ void EditorExportPlatformAndroid::_process_launcher_icons(const String &p_file_n
16421637 }
16431638}
16441639
1645- String EditorExportPlatformAndroid::load_splash_refs (Ref<Image> &splash_image, Ref<Image> &splash_bg_color_image) {
1646- bool scale_splash = GLOBAL_GET (" application/boot_splash/fullsize" );
1647- bool apply_filter = GLOBAL_GET (" application/boot_splash/use_filter" );
1648- bool show_splash_image = GLOBAL_GET (" application/boot_splash/show_image" );
1649- String project_splash_path = GLOBAL_GET (" application/boot_splash/image" );
1650-
1651- // Setup the splash bg color.
1652- bool bg_color_valid = false ;
1653- Color bg_color = ProjectSettings::get_singleton ()->get (" application/boot_splash/bg_color" , &bg_color_valid);
1654- if (!bg_color_valid) {
1655- bg_color = boot_splash_bg_color;
1656- }
1657-
1658- if (show_splash_image) {
1659- if (!project_splash_path.is_empty ()) {
1660- splash_image.instantiate ();
1661- print_verbose (" Loading splash image: " + project_splash_path);
1662- const Error err = ImageLoader::load_image (project_splash_path, splash_image);
1663- if (err) {
1664- if (OS::get_singleton ()->is_stdout_verbose ()) {
1665- print_error (" - unable to load splash image from " + project_splash_path + " (" + itos (err) + " )" );
1666- }
1667- splash_image.unref ();
1668- }
1669- }
1670- } else {
1671- splash_image.instantiate ();
1672- splash_image->initialize_data (1 , 1 , false , Image::FORMAT_RGBA8);
1673- splash_image->set_pixel (0 , 0 , bg_color);
1674- }
1675-
1676- if (splash_image.is_null ()) {
1677- // Use the default
1678- print_verbose (" Using default splash image." );
1679- splash_image = Ref<Image>(memnew (Image (boot_splash_png)));
1680- }
1681-
1682- if (scale_splash) {
1683- Size2 screen_size = Size2 (GLOBAL_GET (" display/window/size/viewport_width" ), GLOBAL_GET (" display/window/size/viewport_height" ));
1684- int width, height;
1685- if (screen_size.width > screen_size.height ) {
1686- // scale horizontally
1687- height = screen_size.height ;
1688- width = splash_image->get_width () * screen_size.height / splash_image->get_height ();
1689- } else {
1690- // scale vertically
1691- width = screen_size.width ;
1692- height = splash_image->get_height () * screen_size.width / splash_image->get_width ();
1693- }
1694- splash_image->resize (width, height);
1695- }
1696-
1697- print_verbose (" Creating splash background color image." );
1698- splash_bg_color_image.instantiate ();
1699- splash_bg_color_image->initialize_data (splash_image->get_width (), splash_image->get_height (), false , splash_image->get_format ());
1700- splash_bg_color_image->fill (bg_color);
1701-
1702- String processed_splash_config_xml = vformat (SPLASH_CONFIG_XML_CONTENT, bool_to_string (apply_filter));
1703- return processed_splash_config_xml;
1704- }
1705-
17061640void EditorExportPlatformAndroid::load_icon_refs (const Ref<EditorExportPreset> &p_preset, Ref<Image> &icon, Ref<Image> &foreground, Ref<Image> &background) {
17071641 String project_icon_path = GLOBAL_GET (" application/config/icon" );
17081642
@@ -1739,61 +1673,34 @@ void EditorExportPlatformAndroid::load_icon_refs(const Ref<EditorExportPreset> &
17391673}
17401674
17411675void EditorExportPlatformAndroid::_copy_icons_to_gradle_project (const Ref<EditorExportPreset> &p_preset,
1742- const String &processed_splash_config_xml,
1743- const Ref<Image> &splash_image,
1744- const Ref<Image> &splash_bg_color_image,
1745- const Ref<Image> &main_image,
1746- const Ref<Image> &foreground,
1747- const Ref<Image> &background) {
1676+ const Ref<Image> &p_main_image,
1677+ const Ref<Image> &p_foreground,
1678+ const Ref<Image> &p_background) {
17481679 String gradle_build_dir = ExportTemplateManager::get_android_build_directory (p_preset);
17491680
1750- // Store the splash configuration
1751- if (!processed_splash_config_xml.is_empty ()) {
1752- print_verbose (" Storing processed splash configuration: " + String (" \n " ) + processed_splash_config_xml);
1753- store_string_at_path (gradle_build_dir.path_join (SPLASH_CONFIG_PATH), processed_splash_config_xml);
1754- }
1755-
1756- // Store the splash image
1757- if (splash_image.is_valid () && !splash_image->is_empty ()) {
1758- String splash_export_path = gradle_build_dir.path_join (SPLASH_IMAGE_EXPORT_PATH);
1759- print_verbose (" Storing splash image in " + splash_export_path);
1760- Vector<uint8_t > data;
1761- _load_image_data (splash_image, data);
1762- store_file_at_path (splash_export_path, data);
1763- }
1764-
1765- // Store the splash bg color image
1766- if (splash_bg_color_image.is_valid () && !splash_bg_color_image->is_empty ()) {
1767- String splash_bg_color_path = gradle_build_dir.path_join (SPLASH_BG_COLOR_PATH);
1768- print_verbose (" Storing splash background image in " + splash_bg_color_path);
1769- Vector<uint8_t > data;
1770- _load_image_data (splash_bg_color_image, data);
1771- store_file_at_path (splash_bg_color_path, data);
1772- }
1773-
17741681 // Prepare images to be resized for the icons. If some image ends up being uninitialized,
17751682 // the default image from the export template will be used.
17761683
17771684 for (int i = 0 ; i < icon_densities_count; ++i) {
1778- if (main_image .is_valid () && !main_image ->is_empty ()) {
1685+ if (p_main_image .is_valid () && !p_main_image ->is_empty ()) {
17791686 print_verbose (" Processing launcher icon for dimension " + itos (launcher_icons[i].dimensions ) + " into " + launcher_icons[i].export_path );
17801687 Vector<uint8_t > data;
1781- _process_launcher_icons (launcher_icons[i].export_path , main_image , launcher_icons[i].dimensions , data);
1688+ _process_launcher_icons (launcher_icons[i].export_path , p_main_image , launcher_icons[i].dimensions , data);
17821689 store_file_at_path (gradle_build_dir.path_join (launcher_icons[i].export_path ), data);
17831690 }
17841691
1785- if (foreground .is_valid () && !foreground ->is_empty ()) {
1786- print_verbose (" Processing launcher adaptive icon foreground for dimension " + itos (launcher_adaptive_icon_foregrounds[i].dimensions ) + " into " + launcher_adaptive_icon_foregrounds[i].export_path );
1692+ if (p_foreground .is_valid () && !p_foreground ->is_empty ()) {
1693+ print_verbose (" Processing launcher adaptive icon p_foreground for dimension " + itos (launcher_adaptive_icon_foregrounds[i].dimensions ) + " into " + launcher_adaptive_icon_foregrounds[i].export_path );
17871694 Vector<uint8_t > data;
1788- _process_launcher_icons (launcher_adaptive_icon_foregrounds[i].export_path , foreground ,
1695+ _process_launcher_icons (launcher_adaptive_icon_foregrounds[i].export_path , p_foreground ,
17891696 launcher_adaptive_icon_foregrounds[i].dimensions , data);
17901697 store_file_at_path (gradle_build_dir.path_join (launcher_adaptive_icon_foregrounds[i].export_path ), data);
17911698 }
17921699
1793- if (background .is_valid () && !background ->is_empty ()) {
1794- print_verbose (" Processing launcher adaptive icon background for dimension " + itos (launcher_adaptive_icon_backgrounds[i].dimensions ) + " into " + launcher_adaptive_icon_backgrounds[i].export_path );
1700+ if (p_background .is_valid () && !p_background ->is_empty ()) {
1701+ print_verbose (" Processing launcher adaptive icon p_background for dimension " + itos (launcher_adaptive_icon_backgrounds[i].dimensions ) + " into " + launcher_adaptive_icon_backgrounds[i].export_path );
17951702 Vector<uint8_t > data;
1796- _process_launcher_icons (launcher_adaptive_icon_backgrounds[i].export_path , background ,
1703+ _process_launcher_icons (launcher_adaptive_icon_backgrounds[i].export_path , p_background ,
17971704 launcher_adaptive_icon_backgrounds[i].dimensions , data);
17981705 store_file_at_path (gradle_build_dir.path_join (launcher_adaptive_icon_backgrounds[i].export_path ), data);
17991706 }
@@ -3093,10 +3000,6 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref<EditorExportP
30933000 print_verbose (" - include filter: " + p_preset->get_include_filter ());
30943001 print_verbose (" - exclude filter: " + p_preset->get_exclude_filter ());
30953002
3096- Ref<Image> splash_image;
3097- Ref<Image> splash_bg_color_image;
3098- String processed_splash_config_xml = load_splash_refs (splash_image, splash_bg_color_image);
3099-
31003003 Ref<Image> main_image;
31013004 Ref<Image> foreground;
31023005 Ref<Image> background;
@@ -3172,7 +3075,7 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref<EditorExportP
31723075 add_message (EXPORT_MESSAGE_ERROR, TTR (" Export" ), TTR (" Unable to overwrite res/*.xml files with project name." ));
31733076 }
31743077 // Copies the project icon files into the appropriate Gradle project directory.
3175- _copy_icons_to_gradle_project (p_preset, processed_splash_config_xml, splash_image, splash_bg_color_image, main_image, foreground, background);
3078+ _copy_icons_to_gradle_project (p_preset, main_image, foreground, background);
31763079 // Write an AndroidManifest.xml file into the Gradle project directory.
31773080 _write_tmp_manifest (p_preset, p_give_internet, p_debug);
31783081
@@ -3486,16 +3389,6 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref<EditorExportP
34863389 _fix_resources (p_preset, data);
34873390 }
34883391
3489- // Process the splash image
3490- if ((file == SPLASH_IMAGE_EXPORT_PATH || file == LEGACY_BUILD_SPLASH_IMAGE_EXPORT_PATH) && splash_image.is_valid () && !splash_image->is_empty ()) {
3491- _load_image_data (splash_image, data);
3492- }
3493-
3494- // Process the splash bg color image
3495- if ((file == SPLASH_BG_COLOR_PATH || file == LEGACY_BUILD_SPLASH_BG_COLOR_PATH) && splash_bg_color_image.is_valid () && !splash_bg_color_image->is_empty ()) {
3496- _load_image_data (splash_bg_color_image, data);
3497- }
3498-
34993392 if (file.ends_with (" .png" ) && file.contains (" mipmap" )) {
35003393 for (int i = 0 ; i < icon_densities_count; ++i) {
35013394 if (main_image.is_valid () && !main_image->is_empty ()) {
0 commit comments