diff options
Diffstat (limited to 'main/main.cpp')
| -rw-r--r-- | main/main.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/main/main.cpp b/main/main.cpp index 7383294167..e0f9cfb9d9 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 */ @@ -205,8 +205,8 @@ 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"); + 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"); @@ -1029,8 +1029,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph message_queue = memnew(MessageQueue); - ProjectSettings::get_singleton()->register_global_defaults(); - if (p_second_phase) return setup2(); @@ -1230,6 +1228,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) { register_driver_types(); + // This loads global classes, so it must happen before custom loaders and savers are registered ScriptServer::init_languages(); MAIN_PRINT("Main: Load Translations"); @@ -1489,6 +1488,9 @@ bool Main::start() { } #endif + ResourceLoader::add_custom_loaders(); + ResourceSaver::add_custom_savers(); + if (!project_manager && !editor) { // game if (game_path != "" || script != "") { //autoload @@ -1930,7 +1932,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(); @@ -1961,11 +1963,13 @@ void Main::force_redraw() { * so that the engine closes cleanly without leaking memory or crashing. * The order matters as some of those steps are linked with each other. */ - void Main::cleanup() { ERR_FAIL_COND(!_start_success); + ResourceLoader::remove_custom_loaders(); + ResourceSaver::remove_custom_savers(); + message_queue->flush(); memdelete(message_queue); |