Skip to content

Commit 7771936

Browse files
committed
Fix Andorid disabling splash screen Show Image
1 parent 5ee9831 commit 7771936

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

platform/android/export/export_plugin.cpp

+22-15
Original file line numberDiff line numberDiff line change
@@ -1542,18 +1542,32 @@ void EditorExportPlatformAndroid::_process_launcher_icons(const String &p_file_n
15421542
String EditorExportPlatformAndroid::load_splash_refs(Ref<Image> &splash_image, Ref<Image> &splash_bg_color_image) {
15431543
bool scale_splash = GLOBAL_GET("application/boot_splash/fullsize");
15441544
bool apply_filter = GLOBAL_GET("application/boot_splash/use_filter");
1545+
bool show_splash_image = GLOBAL_GET("application/boot_splash/show_image");
15451546
String project_splash_path = GLOBAL_GET("application/boot_splash/image");
15461547

1547-
if (!project_splash_path.is_empty()) {
1548-
splash_image.instantiate();
1549-
print_verbose("Loading splash image: " + project_splash_path);
1550-
const Error err = ImageLoader::load_image(project_splash_path, splash_image);
1551-
if (err) {
1552-
if (OS::get_singleton()->is_stdout_verbose()) {
1553-
print_error("- unable to load splash image from " + project_splash_path + " (" + itos(err) + ")");
1548+
// Setup the splash bg color.
1549+
bool bg_color_valid = false;
1550+
Color bg_color = ProjectSettings::get_singleton()->get("application/boot_splash/bg_color", &bg_color_valid);
1551+
if (!bg_color_valid) {
1552+
bg_color = boot_splash_bg_color;
1553+
}
1554+
1555+
if (show_splash_image) {
1556+
if (!project_splash_path.is_empty()) {
1557+
splash_image.instantiate();
1558+
print_verbose("Loading splash image: " + project_splash_path);
1559+
const Error err = ImageLoader::load_image(project_splash_path, splash_image);
1560+
if (err) {
1561+
if (OS::get_singleton()->is_stdout_verbose()) {
1562+
print_error("- unable to load splash image from " + project_splash_path + " (" + itos(err) + ")");
1563+
}
1564+
splash_image.unref();
15541565
}
1555-
splash_image.unref();
15561566
}
1567+
} else {
1568+
splash_image.instantiate();
1569+
splash_image->initialize_data(1, 1, false, Image::FORMAT_RGBA8);
1570+
splash_image->set_pixel(0, 0, bg_color);
15571571
}
15581572

15591573
if (splash_image.is_null()) {
@@ -1577,13 +1591,6 @@ String EditorExportPlatformAndroid::load_splash_refs(Ref<Image> &splash_image, R
15771591
splash_image->resize(width, height);
15781592
}
15791593

1580-
// Setup the splash bg color
1581-
bool bg_color_valid;
1582-
Color bg_color = ProjectSettings::get_singleton()->get("application/boot_splash/bg_color", &bg_color_valid);
1583-
if (!bg_color_valid) {
1584-
bg_color = boot_splash_bg_color;
1585-
}
1586-
15871594
print_verbose("Creating splash background color image.");
15881595
splash_bg_color_image.instantiate();
15891596
splash_bg_color_image->initialize_data(splash_image->get_width(), splash_image->get_height(), false, splash_image->get_format());

0 commit comments

Comments
 (0)