From 092509cbaddb069998ff2dd266bb7933e9009d99 Mon Sep 17 00:00:00 2001 From: Marcelo Fernandez Date: Fri, 15 Sep 2017 13:41:11 -0300 Subject: [PATCH] Fix setting the default icon briefly with tools=no --- main/main.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/main/main.cpp b/main/main.cpp index bb601198db5..a5b962a47cd 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -990,8 +990,10 @@ Error Main::setup2(Thread::ID p_main_tid_override) { #endif } +#ifdef TOOLS_ENABLED Ref icon = memnew(Image(app_icon_png)); OS::get_singleton()->set_icon(icon); +#endif } MAIN_PRINT("Main: DCC"); @@ -1082,6 +1084,7 @@ bool Main::start() { ERR_FAIL_COND_V(!_start_success, false); + bool hasicon = false; bool editor = false; String doc_tool; List removal_docs; @@ -1519,8 +1522,10 @@ bool Main::start() { if (iconpath != "") { Ref icon; icon.instance(); - if (icon->load(iconpath) == OK) + if (icon->load(iconpath) == OK) { OS::get_singleton()->set_icon(icon); + hasicon = true; + } } } } @@ -1537,6 +1542,11 @@ bool Main::start() { #endif } + if (!hasicon) { + Ref icon = memnew(Image(app_icon_png)); + OS::get_singleton()->set_icon(icon); + } + OS::get_singleton()->set_main_loop(main_loop); return true;