Remove duplicate project settings definitions

This commit is contained in:
kobewi 2022-10-20 15:43:17 +02:00
parent b61fda9d2a
commit d9f066d5fa
14 changed files with 89 additions and 99 deletions

View file

@ -619,7 +619,7 @@ Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, b
Error ProjectSettings::setup(const String &p_path, const String &p_main_pack, bool p_upwards, bool p_ignore_override) { Error ProjectSettings::setup(const String &p_path, const String &p_main_pack, bool p_upwards, bool p_ignore_override) {
Error err = _setup(p_path, p_main_pack, p_upwards, p_ignore_override); Error err = _setup(p_path, p_main_pack, p_upwards, p_ignore_override);
if (err == OK) { if (err == OK) {
String custom_settings = GLOBAL_DEF("application/config/project_settings_override", ""); String custom_settings = GLOBAL_GET("application/config/project_settings_override");
if (!custom_settings.is_empty()) { if (!custom_settings.is_empty()) {
_load_settings_text(custom_settings); _load_settings_text(custom_settings);
} }
@ -1276,6 +1276,7 @@ ProjectSettings::ProjectSettings() {
GLOBAL_DEF("physics/2d/run_on_separate_thread", false); GLOBAL_DEF("physics/2d/run_on_separate_thread", false);
GLOBAL_DEF("physics/3d/run_on_separate_thread", false); GLOBAL_DEF("physics/3d/run_on_separate_thread", false);
GLOBAL_DEF("debug/disable_touch", false);
GLOBAL_DEF("debug/settings/profiler/max_functions", 16384); GLOBAL_DEF("debug/settings/profiler/max_functions", 16384);
custom_prop_info["debug/settings/profiler/max_functions"] = PropertyInfo(Variant::INT, "debug/settings/profiler/max_functions", PROPERTY_HINT_RANGE, "128,65535,1"); custom_prop_info["debug/settings/profiler/max_functions"] = PropertyInfo(Variant::INT, "debug/settings/profiler/max_functions", PROPERTY_HINT_RANGE, "128,65535,1");
@ -1292,6 +1293,22 @@ ProjectSettings::ProjectSettings() {
GLOBAL_DEF("compression/formats/gzip/compression_level", Compression::gzip_level); GLOBAL_DEF("compression/formats/gzip/compression_level", Compression::gzip_level);
custom_prop_info["compression/formats/gzip/compression_level"] = PropertyInfo(Variant::INT, "compression/formats/gzip/compression_level", PROPERTY_HINT_RANGE, "-1,9,1"); custom_prop_info["compression/formats/gzip/compression_level"] = PropertyInfo(Variant::INT, "compression/formats/gzip/compression_level", PROPERTY_HINT_RANGE, "-1,9,1");
GLOBAL_DEF("debug/settings/crash_handler/message",
String("Please include this when reporting the bug to the project developer."));
GLOBAL_DEF("debug/settings/crash_handler/message.editor",
String("Please include this when reporting the bug on: https://github.com/godotengine/godot/issues"));
GLOBAL_DEF_RST("rendering/occlusion_culling/bvh_build_quality", 2);
GLOBAL_DEF("memory/limits/multithreaded_server/rid_pool_prealloc", 60);
GLOBAL_DEF_RST("internationalization/rendering/force_right_to_left_layout_direction", false);
GLOBAL_DEF("gui/timers/incremental_search_max_interval_msec", 2000);
ProjectSettings::get_singleton()->set_custom_property_info("gui/timers/incremental_search_max_interval_msec", PropertyInfo(Variant::INT, "gui/timers/incremental_search_max_interval_msec", PROPERTY_HINT_RANGE, "0,10000,1,or_greater")); // No negative numbers.
GLOBAL_DEF("rendering/rendering_device/staging_buffer/block_size_kb", 256);
GLOBAL_DEF("rendering/rendering_device/staging_buffer/max_size_mb", 128);
GLOBAL_DEF("rendering/rendering_device/staging_buffer/texture_upload_region_size_px", 64);
GLOBAL_DEF("rendering/rendering_device/vulkan/max_descriptors_per_pool", 64);
// These properties will not show up in the dialog nor in the documentation. If you want to exclude whole groups, see _get_property_list() method. // These properties will not show up in the dialog nor in the documentation. If you want to exclude whole groups, see _get_property_list() method.
GLOBAL_DEF_INTERNAL("application/config/features", PackedStringArray()); GLOBAL_DEF_INTERNAL("application/config/features", PackedStringArray());
GLOBAL_DEF_INTERNAL("internationalization/locale/translation_remaps", PackedStringArray()); GLOBAL_DEF_INTERNAL("internationalization/locale/translation_remaps", PackedStringArray());

View file

@ -341,6 +341,9 @@
<member name="compression/formats/zstd/window_log_size" type="int" setter="" getter="" default="27"> <member name="compression/formats/zstd/window_log_size" type="int" setter="" getter="" default="27">
Largest size limit (in power of 2) allowed when compressing using long-distance matching with Zstandard. Higher values can result in better compression, but will require more memory when compressing and decompressing. Largest size limit (in power of 2) allowed when compressing using long-distance matching with Zstandard. Higher values can result in better compression, but will require more memory when compressing and decompressing.
</member> </member>
<member name="debug/disable_touch" type="bool" setter="" getter="" default="false">
Disable touch input. Only has effect on iOS.
</member>
<member name="debug/file_logging/enable_file_logging" type="bool" setter="" getter="" default="false"> <member name="debug/file_logging/enable_file_logging" type="bool" setter="" getter="" default="false">
If [code]true[/code], logs all output to files. If [code]true[/code], logs all output to files.
</member> </member>

View file

@ -9387,12 +9387,10 @@ void RenderingDeviceVulkan::initialize(VulkanContext *p_context, bool p_local_de
} }
} }
// NOTE: If adding new project settings here, also duplicate their definition in staging_buffer_block_size = GLOBAL_GET("rendering/rendering_device/staging_buffer/block_size_kb");
// rendering_server.cpp for headless doctool.
staging_buffer_block_size = GLOBAL_DEF("rendering/rendering_device/staging_buffer/block_size_kb", 256);
staging_buffer_block_size = MAX(4u, staging_buffer_block_size); staging_buffer_block_size = MAX(4u, staging_buffer_block_size);
staging_buffer_block_size *= 1024; // Kb -> bytes. staging_buffer_block_size *= 1024; // Kb -> bytes.
staging_buffer_max_size = GLOBAL_DEF("rendering/rendering_device/staging_buffer/max_size_mb", 128); staging_buffer_max_size = GLOBAL_GET("rendering/rendering_device/staging_buffer/max_size_mb");
staging_buffer_max_size = MAX(1u, staging_buffer_max_size); staging_buffer_max_size = MAX(1u, staging_buffer_max_size);
staging_buffer_max_size *= 1024 * 1024; staging_buffer_max_size *= 1024 * 1024;
@ -9400,7 +9398,7 @@ void RenderingDeviceVulkan::initialize(VulkanContext *p_context, bool p_local_de
// Validate enough blocks. // Validate enough blocks.
staging_buffer_max_size = staging_buffer_block_size * 4; staging_buffer_max_size = staging_buffer_block_size * 4;
} }
texture_upload_region_size_px = GLOBAL_DEF("rendering/rendering_device/staging_buffer/texture_upload_region_size_px", 64); texture_upload_region_size_px = GLOBAL_GET("rendering/rendering_device/staging_buffer/texture_upload_region_size_px");
texture_upload_region_size_px = nearest_power_of_2_templated(texture_upload_region_size_px); texture_upload_region_size_px = nearest_power_of_2_templated(texture_upload_region_size_px);
frames_drawn = frame_count; // Start from frame count, so everything else is immediately old. frames_drawn = frame_count; // Start from frame count, so everything else is immediately old.
@ -9415,7 +9413,7 @@ void RenderingDeviceVulkan::initialize(VulkanContext *p_context, bool p_local_de
ERR_CONTINUE(err != OK); ERR_CONTINUE(err != OK);
} }
max_descriptors_per_pool = GLOBAL_DEF("rendering/rendering_device/vulkan/max_descriptors_per_pool", 64); max_descriptors_per_pool = GLOBAL_GET("rendering/rendering_device/vulkan/max_descriptors_per_pool");
// Check to make sure DescriptorPoolKey is good. // Check to make sure DescriptorPoolKey is good.
static_assert(sizeof(uint64_t) * 3 >= UNIFORM_TYPE_MAX * sizeof(uint16_t)); static_assert(sizeof(uint64_t) * 3 >= UNIFORM_TYPE_MAX * sizeof(uint16_t));

View file

@ -536,7 +536,7 @@ void EditorNode::_update_from_settings() {
RS::get_singleton()->environment_set_volumetric_fog_filter_active(bool(GLOBAL_GET("rendering/environment/volumetric_fog/use_filter"))); RS::get_singleton()->environment_set_volumetric_fog_filter_active(bool(GLOBAL_GET("rendering/environment/volumetric_fog/use_filter")));
RS::get_singleton()->canvas_set_shadow_texture_size(GLOBAL_GET("rendering/2d/shadow_atlas/size")); RS::get_singleton()->canvas_set_shadow_texture_size(GLOBAL_GET("rendering/2d/shadow_atlas/size"));
bool use_half_res_gi = GLOBAL_DEF("rendering/global_illumination/gi/use_half_resolution", false); bool use_half_res_gi = GLOBAL_GET("rendering/global_illumination/gi/use_half_resolution");
RS::get_singleton()->gi_set_use_half_resolution(use_half_res_gi); RS::get_singleton()->gi_set_use_half_resolution(use_half_res_gi);
bool snap_2d_transforms = GLOBAL_GET("rendering/2d/snap/snap_2d_transforms_to_pixel"); bool snap_2d_transforms = GLOBAL_GET("rendering/2d/snap/snap_2d_transforms_to_pixel");
@ -5134,7 +5134,7 @@ bool EditorNode::has_scenes_in_session() {
bool EditorNode::ensure_main_scene(bool p_from_native) { bool EditorNode::ensure_main_scene(bool p_from_native) {
pick_main_scene->set_meta("from_native", p_from_native); // Whether from play button or native run. pick_main_scene->set_meta("from_native", p_from_native); // Whether from play button or native run.
String main_scene = GLOBAL_DEF_BASIC("application/run/main_scene", ""); String main_scene = GLOBAL_GET("application/run/main_scene");
if (main_scene.is_empty()) { if (main_scene.is_empty()) {
current_menu_option = -1; current_menu_option = -1;
@ -5201,7 +5201,7 @@ bool EditorNode::is_run_playing() const {
String EditorNode::get_run_playing_scene() const { String EditorNode::get_run_playing_scene() const {
String run_filename = editor_run.get_running_scene(); String run_filename = editor_run.get_running_scene();
if (run_filename.is_empty() && is_run_playing()) { if (run_filename.is_empty() && is_run_playing()) {
run_filename = GLOBAL_DEF_BASIC("application/run/main_scene", ""); // Must be the main scene then. run_filename = GLOBAL_GET("application/run/main_scene"); // Must be the main scene then.
} }
return run_filename; return run_filename;

View file

@ -443,11 +443,7 @@ Error Main::test_setup() {
globals = memnew(ProjectSettings); globals = memnew(ProjectSettings);
GLOBAL_DEF("debug/settings/crash_handler/message", register_core_settings(); // Here globals are present.
String("Please include this when reporting the bug on https://github.com/godotengine/godot/issues"));
GLOBAL_DEF_RST("rendering/occlusion_culling/bvh_build_quality", 2);
register_core_settings(); //here globals are present
translation_server = memnew(TranslationServer); translation_server = memnew(TranslationServer);
tsman = memnew(TextServerManager); tsman = memnew(TextServerManager);
@ -665,11 +661,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
GLOBAL_DEF_RST("application/run/flush_stdout_on_print", false); GLOBAL_DEF_RST("application/run/flush_stdout_on_print", false);
GLOBAL_DEF_RST("application/run/flush_stdout_on_print.debug", true); GLOBAL_DEF_RST("application/run/flush_stdout_on_print.debug", true);
GLOBAL_DEF("debug/settings/crash_handler/message",
String("Please include this when reporting the bug to the project developer."));
GLOBAL_DEF("debug/settings/crash_handler/message.editor",
String("Please include this when reporting the bug on: https://github.com/godotengine/godot/issues"));
MAIN_PRINT("Main: Parse CMDLine"); MAIN_PRINT("Main: Parse CMDLine");
/* argument parsing and main creation */ /* argument parsing and main creation */
@ -1358,7 +1349,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
ResourceUID::get_singleton()->load_from_cache(); // load UUIDs from cache. ResourceUID::get_singleton()->load_from_cache(); // load UUIDs from cache.
GLOBAL_DEF("memory/limits/multithreaded_server/rid_pool_prealloc", 60);
ProjectSettings::get_singleton()->set_custom_property_info("memory/limits/multithreaded_server/rid_pool_prealloc", ProjectSettings::get_singleton()->set_custom_property_info("memory/limits/multithreaded_server/rid_pool_prealloc",
PropertyInfo(Variant::INT, PropertyInfo(Variant::INT,
"memory/limits/multithreaded_server/rid_pool_prealloc", "memory/limits/multithreaded_server/rid_pool_prealloc",
@ -1715,7 +1705,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
window_mode = (DisplayServer::WindowMode)(GLOBAL_GET("display/window/size/mode").operator int()); window_mode = (DisplayServer::WindowMode)(GLOBAL_GET("display/window/size/mode").operator int());
} }
GLOBAL_DEF_RST("internationalization/rendering/force_right_to_left_layout_direction", false);
GLOBAL_DEF("internationalization/locale/include_text_server_data", false); GLOBAL_DEF("internationalization/locale/include_text_server_data", false);
OS::get_singleton()->_allow_hidpi = GLOBAL_DEF("display/window/dpi/allow_hidpi", true); OS::get_singleton()->_allow_hidpi = GLOBAL_DEF("display/window/dpi/allow_hidpi", true);
@ -2165,12 +2154,12 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
boot_logo->set_pixel(0, 0, Color(0, 0, 0, 0)); boot_logo->set_pixel(0, 0, Color(0, 0, 0, 0));
} }
Color boot_bg_color = GLOBAL_DEF_BASIC("application/boot_splash/bg_color", boot_splash_bg_color);
#if defined(TOOLS_ENABLED) && !defined(NO_EDITOR_SPLASH) #if defined(TOOLS_ENABLED) && !defined(NO_EDITOR_SPLASH)
const Color boot_bg_color = boot_bg_color =
GLOBAL_DEF_BASIC("application/boot_splash/bg_color", GLOBAL_DEF_BASIC("application/boot_splash/bg_color",
(editor || project_manager) ? boot_splash_editor_bg_color : boot_splash_bg_color); (editor || project_manager) ? boot_splash_editor_bg_color : boot_splash_bg_color);
#else
const Color boot_bg_color = GLOBAL_DEF_BASIC("application/boot_splash/bg_color", boot_splash_bg_color);
#endif #endif
if (boot_logo.is_valid()) { if (boot_logo.is_valid()) {
RenderingServer::get_singleton()->set_boot_image(boot_logo, boot_bg_color, boot_logo_scale, RenderingServer::get_singleton()->set_boot_image(boot_logo, boot_bg_color, boot_logo_scale,
@ -2202,7 +2191,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
MAIN_PRINT("Main: DCC"); MAIN_PRINT("Main: DCC");
RenderingServer::get_singleton()->set_default_clear_color( RenderingServer::get_singleton()->set_default_clear_color(
GLOBAL_DEF_BASIC("rendering/environment/defaults/default_clear_color", Color(0.3, 0.3, 0.3))); GLOBAL_GET("rendering/environment/defaults/default_clear_color"));
GLOBAL_DEF("application/config/icon", String()); GLOBAL_DEF("application/config/icon", String());
ProjectSettings::get_singleton()->set_custom_property_info("application/config/icon", ProjectSettings::get_singleton()->set_custom_property_info("application/config/icon",
@ -2805,15 +2794,48 @@ bool Main::start() {
startup_benchmark_file = String(); startup_benchmark_file = String();
} }
#endif #endif
GLOBAL_DEF_BASIC("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,canvas_items,viewport"));
GLOBAL_DEF_BASIC("display/window/stretch/aspect", "keep");
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_BASIC("display/window/stretch/scale", 1.0);
ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/scale",
PropertyInfo(Variant::FLOAT,
"display/window/stretch/scale",
PROPERTY_HINT_RANGE,
"0.5,8.0,0.01"));
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_BASIC("gui/common/snap_controls_to_pixels", true);
GLOBAL_DEF_BASIC("gui/fonts/dynamic_fonts/use_oversampling", true);
GLOBAL_DEF_BASIC("rendering/textures/canvas_textures/default_texture_filter", 1);
ProjectSettings::get_singleton()->set_custom_property_info(
"rendering/textures/canvas_textures/default_texture_filter",
PropertyInfo(Variant::INT, "rendering/textures/canvas_textures/default_texture_filter", PROPERTY_HINT_ENUM,
"Nearest,Linear,Linear Mipmap,Nearest Mipmap"));
GLOBAL_DEF_BASIC("rendering/textures/canvas_textures/default_texture_repeat", 0);
ProjectSettings::get_singleton()->set_custom_property_info(
"rendering/textures/canvas_textures/default_texture_repeat",
PropertyInfo(Variant::INT, "rendering/textures/canvas_textures/default_texture_repeat", PROPERTY_HINT_ENUM,
"Disable,Enable,Mirror"));
if (!editor && !project_manager) { if (!editor && !project_manager) {
//standard helpers that can be changed from main config //standard helpers that can be changed from main config
String stretch_mode = GLOBAL_DEF_BASIC("display/window/stretch/mode", "disabled"); String stretch_mode = GLOBAL_GET("display/window/stretch/mode");
String stretch_aspect = GLOBAL_DEF_BASIC("display/window/stretch/aspect", "keep"); String stretch_aspect = GLOBAL_GET("display/window/stretch/aspect");
Size2i stretch_size = Size2i(GLOBAL_DEF_BASIC("display/window/size/viewport_width", 0), Size2i stretch_size = Size2i(GLOBAL_GET("display/window/size/viewport_width"),
GLOBAL_DEF_BASIC("display/window/size/viewport_height", 0)); GLOBAL_GET("display/window/size/viewport_height"));
real_t stretch_scale = GLOBAL_DEF_BASIC("display/window/stretch/scale", 1.0); real_t stretch_scale = GLOBAL_GET("display/window/stretch/scale");
Window::ContentScaleMode cs_sm = Window::CONTENT_SCALE_MODE_DISABLED; Window::ContentScaleMode cs_sm = Window::CONTENT_SCALE_MODE_DISABLED;
if (stretch_mode == "canvas_items") { if (stretch_mode == "canvas_items") {
@ -2838,8 +2860,8 @@ bool Main::start() {
sml->get_root()->set_content_scale_size(stretch_size); sml->get_root()->set_content_scale_size(stretch_size);
sml->get_root()->set_content_scale_factor(stretch_scale); sml->get_root()->set_content_scale_factor(stretch_scale);
sml->set_auto_accept_quit(GLOBAL_DEF("application/config/auto_accept_quit", true)); sml->set_auto_accept_quit(GLOBAL_GET("application/config/auto_accept_quit"));
sml->set_quit_on_go_back(GLOBAL_DEF("application/config/quit_on_go_back", true)); sml->set_quit_on_go_back(GLOBAL_GET("application/config/quit_on_go_back"));
String appname = GLOBAL_GET("application/config/name"); String appname = GLOBAL_GET("application/config/name");
appname = TranslationServer::get_singleton()->translate(appname); appname = TranslationServer::get_singleton()->translate(appname);
#ifdef DEBUG_ENABLED #ifdef DEBUG_ENABLED
@ -2855,53 +2877,18 @@ bool Main::start() {
// It can still be overridden by the user in a script. // It can still be overridden by the user in a script.
DisplayServer::get_singleton()->window_set_min_size(Size2i(64, 64)); DisplayServer::get_singleton()->window_set_min_size(Size2i(64, 64));
bool snap_controls = GLOBAL_DEF("gui/common/snap_controls_to_pixels", true); bool snap_controls = GLOBAL_GET("gui/common/snap_controls_to_pixels");
sml->get_root()->set_snap_controls_to_pixels(snap_controls); sml->get_root()->set_snap_controls_to_pixels(snap_controls);
bool font_oversampling = GLOBAL_DEF("gui/fonts/dynamic_fonts/use_oversampling", true); bool font_oversampling = GLOBAL_GET("gui/fonts/dynamic_fonts/use_oversampling");
sml->get_root()->set_use_font_oversampling(font_oversampling); sml->get_root()->set_use_font_oversampling(font_oversampling);
int texture_filter = GLOBAL_DEF("rendering/textures/canvas_textures/default_texture_filter", 1); int texture_filter = GLOBAL_GET("rendering/textures/canvas_textures/default_texture_filter");
int texture_repeat = GLOBAL_DEF("rendering/textures/canvas_textures/default_texture_repeat", 0); int texture_repeat = GLOBAL_GET("rendering/textures/canvas_textures/default_texture_repeat");
sml->get_root()->set_default_canvas_item_texture_filter( sml->get_root()->set_default_canvas_item_texture_filter(
Viewport::DefaultCanvasItemTextureFilter(texture_filter)); Viewport::DefaultCanvasItemTextureFilter(texture_filter));
sml->get_root()->set_default_canvas_item_texture_repeat( sml->get_root()->set_default_canvas_item_texture_repeat(
Viewport::DefaultCanvasItemTextureRepeat(texture_repeat)); Viewport::DefaultCanvasItemTextureRepeat(texture_repeat));
} else {
GLOBAL_DEF_BASIC("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,canvas_items,viewport"));
GLOBAL_DEF_BASIC("display/window/stretch/aspect", "keep");
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_BASIC("display/window/stretch/scale", 1.0);
ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/scale",
PropertyInfo(Variant::FLOAT,
"display/window/stretch/scale",
PROPERTY_HINT_RANGE,
"0.5,8.0,0.01"));
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_BASIC("gui/common/snap_controls_to_pixels", true);
GLOBAL_DEF_BASIC("gui/fonts/dynamic_fonts/use_oversampling", true);
GLOBAL_DEF_BASIC("rendering/textures/canvas_textures/default_texture_filter", 1);
ProjectSettings::get_singleton()->set_custom_property_info(
"rendering/textures/canvas_textures/default_texture_filter",
PropertyInfo(Variant::INT, "rendering/textures/canvas_textures/default_texture_filter", PROPERTY_HINT_ENUM,
"Nearest,Linear,Linear Mipmap,Nearest Mipmap"));
GLOBAL_DEF_BASIC("rendering/textures/canvas_textures/default_texture_repeat", 0);
ProjectSettings::get_singleton()->set_custom_property_info(
"rendering/textures/canvas_textures/default_texture_repeat",
PropertyInfo(Variant::INT, "rendering/textures/canvas_textures/default_texture_repeat", PROPERTY_HINT_ENUM,
"Disable,Enable,Mirror"));
} }
#ifdef TOOLS_ENABLED #ifdef TOOLS_ENABLED
@ -2970,7 +2957,7 @@ bool Main::start() {
Engine::get_singleton()->startup_benchmark_begin_measure("game_load"); Engine::get_singleton()->startup_benchmark_begin_measure("game_load");
// Load SSL Certificates from Project Settings (or builtin). // Load SSL Certificates from Project Settings (or builtin).
Crypto::load_default_certificates(GLOBAL_DEF("network/tls/certificate_bundle_override", "")); Crypto::load_default_certificates(GLOBAL_GET("network/tls/certificate_bundle_override"));
if (!game_path.is_empty()) { if (!game_path.is_empty()) {
Node *scene = nullptr; Node *scene = nullptr;
@ -2983,7 +2970,7 @@ bool Main::start() {
sml->add_current_scene(scene); sml->add_current_scene(scene);
#ifdef MACOS_ENABLED #ifdef MACOS_ENABLED
String mac_iconpath = GLOBAL_DEF("application/config/macos_native_icon", "Variant()"); String mac_iconpath = GLOBAL_GET("application/config/macos_native_icon");
if (!mac_iconpath.is_empty()) { if (!mac_iconpath.is_empty()) {
DisplayServer::get_singleton()->set_native_icon(mac_iconpath); DisplayServer::get_singleton()->set_native_icon(mac_iconpath);
hasicon = true; hasicon = true;
@ -2991,14 +2978,14 @@ bool Main::start() {
#endif #endif
#ifdef WINDOWS_ENABLED #ifdef WINDOWS_ENABLED
String win_iconpath = GLOBAL_DEF("application/config/windows_native_icon", "Variant()"); String win_iconpath = GLOBAL_GET("application/config/windows_native_icon");
if (!win_iconpath.is_empty()) { if (!win_iconpath.is_empty()) {
DisplayServer::get_singleton()->set_native_icon(win_iconpath); DisplayServer::get_singleton()->set_native_icon(win_iconpath);
hasicon = true; hasicon = true;
} }
#endif #endif
String iconpath = GLOBAL_DEF("application/config/icon", "Variant()"); String iconpath = GLOBAL_GET("application/config/icon");
if ((!iconpath.is_empty()) && (!hasicon)) { if ((!iconpath.is_empty()) && (!hasicon)) {
Ref<Image> icon; Ref<Image> icon;
icon.instantiate(); icon.instantiate();

View file

@ -227,7 +227,7 @@ void DisplayServerIOS::_window_callback(const Callable &p_callable, const Varian
// MARK: Touches // MARK: Touches
void DisplayServerIOS::touch_press(int p_idx, int p_x, int p_y, bool p_pressed, bool p_double_click) { void DisplayServerIOS::touch_press(int p_idx, int p_x, int p_y, bool p_pressed, bool p_double_click) {
if (!GLOBAL_DEF("debug/disable_touch", false)) { if (!GLOBAL_GET("debug/disable_touch")) {
Ref<InputEventScreenTouch> ev; Ref<InputEventScreenTouch> ev;
ev.instantiate(); ev.instantiate();
@ -240,7 +240,7 @@ void DisplayServerIOS::touch_press(int p_idx, int p_x, int p_y, bool p_pressed,
} }
void DisplayServerIOS::touch_drag(int p_idx, int p_prev_x, int p_prev_y, int p_x, int p_y) { void DisplayServerIOS::touch_drag(int p_idx, int p_prev_x, int p_prev_y, int p_x, int p_y) {
if (!GLOBAL_DEF("debug/disable_touch", false)) { if (!GLOBAL_GET("debug/disable_touch")) {
Ref<InputEventScreenDrag> ev; Ref<InputEventScreenDrag> ev;
ev.instantiate(); ev.instantiate();
ev->set_index(p_idx); ev->set_index(p_idx);

View file

@ -896,7 +896,7 @@ void ItemList::gui_input(const Ref<InputEvent> &p_event) {
if (k.is_valid() && k->get_unicode()) { if (k.is_valid() && k->get_unicode()) {
uint64_t now = OS::get_singleton()->get_ticks_msec(); uint64_t now = OS::get_singleton()->get_ticks_msec();
uint64_t diff = now - search_time_msec; uint64_t diff = now - search_time_msec;
uint64_t max_interval = uint64_t(GLOBAL_DEF("gui/timers/incremental_search_max_interval_msec", 2000)); uint64_t max_interval = uint64_t(GLOBAL_GET("gui/timers/incremental_search_max_interval_msec"));
search_time_msec = now; search_time_msec = now;
if (diff > max_interval) { if (diff > max_interval) {
@ -1831,9 +1831,6 @@ void ItemList::_bind_methods() {
ADD_SIGNAL(MethodInfo("item_clicked", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::VECTOR2, "at_position"), PropertyInfo(Variant::INT, "mouse_button_index"))); ADD_SIGNAL(MethodInfo("item_clicked", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::VECTOR2, "at_position"), PropertyInfo(Variant::INT, "mouse_button_index")));
ADD_SIGNAL(MethodInfo("multi_selected", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::BOOL, "selected"))); ADD_SIGNAL(MethodInfo("multi_selected", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::BOOL, "selected")));
ADD_SIGNAL(MethodInfo("item_activated", PropertyInfo(Variant::INT, "index"))); ADD_SIGNAL(MethodInfo("item_activated", PropertyInfo(Variant::INT, "index")));
GLOBAL_DEF("gui/timers/incremental_search_max_interval_msec", 2000);
ProjectSettings::get_singleton()->set_custom_property_info("gui/timers/incremental_search_max_interval_msec", PropertyInfo(Variant::INT, "gui/timers/incremental_search_max_interval_msec", PROPERTY_HINT_RANGE, "0,10000,1,or_greater")); // No negative numbers
} }
ItemList::ItemList() { ItemList::ItemList() {

View file

@ -472,7 +472,7 @@ void PopupMenu::gui_input(const Ref<InputEvent> &p_event) {
if (allow_search && k.is_valid() && k->get_unicode() && k->is_pressed()) { if (allow_search && k.is_valid() && k->get_unicode() && k->is_pressed()) {
uint64_t now = OS::get_singleton()->get_ticks_msec(); uint64_t now = OS::get_singleton()->get_ticks_msec();
uint64_t diff = now - search_time_msec; uint64_t diff = now - search_time_msec;
uint64_t max_interval = uint64_t(GLOBAL_DEF("gui/timers/incremental_search_max_interval_msec", 2000)); uint64_t max_interval = uint64_t(GLOBAL_GET("gui/timers/incremental_search_max_interval_msec"));
search_time_msec = now; search_time_msec = now;
if (diff > max_interval) { if (diff > max_interval) {

View file

@ -4818,7 +4818,7 @@ TreeItem *Tree::get_item_with_text(const String &p_find) const {
void Tree::_do_incr_search(const String &p_add) { void Tree::_do_incr_search(const String &p_add) {
uint64_t time = OS::get_singleton()->get_ticks_usec() / 1000; // convert to msec uint64_t time = OS::get_singleton()->get_ticks_usec() / 1000; // convert to msec
uint64_t diff = time - last_keypress; uint64_t diff = time - last_keypress;
if (diff > uint64_t(GLOBAL_DEF("gui/timers/incremental_search_max_interval_msec", 2000))) { if (diff > uint64_t(GLOBAL_GET("gui/timers/incremental_search_max_interval_msec"))) {
incr_search = p_add; incr_search = p_add;
} else if (incr_search != p_add) { } else if (incr_search != p_add) {
incr_search += p_add; incr_search += p_add;

View file

@ -116,7 +116,7 @@ bool Shape2D::is_collision_outline_enabled() {
return true; return true;
} }
#endif #endif
return GLOBAL_DEF("debug/shapes/collision/draw_2d_outlines", true); return GLOBAL_GET("debug/shapes/collision/draw_2d_outlines");
} }
Shape2D::Shape2D(const RID &p_rid) { Shape2D::Shape2D(const RID &p_rid) {

View file

@ -1225,7 +1225,7 @@ GodotSpace2D::GodotSpace2D() {
ProjectSettings::get_singleton()->set_custom_property_info("physics/2d/solver/solver_iterations", PropertyInfo(Variant::INT, "physics/2d/solver/solver_iterations", PROPERTY_HINT_RANGE, "1,32,1,or_greater")); ProjectSettings::get_singleton()->set_custom_property_info("physics/2d/solver/solver_iterations", PropertyInfo(Variant::INT, "physics/2d/solver/solver_iterations", PROPERTY_HINT_RANGE, "1,32,1,or_greater"));
contact_recycle_radius = GLOBAL_DEF("physics/2d/solver/contact_recycle_radius", 1.0); contact_recycle_radius = GLOBAL_DEF("physics/2d/solver/contact_recycle_radius", 1.0);
ProjectSettings::get_singleton()->set_custom_property_info("physics/2d/solver/contact_recycle_radius", PropertyInfo(Variant::FLOAT, "physics/2d/solver/contact_max_separation", PROPERTY_HINT_RANGE, "0,10,0.01,or_greater")); ProjectSettings::get_singleton()->set_custom_property_info("physics/2d/solver/contact_recycle_radius", PropertyInfo(Variant::FLOAT, "physics/2d/solver/contact_recycle_radius", PROPERTY_HINT_RANGE, "0,10,0.01,or_greater"));
contact_max_separation = GLOBAL_DEF("physics/2d/solver/contact_max_separation", 1.5); contact_max_separation = GLOBAL_DEF("physics/2d/solver/contact_max_separation", 1.5);
ProjectSettings::get_singleton()->set_custom_property_info("physics/2d/solver/contact_max_separation", PropertyInfo(Variant::FLOAT, "physics/2d/solver/contact_max_separation", PROPERTY_HINT_RANGE, "0,10,0.01,or_greater")); ProjectSettings::get_singleton()->set_custom_property_info("physics/2d/solver/contact_max_separation", PropertyInfo(Variant::FLOAT, "physics/2d/solver/contact_max_separation", PROPERTY_HINT_RANGE, "0,10,0.01,or_greater"));

View file

@ -1258,7 +1258,7 @@ GodotSpace3D::GodotSpace3D() {
ProjectSettings::get_singleton()->set_custom_property_info("physics/3d/solver/solver_iterations", PropertyInfo(Variant::INT, "physics/3d/solver/solver_iterations", PROPERTY_HINT_RANGE, "1,32,1,or_greater")); ProjectSettings::get_singleton()->set_custom_property_info("physics/3d/solver/solver_iterations", PropertyInfo(Variant::INT, "physics/3d/solver/solver_iterations", PROPERTY_HINT_RANGE, "1,32,1,or_greater"));
contact_recycle_radius = GLOBAL_DEF("physics/3d/solver/contact_recycle_radius", 0.01); contact_recycle_radius = GLOBAL_DEF("physics/3d/solver/contact_recycle_radius", 0.01);
ProjectSettings::get_singleton()->set_custom_property_info("physics/3d/solver/contact_recycle_radius", PropertyInfo(Variant::FLOAT, "physics/3d/solver/contact_max_separation", PROPERTY_HINT_RANGE, "0,0.1,0.01,or_greater")); ProjectSettings::get_singleton()->set_custom_property_info("physics/3d/solver/contact_recycle_radius", PropertyInfo(Variant::FLOAT, "physics/3d/solver/contact_recycle_radius", PROPERTY_HINT_RANGE, "0,0.1,0.01,or_greater"));
contact_max_separation = GLOBAL_DEF("physics/3d/solver/contact_max_separation", 0.05); contact_max_separation = GLOBAL_DEF("physics/3d/solver/contact_max_separation", 0.05);
ProjectSettings::get_singleton()->set_custom_property_info("physics/3d/solver/contact_max_separation", PropertyInfo(Variant::FLOAT, "physics/3d/solver/contact_max_separation", PROPERTY_HINT_RANGE, "0,0.1,0.01,or_greater")); ProjectSettings::get_singleton()->set_custom_property_info("physics/3d/solver/contact_max_separation", PropertyInfo(Variant::FLOAT, "physics/3d/solver/contact_max_separation", PROPERTY_HINT_RANGE, "0,0.1,0.01,or_greater"));

View file

@ -2871,14 +2871,6 @@ void RenderingServer::init() {
GLOBAL_DEF("rendering/2d/shadow_atlas/size", 2048); GLOBAL_DEF("rendering/2d/shadow_atlas/size", 2048);
// Already defined in some RenderingDevice*::initialize, which run before this code.
// We re-define them here just for doctool's sake. Make sure to keep default values in sync.
GLOBAL_DEF("rendering/rendering_device/staging_buffer/block_size_kb", 256);
GLOBAL_DEF("rendering/rendering_device/staging_buffer/max_size_mb", 128);
GLOBAL_DEF("rendering/rendering_device/staging_buffer/texture_upload_region_size_px", 64);
// Vulkan-specific.
GLOBAL_DEF("rendering/rendering_device/vulkan/max_descriptors_per_pool", 64);
// Number of commands that can be drawn per frame. // Number of commands that can be drawn per frame.
GLOBAL_DEF_RST("rendering/gl_compatibility/item_buffer_size", 16384); GLOBAL_DEF_RST("rendering/gl_compatibility/item_buffer_size", 16384);
ProjectSettings::get_singleton()->set_custom_property_info("rendering/gl_compatibility/item_buffer_size", PropertyInfo(Variant::INT, "rendering/gl_compatibility/item_buffer_size", PROPERTY_HINT_RANGE, "1024,1048576,1")); ProjectSettings::get_singleton()->set_custom_property_info("rendering/gl_compatibility/item_buffer_size", PropertyInfo(Variant::INT, "rendering/gl_compatibility/item_buffer_size", PROPERTY_HINT_RANGE, "1024,1048576,1"));
@ -2981,7 +2973,6 @@ void RenderingServer::init() {
ProjectSettings::get_singleton()->set_custom_property_info("rendering/textures/light_projectors/filter", PropertyInfo(Variant::INT, "rendering/textures/light_projectors/filter", PROPERTY_HINT_ENUM, "Nearest (Fast),Linear (Fast),Nearest Mipmap (Fast),Linear Mipmap (Fast),Nearest Mipmap Anisotropic (Average),Linear Mipmap Anisotropic (Average)")); ProjectSettings::get_singleton()->set_custom_property_info("rendering/textures/light_projectors/filter", PropertyInfo(Variant::INT, "rendering/textures/light_projectors/filter", PROPERTY_HINT_ENUM, "Nearest (Fast),Linear (Fast),Nearest Mipmap (Fast),Linear Mipmap (Fast),Nearest Mipmap Anisotropic (Average),Linear Mipmap Anisotropic (Average)"));
GLOBAL_DEF_RST("rendering/occlusion_culling/occlusion_rays_per_thread", 512); GLOBAL_DEF_RST("rendering/occlusion_culling/occlusion_rays_per_thread", 512);
GLOBAL_DEF_RST("rendering/occlusion_culling/bvh_build_quality", 2);
ProjectSettings::get_singleton()->set_custom_property_info("rendering/occlusion_culling/bvh_build_quality", PropertyInfo(Variant::INT, "rendering/occlusion_culling/bvh_build_quality", PROPERTY_HINT_ENUM, "Low,Medium,High")); ProjectSettings::get_singleton()->set_custom_property_info("rendering/occlusion_culling/bvh_build_quality", PropertyInfo(Variant::INT, "rendering/occlusion_culling/bvh_build_quality", PROPERTY_HINT_ENUM, "Low,Medium,High"));
GLOBAL_DEF("rendering/environment/glow/upscale_mode", 1); GLOBAL_DEF("rendering/environment/glow/upscale_mode", 1);

View file

@ -192,11 +192,8 @@ struct GodotTestCaseListener : public doctest::IReporter {
String name = String(p_in.m_name); String name = String(p_in.m_name);
if (name.find("[SceneTree]") != -1) { if (name.find("[SceneTree]") != -1) {
GLOBAL_DEF("memory/limits/multithreaded_server/rid_pool_prealloc", 60);
memnew(MessageQueue); memnew(MessageQueue);
GLOBAL_DEF("internationalization/rendering/force_right_to_left_layout_direction", false);
memnew(Input); memnew(Input);
Error err = OK; Error err = OK;