diff options
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 210 |
1 files changed, 105 insertions, 105 deletions
diff --git a/main/main.cpp b/main/main.cpp index e292a20982..8960d85c45 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -31,10 +31,10 @@ #include "app_icon.gen.h" #include "core/register_core_types.h" #include "drivers/register_driver_types.h" -#include "global_config.h" #include "message_queue.h" #include "modules/register_module_types.h" #include "os/os.h" +#include "project_settings.h" #include "scene/register_scene_types.h" #include "script_debugger_local.h" #include "script_debugger_remote.h" @@ -74,7 +74,7 @@ #include "translation.h" #include "version.h" -static GlobalConfig *globals = NULL; +static ProjectSettings *globals = NULL; static Engine *engine = NULL; static InputMap *input_map = NULL; static bool _start_success = false; @@ -205,14 +205,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph Thread::_main_thread_id = Thread::get_caller_ID(); - globals = memnew(GlobalConfig); + globals = memnew(ProjectSettings); input_map = memnew(InputMap); register_core_settings(); //here globals is present translation_server = memnew(TranslationServer); performance = memnew(Performance); - globals->add_singleton(GlobalConfig::Singleton("Performance", performance)); + globals->add_singleton(ProjectSettings::Singleton("Performance", performance)); MAIN_PRINT("Main: Parse CMDLine"); @@ -529,7 +529,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph if (I->next()) { - GlobalConfig::get_singleton()->set("editor_scene", game_path = I->next()->get()); + ProjectSettings::get_singleton()->set("editor_scene", game_path = I->next()->get()); } else { goto error; } @@ -551,7 +551,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph if (I->next()) { int editor_pid = I->next()->get().to_int(); - GlobalConfig::get_singleton()->set("editor_pid", editor_pid); + ProjectSettings::get_singleton()->set("editor_pid", editor_pid); N = I->next()->next(); } else { goto error; @@ -578,9 +578,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph I = N; } - GLOBAL_DEF("memory/multithread/thread_rid_pool_prealloc", 60); - - GLOBAL_DEF("network/debug/max_remote_stdout_chars_per_second", 2048); + GLOBAL_DEF("memory/limits/multithreaded_server/rid_pool_prealloc", 60); + GLOBAL_DEF("network/limits/debugger_stdout/max_chars_per_second", 2048); if (debug_mode == "remote") { @@ -643,7 +642,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph #ifdef TOOLS_ENABLED if (editor) { packed_data->set_disabled(true); - globals->set_disable_platform_override(true); + globals->set_disable_feature_overrides(true); StreamPeerSSL::initialize_certs = false; //will be initialized by editor } @@ -666,10 +665,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph use_custom_res = false; } - if (bool(GlobalConfig::get_singleton()->get("application/disable_stdout"))) { + if (bool(ProjectSettings::get_singleton()->get("application/run/disable_stdout"))) { quiet_stdout = true; } - if (bool(GlobalConfig::get_singleton()->get("application/disable_stderr"))) { + if (bool(ProjectSettings::get_singleton()->get("application/run/disable_stderr"))) { _print_error_enabled = false; }; @@ -680,7 +679,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph #ifdef TOOLS_ENABLED - if (main_args.size() == 0 && (!GlobalConfig::get_singleton()->has("application/main_loop_type")) && (!GlobalConfig::get_singleton()->has("application/main_scene") || String(GlobalConfig::get_singleton()->get("application/main_scene")) == "")) + if (main_args.size() == 0 && (!ProjectSettings::get_singleton()->has("application/run/main_loop_type")) && (!ProjectSettings::get_singleton()->has("application/run/main_scene") || String(ProjectSettings::get_singleton()->get("application/run/main_scene")) == "")) use_custom_res = false; //project manager (run without arguments) #endif @@ -690,43 +689,46 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph else input_map->load_from_globals(); //keys for game - if (video_driver == "") // specified in project.godot - video_driver = GLOBAL_DEF("display/driver/name", Variant((const char *)OS::get_singleton()->get_video_driver_name(0))); + //if (video_driver == "") // useless for now, so removing + // video_driver = GLOBAL_DEF("display/driver/name", Variant((const char *)OS::get_singleton()->get_video_driver_name(0))); - if (!force_res && use_custom_res && globals->has("display/window/width")) - video_mode.width = globals->get("display/window/width"); - if (!force_res && use_custom_res && globals->has("display/window/height")) - video_mode.height = globals->get("display/window/height"); - if (!editor && ((globals->has("display/window/allow_hidpi") && !globals->get("display/window/allow_hidpi")) || force_lowdpi)) { + if (!force_res && use_custom_res && globals->has("display/window/size/width")) + video_mode.width = globals->get("display/window/size/width"); + if (!force_res && use_custom_res && globals->has("display/window/size/height")) + video_mode.height = globals->get("display/window/size/height"); + if (!editor && ((globals->has("display/window/dpi/allow_hidpi") && !globals->get("display/window/dpi/allow_hidpi")) || force_lowdpi)) { OS::get_singleton()->_allow_hidpi = false; } - if (use_custom_res && globals->has("display/window/fullscreen")) - video_mode.fullscreen = globals->get("display/window/fullscreen"); - if (use_custom_res && globals->has("display/window/resizable")) - video_mode.resizable = globals->get("display/window/resizable"); - if (use_custom_res && globals->has("display/window/borderless")) - video_mode.borderless_window = globals->get("display/window/borderless"); - - if (!force_res && use_custom_res && globals->has("display/window/test_width") && globals->has("display/window/test_height")) { - int tw = globals->get("display/window/test_width"); - int th = globals->get("display/window/test_height"); + if (use_custom_res && globals->has("display/window/size/fullscreen")) + video_mode.fullscreen = globals->get("display/window/size/fullscreen"); + if (use_custom_res && globals->has("display/window/size/resizable")) + video_mode.resizable = globals->get("display/window/size/resizable"); + if (use_custom_res && globals->has("display/window/size/borderless")) + video_mode.borderless_window = globals->get("display/window/size/borderless"); + + if (!force_res && use_custom_res && globals->has("display/window/size/test_width") && globals->has("display/window/size/test_height")) { + int tw = globals->get("display/window/size/test_width"); + int th = globals->get("display/window/size/test_height"); if (tw > 0 && th > 0) { video_mode.width = tw; video_mode.height = th; } } - GLOBAL_DEF("display/window/width", video_mode.width); - GLOBAL_DEF("display/window/height", video_mode.height); - GLOBAL_DEF("display/window/allow_hidpi", false); - GLOBAL_DEF("display/window/fullscreen", video_mode.fullscreen); - GLOBAL_DEF("display/window/resizable", video_mode.resizable); - GLOBAL_DEF("display/window/borderless", video_mode.borderless_window); - use_vsync = GLOBAL_DEF("display/window/use_vsync", use_vsync); - GLOBAL_DEF("display/window/test_width", 0); - GLOBAL_DEF("display/window/test_height", 0); - Engine::get_singleton()->_pixel_snap = GLOBAL_DEF("rendering/2d/use_pixel_snap", false); - OS::get_singleton()->_keep_screen_on = GLOBAL_DEF("display/energy_saving/keep_screen_on", true); + GLOBAL_DEF("display/window/size/width", video_mode.width); + GLOBAL_DEF("display/window/size/height", video_mode.height); + GLOBAL_DEF("display/window/dpi/allow_hidpi", false); + GLOBAL_DEF("display/window/size/fullscreen", video_mode.fullscreen); + GLOBAL_DEF("display/window/size/resizable", video_mode.resizable); + GLOBAL_DEF("display/window/size/borderless", video_mode.borderless_window); + use_vsync = GLOBAL_DEF("display/window/vsync/use_vsync", use_vsync); + GLOBAL_DEF("display/window/size/test_width", 0); + GLOBAL_DEF("display/window/size/test_height", 0); + GLOBAL_DEF("rendering/quality/intended_usage/framebuffer_allocation", 2); + GLOBAL_DEF("rendering/quality/intended_usage/framebuffer_allocation.mobile", 3); + + Engine::get_singleton()->_pixel_snap = GLOBAL_DEF("rendering/quality/2d/use_pixel_snap", false); + OS::get_singleton()->_keep_screen_on = GLOBAL_DEF("display/window/energy_saving/keep_screen_on", true); if (rtm == -1) { rtm = GLOBAL_DEF("rendering/threads/thread_model", OS::RENDER_THREAD_SAFE); if (rtm >= 1) //hack for now @@ -757,7 +759,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph if (video_driver_idx < 0) { - OS::get_singleton()->alert("Invalid Video Driver: " + video_driver); + //OS::get_singleton()->alert("Invalid Video Driver: " + video_driver); video_driver_idx = 0; //goto error; } @@ -779,7 +781,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } { - String orientation = GLOBAL_DEF("display/handheld/orientation", "landscape"); + String orientation = GLOBAL_DEF("display/window/handheld/orientation", "landscape"); if (orientation == "portrait") OS::get_singleton()->set_screen_orientation(OS::SCREEN_PORTRAIT); @@ -798,22 +800,22 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } Engine::get_singleton()->set_iterations_per_second(GLOBAL_DEF("physics/common/fixed_fps", 60)); - Engine::get_singleton()->set_target_fps(GLOBAL_DEF("debug/fps/force_fps", 0)); + Engine::get_singleton()->set_target_fps(GLOBAL_DEF("debug/settings/fps/force_fps", 0)); - GLOBAL_DEF("debug/stdout/print_fps", OS::get_singleton()->is_stdout_verbose()); + GLOBAL_DEF("debug/settings/stdout/print_fps", OS::get_singleton()->is_stdout_verbose()); if (!OS::get_singleton()->_verbose_stdout) //overrided - OS::get_singleton()->_verbose_stdout = GLOBAL_DEF("debug/stdout/verbose_stdout", false); + OS::get_singleton()->_verbose_stdout = GLOBAL_DEF("debug/settings/stdout/verbose_stdout", false); if (frame_delay == 0) { - frame_delay = GLOBAL_DEF("application/frame_delay_msec", 0); + frame_delay = GLOBAL_DEF("application/run/frame_delay_msec", 0); } Engine::get_singleton()->set_frame_delay(frame_delay); message_queue = memnew(MessageQueue); - GlobalConfig::get_singleton()->register_global_defaults(); + ProjectSettings::get_singleton()->register_global_defaults(); if (p_second_phase) return setup2(); @@ -908,13 +910,13 @@ Error Main::setup2() { MAIN_PRINT("Main: Load Remaps"); - Color clear = GLOBAL_DEF("rendering/viewport/default_clear_color", Color(0.3, 0.3, 0.3)); + Color clear = GLOBAL_DEF("rendering/environment/default_clear_color", Color(0.3, 0.3, 0.3)); VisualServer::get_singleton()->set_default_clear_color(clear); if (show_logo) { //boot logo! - String boot_logo_path = GLOBAL_DEF("application/boot_splash", String()); - bool boot_logo_scale = GLOBAL_DEF("application/boot_splash_fullsize", true); - GlobalConfig::get_singleton()->set_custom_property_info("application/boot_splash", PropertyInfo(Variant::STRING, "application/boot_splash", PROPERTY_HINT_FILE, "*.png")); + String boot_logo_path = GLOBAL_DEF("application/boot_splash/image", String()); + bool boot_logo_scale = GLOBAL_DEF("application/boot_splash/fullsize", true); + ProjectSettings::get_singleton()->set_custom_property_info("application/boot_splash/image", PropertyInfo(Variant::STRING, "application/boot_splash/image", PROPERTY_HINT_FILE, "*.png")); Ref<Image> boot_logo; @@ -930,11 +932,11 @@ Error Main::setup2() { if (boot_logo.is_valid()) { OS::get_singleton()->_msec_splash = OS::get_singleton()->get_ticks_msec(); - Color boot_bg = GLOBAL_DEF("application/boot_bg_color", clear); + Color boot_bg = GLOBAL_DEF("application/boot_splash/bg_color", clear); VisualServer::get_singleton()->set_boot_image(boot_logo, boot_bg, boot_logo_scale); #ifndef TOOLS_ENABLED //no tools, so free the boot logo (no longer needed) -//GlobalConfig::get_singleton()->set("application/boot_logo",Image()); +//ProjectSettings::get_singleton()->set("application/boot_logo",Image()); #endif } else { @@ -955,13 +957,13 @@ Error Main::setup2() { } MAIN_PRINT("Main: DCC"); - VisualServer::get_singleton()->set_default_clear_color(GLOBAL_DEF("rendering/viewport/default_clear_color", Color(0.3, 0.3, 0.3))); + VisualServer::get_singleton()->set_default_clear_color(GLOBAL_DEF("rendering/environment/default_clear_color", Color(0.3, 0.3, 0.3))); MAIN_PRINT("Main: END"); - GLOBAL_DEF("application/icon", String()); - GlobalConfig::get_singleton()->set_custom_property_info("application/icon", PropertyInfo(Variant::STRING, "application/icon", PROPERTY_HINT_FILE, "*.png,*.webp")); + 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")); - if (bool(GLOBAL_DEF("display/handheld/emulate_touchscreen", false))) { + if (bool(GLOBAL_DEF("display/window/handheld/emulate_touchscreen", false))) { if (!OS::get_singleton()->has_touchscreen_ui_hint() && Input::get_singleton() && !editor) { //only if no touchscreen ui hint, set emulation InputDefault *id = Input::get_singleton()->cast_to<InputDefault>(); @@ -978,15 +980,15 @@ Error Main::setup2() { GLOBAL_DEF("display/mouse_cursor/custom_image", String()); GLOBAL_DEF("display/mouse_cursor/custom_image_hotspot", Vector2()); - GlobalConfig::get_singleton()->set_custom_property_info("display/mouse_cursor/custom_image", PropertyInfo(Variant::STRING, "display/mouse_cursor/custom_image", PROPERTY_HINT_FILE, "*.png,*.webp")); + 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(GlobalConfig::get_singleton()->get("display/mouse_cursor/custom_image")) != String()) { + if (String(ProjectSettings::get_singleton()->get("display/mouse_cursor/custom_image")) != String()) { //print_line("use custom cursor"); - Ref<Texture> cursor = ResourceLoader::load(GlobalConfig::get_singleton()->get("display/mouse_cursor/custom_image")); + Ref<Texture> cursor = ResourceLoader::load(ProjectSettings::get_singleton()->get("display/mouse_cursor/custom_image")); if (cursor.is_valid()) { //print_line("loaded ok"); - Vector2 hotspot = GlobalConfig::get_singleton()->get("display/mouse_cursor/custom_image_hotspot"); + Vector2 hotspot = ProjectSettings::get_singleton()->get("display/mouse_cursor/custom_image_hotspot"); Input::get_singleton()->set_custom_mouse_cursor(cursor, hotspot); } } @@ -1145,8 +1147,8 @@ bool Main::start() { } } - if (script == "" && game_path == "" && String(GLOBAL_DEF("application/main_scene", "")) != "") { - game_path = GLOBAL_DEF("application/main_scene", ""); + if (script == "" && game_path == "" && String(GLOBAL_DEF("application/run/main_scene", "")) != "") { + game_path = GLOBAL_DEF("application/run/main_scene", ""); } MainLoop *main_loop = NULL; @@ -1189,7 +1191,7 @@ bool Main::start() { } } else { - main_loop_type = GLOBAL_DEF("application/main_loop_type", ""); + main_loop_type = GLOBAL_DEF("application/run/main_loop_type", ""); } if (!main_loop && main_loop_type == "") @@ -1249,12 +1251,16 @@ bool Main::start() { } #endif + { + } + if (!editor) { //standard helpers that can be changed from main config - String stretch_mode = GLOBAL_DEF("display/stretch/mode", "disabled"); - String stretch_aspect = GLOBAL_DEF("display/stretch/aspect", "ignore"); - Size2i stretch_size = Size2(GLOBAL_DEF("display/window/width", 0), GLOBAL_DEF("display/window/height", 0)); + 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)); + int stretch_shrink = GLOBAL_DEF("display/window/stretch/shrink", 1); SceneTree::StretchMode sml_sm = SceneTree::STRETCH_MODE_DISABLED; if (stretch_mode == "2d") @@ -1270,45 +1276,37 @@ bool Main::start() { else if (stretch_aspect == "keep_height") sml_aspect = SceneTree::STRETCH_ASPECT_KEEP_HEIGHT; - sml->set_screen_stretch(sml_sm, sml_aspect, stretch_size); + sml->set_screen_stretch(sml_sm, sml_aspect, stretch_size, stretch_shrink); - sml->set_auto_accept_quit(GLOBAL_DEF("application/auto_accept_quit", true)); - sml->set_quit_on_go_back(GLOBAL_DEF("application/quit_on_go_back", true)); - String appname = GlobalConfig::get_singleton()->get("application/name"); + 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)); + String appname = ProjectSettings::get_singleton()->get("application/config/name"); appname = TranslationServer::get_singleton()->translate(appname); OS::get_singleton()->set_window_title(appname); - int shadow_atlas_size = GLOBAL_DEF("rendering/shadow_atlas/size", 2048); - int shadow_atlas_q0_subdiv = GLOBAL_DEF("rendering/shadow_atlas/quadrant_0_subdiv", 2); - int shadow_atlas_q1_subdiv = GLOBAL_DEF("rendering/shadow_atlas/quadrant_1_subdiv", 2); - int shadow_atlas_q2_subdiv = GLOBAL_DEF("rendering/shadow_atlas/quadrant_2_subdiv", 3); - int shadow_atlas_q3_subdiv = GLOBAL_DEF("rendering/shadow_atlas/quadrant_3_subdiv", 4); + int shadow_atlas_size = GLOBAL_GET("rendering/quality/shadow_atlas/size"); + int shadow_atlas_q0_subdiv = GLOBAL_GET("rendering/quality/shadow_atlas/quadrant_0_subdiv"); + int shadow_atlas_q1_subdiv = GLOBAL_GET("rendering/quality/shadow_atlas/quadrant_1_subdiv"); + int shadow_atlas_q2_subdiv = GLOBAL_GET("rendering/quality/shadow_atlas/quadrant_2_subdiv"); + int shadow_atlas_q3_subdiv = GLOBAL_GET("rendering/quality/shadow_atlas/quadrant_3_subdiv"); sml->get_root()->set_shadow_atlas_size(shadow_atlas_size); sml->get_root()->set_shadow_atlas_quadrant_subdiv(0, Viewport::ShadowAtlasQuadrantSubdiv(shadow_atlas_q0_subdiv)); sml->get_root()->set_shadow_atlas_quadrant_subdiv(1, Viewport::ShadowAtlasQuadrantSubdiv(shadow_atlas_q1_subdiv)); sml->get_root()->set_shadow_atlas_quadrant_subdiv(2, Viewport::ShadowAtlasQuadrantSubdiv(shadow_atlas_q2_subdiv)); sml->get_root()->set_shadow_atlas_quadrant_subdiv(3, Viewport::ShadowAtlasQuadrantSubdiv(shadow_atlas_q3_subdiv)); + Viewport::Usage usage = Viewport::Usage(int(GLOBAL_GET("rendering/quality/intended_usage/framebuffer_allocation"))); + sml->get_root()->set_usage(usage); } else { - GLOBAL_DEF("display/stretch/mode", "disabled"); - GlobalConfig::get_singleton()->set_custom_property_info("display/stretch/mode", PropertyInfo(Variant::STRING, "display/stretch/mode", PROPERTY_HINT_ENUM, "disabled,2d,viewport")); - GLOBAL_DEF("display/stretch/aspect", "ignore"); - GlobalConfig::get_singleton()->set_custom_property_info("display/stretch/aspect", PropertyInfo(Variant::STRING, "display/stretch/aspect", PROPERTY_HINT_ENUM, "ignore,keep,keep_width,keep_height")); - sml->set_auto_accept_quit(GLOBAL_DEF("application/auto_accept_quit", true)); - sml->set_quit_on_go_back(GLOBAL_DEF("application/quit_on_go_back", true)); - - GLOBAL_DEF("rendering/shadow_atlas/size", 2048); - GlobalConfig::get_singleton()->set_custom_property_info("rendering/shadow_atlas/size", PropertyInfo(Variant::INT, "rendering/shadow_atlas/size", PROPERTY_HINT_RANGE, "256,16384")); - - GLOBAL_DEF("rendering/shadow_atlas/quadrant_0_subdiv", 2); - GLOBAL_DEF("rendering/shadow_atlas/quadrant_1_subdiv", 2); - GLOBAL_DEF("rendering/shadow_atlas/quadrant_2_subdiv", 3); - GLOBAL_DEF("rendering/shadow_atlas/quadrant_3_subdiv", 4); - GlobalConfig::get_singleton()->set_custom_property_info("rendering/shadow_atlas/quadrant_0_subdiv", PropertyInfo(Variant::INT, "rendering/shadow_atlas/quadrant_0_subdiv", PROPERTY_HINT_ENUM, "Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows")); - GlobalConfig::get_singleton()->set_custom_property_info("rendering/shadow_atlas/quadrant_1_subdiv", PropertyInfo(Variant::INT, "rendering/shadow_atlas/quadrant_1_subdiv", PROPERTY_HINT_ENUM, "Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows")); - GlobalConfig::get_singleton()->set_custom_property_info("rendering/shadow_atlas/quadrant_2_subdiv", PropertyInfo(Variant::INT, "rendering/shadow_atlas/quadrant_2_subdiv", PROPERTY_HINT_ENUM, "Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows")); - GlobalConfig::get_singleton()->set_custom_property_info("rendering/shadow_atlas/quadrant_3_subdiv", PropertyInfo(Variant::INT, "rendering/shadow_atlas/quadrant_3_subdiv", PROPERTY_HINT_ENUM, "Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows")); + GLOBAL_DEF("display/window/stretch/mode", "disabled"); + 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")); + GLOBAL_DEF("display/window/stretch/shrink", 1); + ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/shrink", PropertyInfo(Variant::STRING, "display/window/stretch/shrink", PROPERTY_HINT_RANGE, "1,8,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)); } String local_game_path; @@ -1321,7 +1319,7 @@ bool Main::start() { if (!absolute) { - if (GlobalConfig::get_singleton()->is_using_datapack()) { + if (ProjectSettings::get_singleton()->is_using_datapack()) { local_game_path = "res://" + local_game_path; @@ -1344,7 +1342,7 @@ bool Main::start() { } } - local_game_path = GlobalConfig::get_singleton()->localize_path(local_game_path); + local_game_path = ProjectSettings::get_singleton()->localize_path(local_game_path); #ifdef TOOLS_ENABLED if (editor) { @@ -1370,7 +1368,7 @@ bool Main::start() { if (game_path != "" || script != "") { //autoload List<PropertyInfo> props; - GlobalConfig::get_singleton()->get_property_list(&props); + ProjectSettings::get_singleton()->get_property_list(&props); //first pass, add the constants so they exist before any script is loaded for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) { @@ -1379,7 +1377,7 @@ bool Main::start() { if (!s.begins_with("autoload/")) continue; String name = s.get_slicec('/', 1); - String path = GlobalConfig::get_singleton()->get(s); + String path = ProjectSettings::get_singleton()->get(s); bool global_var = false; if (path.begins_with("*")) { global_var = true; @@ -1400,7 +1398,7 @@ bool Main::start() { if (!s.begins_with("autoload/")) continue; String name = s.get_slicec('/', 1); - String path = GlobalConfig::get_singleton()->get(s); + String path = ProjectSettings::get_singleton()->get(s); bool global_var = false; if (path.begins_with("*")) { global_var = true; @@ -1463,7 +1461,7 @@ bool Main::start() { //sml->get_root()->add_child(scene); sml->add_current_scene(scene); - String iconpath = GLOBAL_DEF("application/icon", "Variant()"); + String iconpath = GLOBAL_DEF("application/config/icon", "Variant()"); if (iconpath != "") { Ref<Image> icon; if (icon->load(iconpath) == OK) @@ -1641,7 +1639,7 @@ bool Main::iteration() { if (frame > 1000000) { - if (GLOBAL_DEF("debug/stdout/print_fps", OS::get_singleton()->is_stdout_verbose())) { + if (GLOBAL_DEF("debug/settings/stdout/print_fps", OS::get_singleton()->is_stdout_verbose())) { print_line("FPS: " + itos(frames)); }; @@ -1699,14 +1697,16 @@ void Main::cleanup() { OS::get_singleton()->_execpath = ""; OS::get_singleton()->_local_clipboard = ""; - if (audio_server) { - memdelete(audio_server); - } + ScriptServer::finish_languages(); #ifdef TOOLS_ENABLED EditorNode::unregister_editor_types(); #endif + if (audio_server) { + memdelete(audio_server); + } + unregister_driver_types(); unregister_module_types(); unregister_scene_types(); |