Removed splash image.

This commit is contained in:
Relintai 2023-12-15 00:00:23 +01:00
parent 26462a0392
commit bad8c72013
6 changed files with 36 additions and 59 deletions

View File

@ -9,20 +9,5 @@ env.main_sources = []
env.add_source_files(env.main_sources, "*.cpp")
env.Depends("#main/splash.gen.h", "#main/splash.png")
env.CommandNoCache("#main/splash.gen.h", "#main/splash.png", run_in_subprocess(main_builders.make_splash))
if not env["no_editor_splash"]:
env.Depends("#main/splash_editor.gen.h", "#main/splash_editor.png")
env.CommandNoCache(
"#main/splash_editor.gen.h", "#main/splash_editor.png", run_in_subprocess(main_builders.make_splash_editor)
)
env.Depends("#main/app_icon.gen.h", "#main/app_icon.png")
env.CommandNoCache("#main/app_icon.gen.h", "#main/app_icon.png", run_in_subprocess(main_builders.make_app_icon))
if env["tools"]:
SConscript("tests/SCsub")
lib = env.add_library("main", env.main_sources)
env.Prepend(LIBS=[lib])

View File

@ -53,7 +53,6 @@
#include "main/input_default.h"
#include "main/main_timer_sync.h"
#include "main/performance.h"
#include "main/splash.gen.h"
#include "modules/register_module_types.h"
#include "platform/register_platform_apis.h"
#include "scene/debugger/script_debugger_remote.h"
@ -1509,7 +1508,9 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
if (load_err)
ERR_PRINT("Non-existing or invalid boot splash at '" + boot_logo_path + "'. Loading default splash.");
}
} else {
}
if (!boot_logo.is_valid()) {
// Create a 1×1 transparent image. This will effectively hide the splash image.
boot_logo.instance();
boot_logo->create(1, 1, false, Image::FORMAT_RGBA8);
@ -1518,39 +1519,10 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
boot_logo->unlock();
}
#if defined(TOOLS_ENABLED) && !defined(NO_EDITOR_SPLASH)
const Color boot_bg_color =
GLOBAL_DEF("application/boot_splash/bg_color",
(editor || project_manager) ? boot_splash_editor_bg_color : boot_splash_bg_color);
#else
const Color boot_bg_color = GLOBAL_DEF("application/boot_splash/bg_color", boot_splash_bg_color);
#endif
if (boot_logo.is_valid()) {
OS::get_singleton()->_msec_splash = OS::get_singleton()->get_ticks_msec();
RenderingServer::get_singleton()->set_boot_image(boot_logo, boot_bg_color, boot_logo_scale, boot_logo_filter);
} else {
#ifndef NO_DEFAULT_BOOT_LOGO
MAIN_PRINT("Main: Create bootsplash");
#if defined(TOOLS_ENABLED) && !defined(NO_EDITOR_SPLASH)
Ref<Image> splash = (editor || project_manager) ? memnew(Image(boot_splash_editor_png)) : memnew(Image(boot_splash_png));
#else
Ref<Image> splash = memnew(Image(boot_splash_png));
#endif
MAIN_PRINT("Main: ClearColor");
RenderingServer::get_singleton()->set_default_clear_color(boot_bg_color);
MAIN_PRINT("Main: Image");
RenderingServer::get_singleton()->set_boot_image(splash, boot_bg_color, false);
#endif
}
#ifdef TOOLS_ENABLED
if (OS::get_singleton()->get_bundle_icon_path().empty()) {
Ref<Image> icon = memnew(Image(app_icon_png));
OS::get_singleton()->set_icon(icon);
}
#endif
const Color boot_bg_color = GLOBAL_DEF("application/boot_splash/bg_color", Color(0.14, 0.14, 0.14));
RenderingServer::get_singleton()->set_default_clear_color(boot_bg_color);
OS::get_singleton()->_msec_splash = OS::get_singleton()->get_ticks_msec();
RenderingServer::get_singleton()->set_boot_image(boot_logo, boot_bg_color, boot_logo_scale, boot_logo_filter);
}
MAIN_PRINT("Main: DCC");

View File

@ -1467,7 +1467,13 @@ String EditorExportPlatformAndroid::load_splash_refs(Ref<Image> &splash_image, R
if (splash_image.is_null()) {
// Use the default
print_verbose("Using default splash image.");
splash_image = Ref<Image>(memnew(Image(boot_splash_png)));
// Create a 1×1 transparent image. This will effectively hide the splash image.
splash_image.instance();
splash_image->create(1, 1, false, Image::FORMAT_RGBA8);
splash_image->lock();
splash_image->set_pixel(0, 0, Color(0, 0, 0, 0));
splash_image->unlock();
}
if (scale_splash) {
@ -1489,7 +1495,7 @@ String EditorExportPlatformAndroid::load_splash_refs(Ref<Image> &splash_image, R
bool bg_color_valid;
Color bg_color = ProjectSettings::get_singleton()->get("application/boot_splash/bg_color", &bg_color_valid);
if (!bg_color_valid) {
bg_color = boot_splash_bg_color;
bg_color = Color(0.14, 0.14, 0.14);
}
print_verbose("Creating splash background color image.");

View File

@ -43,7 +43,6 @@
#include "editor/editor_log.h"
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "main/splash.gen.h"
#include "platform/android/logo.gen.h"
#include "platform/android/run_icon.gen.h"

View File

@ -41,7 +41,6 @@
#include "editor/editor_export.h"
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "main/splash.gen.h"
#include "platform/iphone/logo.gen.h"
#include "platform/iphone/plugin/pandemonium_plugin_config.h"
#include "string.h"
@ -960,8 +959,13 @@ Error EditorExportPlatformIOS::_export_loading_screen_file(const Ref<EditorExpor
}
}
if (splash.is_null()) {
splash = Ref<Image>(memnew(Image(boot_splash_png)));
if (splash.is_valid()) {
// Create a 1×1 transparent image. This will effectively hide the splash image.
splash.instance();
splash->create(1, 1, false, Image::FORMAT_RGBA8);
splash->lock();
splash->set_pixel(0, 0, Color(0, 0, 0, 0));
splash->unlock();
}
// Using same image for both @2x and @3x
@ -1040,7 +1044,12 @@ Error EditorExportPlatformIOS::_export_loading_screen_images(const Ref<EditorExp
ImageLoader::load_image(boot_logo_path, img_bs);
}
if (!img_bs.is_valid()) {
img_bs = Ref<Image>(memnew(Image(boot_splash_png)));
// Create a 1×1 transparent image. This will effectively hide the splash image.
img_bs.instance();
img_bs->create(1, 1, false, Image::FORMAT_RGBA8);
img_bs->lock();
img_bs->set_pixel(0, 0, Color(0, 0, 0, 0));
img_bs->unlock();
}
if (img_bs.is_valid()) {
float aspect_ratio = (float)img_bs->get_width() / (float)img_bs->get_height();

View File

@ -37,7 +37,6 @@
#include "core/io/zip_io.h"
#include "editor/editor_export.h"
#include "editor/editor_node.h"
#include "main/splash.gen.h"
#include "platform/javascript/logo.gen.h"
#include "platform/javascript/run_icon.gen.h"
@ -311,7 +310,14 @@ class EditorExportPlatformJavaScript : public EditorExportPlatform {
splash.instance();
const String splash_path = String(GLOBAL_GET("application/boot_splash/image")).strip_edges();
if (splash_path.empty() || ImageLoader::load_image(splash_path, splash) != OK) {
return Ref<Image>(memnew(Image(boot_splash_png)));
// Create a 1×1 transparent image. This will effectively hide the splash image.
splash.instance();
splash->create(1, 1, false, Image::FORMAT_RGBA8);
splash->lock();
splash->set_pixel(0, 0, Color(0, 0, 0, 0));
splash->unlock();
return splash;
}
return splash;
}