summaryrefslogtreecommitdiff
path: root/main/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main/main.cpp')
-rw-r--r--main/main.cpp215
1 files changed, 137 insertions, 78 deletions
diff --git a/main/main.cpp b/main/main.cpp
index da9c2c3198..8c742c0f93 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -53,11 +53,11 @@
#include "drivers/register_driver_types.h"
#include "main/app_icon.gen.h"
#include "main/input_default.h"
+#include "main/main_timer_sync.h"
#include "main/performance.h"
#include "main/splash.gen.h"
#include "main/splash_editor.gen.h"
#include "main/tests/test_main.h"
-#include "main/timer_sync.h"
#include "modules/register_module_types.h"
#include "platform/register_platform_apis.h"
#include "scene/main/scene_tree.h"
@@ -204,9 +204,10 @@ void finalize_physics() {
void Main::print_help(const char *p_binary) {
- print_line(String(VERSION_NAME) + " v" + get_full_version_string() + " - https://godotengine.org");
- OS::get_singleton()->print("(c) 2007-2018 Juan Linietsky, Ariel Manzur.\n");
- OS::get_singleton()->print("(c) 2014-2018 Godot Engine contributors.\n");
+ print_line(String(VERSION_NAME) + " v" + get_full_version_string() + " - " + String(VERSION_WEBSITE));
+ OS::get_singleton()->print("Free and open source software under the terms of the MIT license.\n");
+ OS::get_singleton()->print("(c) 2007-2019 Juan Linietsky, Ariel Manzur.\n");
+ OS::get_singleton()->print("(c) 2014-2019 Godot Engine contributors.\n");
OS::get_singleton()->print("\n");
OS::get_singleton()->print("Usage: %s [options] [path to scene or 'project.godot' file]\n", p_binary);
OS::get_singleton()->print("\n");
@@ -247,6 +248,7 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print(").\n");
OS::get_singleton()->print("\n");
+#ifndef SERVER_ENABLED
OS::get_singleton()->print("Display options:\n");
OS::get_singleton()->print(" -f, --fullscreen Request fullscreen mode.\n");
OS::get_singleton()->print(" -m, --maximized Request a maximized window.\n");
@@ -257,14 +259,15 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print(" --low-dpi Force low-DPI mode (macOS and Windows only).\n");
OS::get_singleton()->print(" --no-window Disable window creation (Windows only). Useful together with --script.\n");
OS::get_singleton()->print("\n");
+#endif
OS::get_singleton()->print("Debug options:\n");
OS::get_singleton()->print(" -d, --debug Debug (local stdout debugger).\n");
OS::get_singleton()->print(" -b, --breakpoints Breakpoint list as source::line comma-separated pairs, no spaces (use %%20 instead).\n");
OS::get_singleton()->print(" --profiling Enable profiling in the script debugger.\n");
OS::get_singleton()->print(" --remote-debug <address> Remote debug (<host/IP>:<port> address).\n");
-#ifdef DEBUG_ENABLED
- OS::get_singleton()->print(" --debug-collisions Show collisions shapes when running the scene.\n");
+#if defined(DEBUG_ENABLED) && !defined(SERVER_ENABLED)
+ OS::get_singleton()->print(" --debug-collisions Show collision shapes when running the scene.\n");
OS::get_singleton()->print(" --debug-navigation Show navigation polygons when running the scene.\n");
#endif
OS::get_singleton()->print(" --frame-delay <ms> Simulate high CPU load (delay each frame by <ms> milliseconds).\n");
@@ -372,7 +375,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
while (I) {
- I->get() = unescape_cmdline(I->get().strip_escapes());
+ I->get() = unescape_cmdline(I->get().strip_edges());
I = I->next();
}
@@ -394,7 +397,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
Vector<String> breakpoints;
bool use_custom_res = true;
bool force_res = false;
+#ifdef TOOLS_ENABLED
bool found_project = false;
+#endif
packed_data = PackedData::get_singleton();
if (!packed_data)
@@ -427,6 +432,49 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
print_line(get_full_version_string());
goto error;
+ } else if (I->get() == "-v" || I->get() == "--verbose") { // verbose output
+
+ OS::get_singleton()->_verbose_stdout = true;
+ } else if (I->get() == "--quiet") { // quieter output
+
+ quiet_stdout = true;
+
+ } else if (I->get() == "--audio-driver") { // audio driver
+
+ if (I->next()) {
+
+ audio_driver = I->next()->get();
+ N = I->next()->next();
+ } else {
+ OS::get_singleton()->print("Missing audio driver argument, aborting.\n");
+ goto error;
+ }
+
+ } else if (I->get() == "--video-driver") { // force video driver
+
+ if (I->next()) {
+
+ video_driver = I->next()->get();
+ N = I->next()->next();
+ } else {
+ OS::get_singleton()->print("Missing video driver argument, aborting.\n");
+ goto error;
+ }
+#ifndef SERVER_ENABLED
+ } else if (I->get() == "-f" || I->get() == "--fullscreen") { // force fullscreen
+
+ init_fullscreen = true;
+ } else if (I->get() == "-m" || I->get() == "--maximized") { // force maximized window
+
+ init_maximized = true;
+ video_mode.maximized = true;
+
+ } else if (I->get() == "-w" || I->get() == "--windowed") { // force windowed window
+
+ init_windowed = true;
+ } else if (I->get() == "-t" || I->get() == "--always-on-top") { // force always-on-top window
+
+ init_always_on_top = true;
} else if (I->get() == "--resolution") { // force resolution
if (I->next()) {
@@ -457,6 +505,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
OS::get_singleton()->print("Missing resolution argument, aborting.\n");
goto error;
}
+
} else if (I->get() == "--position") { // set window position
if (I->next()) {
@@ -481,29 +530,17 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
goto error;
}
- } else if (I->get() == "-m" || I->get() == "--maximized") { // force maximized window
-
- init_maximized = true;
- video_mode.maximized = true;
- } else if (I->get() == "-w" || I->get() == "--windowed") { // force windowed window
+ } else if (I->get() == "--low-dpi") { // force low DPI (macOS only)
- init_windowed = true;
- } else if (I->get() == "-t" || I->get() == "--always-on-top") { // force always-on-top window
+ force_lowdpi = true;
+ } else if (I->get() == "--no-window") { // disable window creation (Windows only)
- init_always_on_top = true;
+ OS::get_singleton()->set_no_window_mode(true);
+#endif
} else if (I->get() == "--profiling") { // enable profiling
use_debug_profiler = true;
- } else if (I->get() == "--video-driver") { // force video driver
- if (I->next()) {
-
- video_driver = I->next()->get();
- N = I->next()->next();
- } else {
- OS::get_singleton()->print("Missing video driver argument, aborting.\n");
- goto error;
- }
} else if (I->get() == "-l" || I->get() == "--language") { // language
if (I->next()) {
@@ -514,9 +551,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
OS::get_singleton()->print("Missing language argument, aborting.\n");
goto error;
}
- } else if (I->get() == "--low-dpi") { // force low DPI (macOS only)
- force_lowdpi = true;
} else if (I->get() == "--remote-fs") { // remote filesystem
if (I->next()) {
@@ -553,22 +588,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
OS::get_singleton()->print("Missing render thread mode argument, aborting.\n");
goto error;
}
-
- } else if (I->get() == "--audio-driver") { // audio driver
-
- if (I->next()) {
-
- audio_driver = I->next()->get();
- N = I->next()->next();
- } else {
- OS::get_singleton()->print("Missing audio driver argument, aborting.\n");
- goto error;
- }
-
- } else if (I->get() == "-f" || I->get() == "--fullscreen") { // force fullscreen
-
- //video_mode.fullscreen=false;
- init_fullscreen = true;
#ifdef TOOLS_ENABLED
} else if (I->get() == "-e" || I->get() == "--editor") { // starts editor
@@ -581,14 +600,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
auto_build_solutions = true;
editor = true;
#endif
- } else if (I->get() == "--no-window") { // disable window creation, Windows only
-
- OS::get_singleton()->set_no_window_mode(true);
- } else if (I->get() == "--quiet") { // quieter output
-
- quiet_stdout = true;
- } else if (I->get() == "-v" || I->get() == "--verbose") { // verbose output
- OS::get_singleton()->_verbose_stdout = true;
} else if (I->get() == "--path") { // set path of project to start or edit
if (I->next()) {
@@ -672,7 +683,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
} else if (I->get() == "-d" || I->get() == "--debug") {
debug_mode = "local";
-#ifdef DEBUG_ENABLED
+#if defined(DEBUG_ENABLED) && !defined(SERVER_ENABLED)
} else if (I->get() == "--debug-collisions") {
debug_collisions = true;
} else if (I->get() == "--debug-navigation") {
@@ -746,14 +757,16 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
}
if (globals->setup(project_path, main_pack, upwards) == OK) {
+#ifdef TOOLS_ENABLED
found_project = true;
+#endif
} else {
#ifdef TOOLS_ENABLED
editor = false;
#else
String error_msg = "Error: Could not load game data at path '" + project_path + "'. Is the .pck file missing?\n";
- OS::get_singleton()->print(error_msg.ascii().get_data());
+ OS::get_singleton()->print("%s", error_msg.ascii().get_data());
OS::get_singleton()->alert(error_msg);
goto error;
@@ -784,7 +797,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
memdelete(sdr);
} else {
script_debugger = sdr;
- sdr->set_allow_focus_steal_pid(allow_focus_steal_pid);
}
} else if (debug_mode == "local") {
@@ -853,6 +865,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
}
if (editor || project_manager) {
+ Engine::get_singleton()->set_editor_hint(true);
use_custom_res = false;
input_map->load_default(); //keys for editor
} else {
@@ -877,8 +890,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
video_driver = GLOBAL_GET("rendering/quality/driver/driver_name");
}
- GLOBAL_DEF("rendering/quality/driver/driver_fallback", "Best");
- ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/driver/driver_fallback", PropertyInfo(Variant::STRING, "rendering/quality/driver/driver_fallback", PROPERTY_HINT_ENUM, "Best,Never"));
+ GLOBAL_DEF("rendering/quality/driver/fallback_to_gles2", false);
+
+ // Assigning here even though it's GLES2-specific, to be sure that it appears in docs
+ GLOBAL_DEF("rendering/quality/2d/gles2_use_nvidia_rect_flicker_workaround", false);
GLOBAL_DEF("display/window/size/width", 1024);
ProjectSettings::get_singleton()->set_custom_property_info("display/window/size/width", PropertyInfo(Variant::INT, "display/window/size/width", PROPERTY_HINT_RANGE, "0,7680,or_greater")); // 8K resolution
@@ -919,13 +934,12 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
OS::get_singleton()->_allow_hidpi = GLOBAL_DEF("display/window/dpi/allow_hidpi", false);
}
- OS::get_singleton()->_allow_layered = GLOBAL_DEF("display/window/allow_per_pixel_transparency", false);
-
video_mode.use_vsync = GLOBAL_DEF("display/window/vsync/use_vsync", true);
OS::get_singleton()->_use_vsync = video_mode.use_vsync;
- video_mode.layered = GLOBAL_DEF("display/window/per_pixel_transparency", false);
- video_mode.layered_splash = GLOBAL_DEF("display/window/per_pixel_transparency_splash", false);
+ OS::get_singleton()->_allow_layered = GLOBAL_DEF("display/window/per_pixel_transparency/allowed", false);
+ video_mode.layered = GLOBAL_DEF("display/window/per_pixel_transparency/enabled", false);
+ video_mode.layered_splash = GLOBAL_DEF("display/window/per_pixel_transparency/splash", false);
GLOBAL_DEF("rendering/quality/intended_usage/framebuffer_allocation", 2);
GLOBAL_DEF("rendering/quality/intended_usage/framebuffer_allocation.mobile", 3);
@@ -1022,7 +1036,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
}
OS::get_singleton()->set_low_processor_usage_mode(GLOBAL_DEF("application/run/low_processor_mode", false));
- OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(GLOBAL_DEF("application/run/low_processor_mode_sleep_usec", 8000));
+ OS::get_singleton()->set_low_processor_usage_mode_sleep_usec(GLOBAL_DEF("application/run/low_processor_mode_sleep_usec", 6900)); // Roughly 144 FPS
ProjectSettings::get_singleton()->set_custom_property_info("application/run/low_processor_mode_sleep_usec", PropertyInfo(Variant::INT, "application/run/low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "0,33200,1,or_greater")); // No negative numbers
Engine::get_singleton()->set_frame_delay(frame_delay);
@@ -1078,6 +1092,9 @@ error:
Error Main::setup2(Thread::ID p_main_tid_override) {
+ // Print engine name and version
+ print_line(String(VERSION_NAME) + " v" + get_full_version_string() + " - " + String(VERSION_WEBSITE));
+
if (p_main_tid_override) {
Thread::_main_thread_id = p_main_tid_override;
}
@@ -1123,6 +1140,10 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
OS::get_singleton()->set_window_always_on_top(true);
}
+ if (allow_focus_steal_pid) {
+ OS::get_singleton()->enable_for_stealing_focus(allow_focus_steal_pid);
+ }
+
register_server_types();
MAIN_PRINT("Main: Load Remaps");
@@ -1141,8 +1162,8 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
if (boot_logo_path != String()) {
boot_logo.instance();
- Error err = ImageLoader::load_image(boot_logo_path, boot_logo);
- if (err)
+ Error load_err = ImageLoader::load_image(boot_logo_path, boot_logo);
+ if (load_err)
ERR_PRINTS("Non-existing or invalid boot splash at: " + boot_logo_path + ". Loading default splash.");
}
@@ -1180,6 +1201,12 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
GLOBAL_DEF("application/config/icon", String());
ProjectSettings::get_singleton()->set_custom_property_info("application/config/icon", PropertyInfo(Variant::STRING, "application/config/icon", PROPERTY_HINT_FILE, "*.png,*.webp"));
+ GLOBAL_DEF("application/config/macos_native_icon", String());
+ ProjectSettings::get_singleton()->set_custom_property_info("application/config/macos_native_icon", PropertyInfo(Variant::STRING, "application/config/macos_native_icon", PROPERTY_HINT_FILE, "*.icns"));
+
+ GLOBAL_DEF("application/config/windows_native_icon", String());
+ ProjectSettings::get_singleton()->set_custom_property_info("application/config/windows_native_icon", PropertyInfo(Variant::STRING, "application/config/windows_native_icon", PROPERTY_HINT_FILE, "*.ico"));
+
InputDefault *id = Object::cast_to<InputDefault>(Input::get_singleton());
if (id) {
if (bool(GLOBAL_DEF("input_devices/pointing/emulate_touch_from_mouse", false)) && !(editor || project_manager)) {
@@ -1200,6 +1227,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
GLOBAL_DEF("display/mouse_cursor/custom_image", String());
GLOBAL_DEF("display/mouse_cursor/custom_image_hotspot", Vector2());
+ GLOBAL_DEF("display/mouse_cursor/tooltip_position_offset", Point2(10, 10));
ProjectSettings::get_singleton()->set_custom_property_info("display/mouse_cursor/custom_image", PropertyInfo(Variant::STRING, "display/mouse_cursor/custom_image", PROPERTY_HINT_FILE, "*.png,*.webp"));
if (String(ProjectSettings::get_singleton()->get("display/mouse_cursor/custom_image")) != String()) {
@@ -1270,7 +1298,9 @@ bool Main::start() {
bool hasicon = false;
String doc_tool;
List<String> removal_docs;
+#ifdef TOOLS_ENABLED
bool doc_base = true;
+#endif
String game_path;
String script;
String test;
@@ -1283,9 +1313,11 @@ bool Main::start() {
List<String> args = OS::get_singleton()->get_cmdline_args();
for (int i = 0; i < args.size(); i++) {
//parameters that do not have an argument to the right
- if (args[i] == "--no-docbase") {
- doc_base = false;
+ if (args[i] == "--check-only") {
+ check_only = true;
#ifdef TOOLS_ENABLED
+ } else if (args[i] == "--no-docbase") {
+ doc_base = false;
} else if (args[i] == "-e" || args[i] == "--editor") {
editor = true;
} else if (args[i] == "-p" || args[i] == "--project-manager") {
@@ -1293,8 +1325,6 @@ bool Main::start() {
#endif
} else if (args[i].length() && args[i][0] != '-' && game_path == "") {
game_path = args[i];
- } else if (args[i] == "--check-only") {
- check_only = true;
}
//parameters that have an argument to the right
else if (i < (args.size() - 1)) {
@@ -1540,8 +1570,8 @@ bool Main::start() {
Ref<PackedScene> ps = res;
n = ps->instance();
} else if (res->is_class("Script")) {
- Ref<Script> s = res;
- StringName ibt = s->get_instance_base_type();
+ Ref<Script> script_res = res;
+ StringName ibt = script_res->get_instance_base_type();
bool valid_type = ClassDB::is_parent_class(ibt, "Node");
ERR_EXPLAIN("Script does not inherit a Node: " + path);
ERR_CONTINUE(!valid_type);
@@ -1552,7 +1582,7 @@ bool Main::start() {
ERR_CONTINUE(obj == NULL);
n = Object::cast_to<Node>(obj);
- n->set_script(s.get_ref_ptr());
+ n->set_script(script_res.get_ref_ptr());
}
ERR_EXPLAIN("Path in autoload not a node or script: " + path);
@@ -1601,7 +1631,7 @@ bool Main::start() {
String stretch_mode = GLOBAL_DEF("display/window/stretch/mode", "disabled");
String stretch_aspect = GLOBAL_DEF("display/window/stretch/aspect", "ignore");
Size2i stretch_size = Size2(GLOBAL_DEF("display/window/size/width", 0), GLOBAL_DEF("display/window/size/height", 0));
- real_t stretch_shrink = GLOBAL_DEF("display/window/stretch/shrink", 1.0f);
+ real_t stretch_shrink = GLOBAL_DEF("display/window/stretch/shrink", 1.0);
SceneTree::StretchMode sml_sm = SceneTree::STRETCH_MODE_DISABLED;
if (stretch_mode == "2d")
@@ -1653,8 +1683,8 @@ bool Main::start() {
ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/mode", PropertyInfo(Variant::STRING, "display/window/stretch/mode", PROPERTY_HINT_ENUM, "disabled,2d,viewport"));
GLOBAL_DEF("display/window/stretch/aspect", "ignore");
ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/aspect", PropertyInfo(Variant::STRING, "display/window/stretch/aspect", PROPERTY_HINT_ENUM, "ignore,keep,keep_width,keep_height,expand"));
- GLOBAL_DEF("display/window/stretch/shrink", 1);
- ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/shrink", PropertyInfo(Variant::REAL, "display/window/stretch/shrink", PROPERTY_HINT_RANGE, "1,8,1"));
+ GLOBAL_DEF("display/window/stretch/shrink", 1.0);
+ ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/shrink", PropertyInfo(Variant::REAL, "display/window/stretch/shrink", PROPERTY_HINT_RANGE, "1.0,8.0,0.1"));
sml->set_auto_accept_quit(GLOBAL_DEF("application/config/auto_accept_quit", true));
sml->set_quit_on_go_back(GLOBAL_DEF("application/config/quit_on_go_back", true));
GLOBAL_DEF("gui/common/snap_controls_to_pixels", true);
@@ -1727,8 +1757,24 @@ bool Main::start() {
ERR_FAIL_COND_V(!scene, false)
sml->add_current_scene(scene);
+#ifdef OSX_ENABLED
+ String mac_iconpath = GLOBAL_DEF("application/config/macos_native_icon", "Variant()");
+ if (mac_iconpath != "") {
+ OS::get_singleton()->set_native_icon(mac_iconpath);
+ hasicon = true;
+ }
+#endif
+
+#ifdef WINDOWS_ENABLED
+ String win_iconpath = GLOBAL_DEF("application/config/windows_native_icon", "Variant()");
+ if (win_iconpath != "") {
+ OS::get_singleton()->set_native_icon(win_iconpath);
+ hasicon = true;
+ }
+#endif
+
String iconpath = GLOBAL_DEF("application/config/icon", "Variant()");
- if (iconpath != "") {
+ if ((iconpath != "") && (!hasicon)) {
Ref<Image> icon;
icon.instance();
if (ImageLoader::load_image(iconpath, icon) == OK) {
@@ -1786,6 +1832,10 @@ uint64_t Main::target_ticks = 0;
uint32_t Main::frames = 0;
uint32_t Main::frame = 0;
bool Main::force_redraw_requested = false;
+int Main::iterating = 0;
+bool Main::is_iterating() {
+ return iterating > 0;
+}
// For performance metrics
static uint64_t physics_process_max = 0;
@@ -1793,6 +1843,11 @@ static uint64_t idle_process_max = 0;
bool Main::iteration() {
+ //for now do not error on this
+ //ERR_FAIL_COND_V(iterating, false);
+
+ iterating++;
+
uint64_t ticks = OS::get_singleton()->get_ticks_usec();
Engine::get_singleton()->_frame_ticks = ticks;
main_timer_sync.set_cpu_ticks_usec(ticks);
@@ -1861,7 +1916,9 @@ bool Main::iteration() {
uint64_t idle_begin = OS::get_singleton()->get_ticks_usec();
- OS::get_singleton()->get_main_loop()->idle(step * time_scale);
+ if (OS::get_singleton()->get_main_loop()->idle(step * time_scale)) {
+ exit = true;
+ }
message_queue->flush();
VisualServer::get_singleton()->sync(); //sync if still drawing from previous frames.
@@ -1920,11 +1977,13 @@ bool Main::iteration() {
frames = 0;
}
+ iterating--;
+
if (fixed_fps != -1)
return exit;
if (OS::get_singleton()->is_in_low_processor_usage_mode() || !OS::get_singleton()->can_draw())
- OS::get_singleton()->delay_usec(OS::get_singleton()->get_low_processor_usage_mode_sleep_usec()); //apply some delay to force idle time (results in about 60 FPS max)
+ OS::get_singleton()->delay_usec(OS::get_singleton()->get_low_processor_usage_mode_sleep_usec()); //apply some delay to force idle time
else {
uint32_t frame_delay = Engine::get_singleton()->get_frame_delay();
if (frame_delay)
@@ -1932,7 +1991,7 @@ bool Main::iteration() {
}
int target_fps = Engine::get_singleton()->get_target_fps();
- if (target_fps > 0) {
+ if (target_fps > 0 && !Engine::get_singleton()->is_editor_hint()) {
uint64_t time_step = 1000000L / target_fps;
target_ticks += time_step;
uint64_t current_ticks = OS::get_singleton()->get_ticks_usec();