You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
Add boot splash display time setting
Implements #8867.
(cherry picked from commit dad9683d11)
This commit is contained in:
committed by
Rémi Verschelde
parent
7dd322f83e
commit
bf33de769a
@@ -1700,6 +1700,13 @@ bool Main::start() {
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t minimum_time_msec = GLOBAL_DEF("application/boot_splash/minimum_display_time", 0);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("application/boot_splash/minimum_display_time",
|
||||
PropertyInfo(Variant::INT,
|
||||
"application/boot_splash/minimum_display_time",
|
||||
PROPERTY_HINT_RANGE,
|
||||
"0,100,1,or_greater")); // No negative numbers.
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
if (doc_tool_path != "") {
|
||||
Engine::get_singleton()->set_editor_hint(true); // Needed to instance editor-only classes for their default values
|
||||
@@ -2182,6 +2189,14 @@ bool Main::start() {
|
||||
|
||||
OS::get_singleton()->set_main_loop(main_loop);
|
||||
|
||||
if (minimum_time_msec) {
|
||||
uint64_t minimum_time = 1000 * minimum_time_msec;
|
||||
uint64_t elapsed_time = OS::get_singleton()->get_ticks_usec();
|
||||
if (elapsed_time < minimum_time) {
|
||||
OS::get_singleton()->delay_usec(minimum_time - elapsed_time);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user