mirror of
https://github.com/godotengine/godot
synced 2024-09-05 05:38:35 +00:00
Merge pull request #22779 from Superwaitsum/LimitSettings
Limit several project settings
This commit is contained in:
commit
1169196f04
|
@ -500,8 +500,9 @@ uint64_t FileAccessNetwork::_get_modified_time(const String &p_file) {
|
|||
void FileAccessNetwork::configure() {
|
||||
|
||||
GLOBAL_DEF("network/remote_fs/page_size", 65536);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("network/remote_fs/page_size", PropertyInfo(Variant::INT, "network/remote_fs/page_size", PROPERTY_HINT_RANGE, "1,65536,1,or_greater")); //is used as denominator and can't be zero
|
||||
GLOBAL_DEF("network/remote_fs/page_read_ahead", 4);
|
||||
GLOBAL_DEF("network/remote_fs/max_pages", 20);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("network/remote_fs/page_read_ahead", PropertyInfo(Variant::INT, "network/remote_fs/page_read_ahead", PROPERTY_HINT_RANGE, "0,8,1,or_greater"));
|
||||
}
|
||||
|
||||
FileAccessNetwork::FileAccessNetwork() {
|
||||
|
@ -519,7 +520,6 @@ FileAccessNetwork::FileAccessNetwork() {
|
|||
nc->unlock_mutex();
|
||||
page_size = GLOBAL_GET("network/remote_fs/page_size");
|
||||
read_ahead = GLOBAL_GET("network/remote_fs/page_read_ahead");
|
||||
max_pages = GLOBAL_GET("network/remote_fs/max_pages");
|
||||
last_activity_val = 0;
|
||||
waiting_on_page = -1;
|
||||
last_page = -1;
|
||||
|
|
|
@ -98,7 +98,6 @@ class FileAccessNetwork : public FileAccess {
|
|||
|
||||
int page_size;
|
||||
int read_ahead;
|
||||
int max_pages;
|
||||
|
||||
mutable int waiting_on_page;
|
||||
mutable int last_activity_val;
|
||||
|
|
|
@ -338,6 +338,7 @@ MessageQueue::MessageQueue() {
|
|||
buffer_end = 0;
|
||||
buffer_max_used = 0;
|
||||
buffer_size = GLOBAL_DEF_RST("memory/limits/message_queue/max_size_kb", DEFAULT_QUEUE_SIZE_KB);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("memory/limits/message_queue/max_size_kb", PropertyInfo(Variant::INT, "memory/limits/message_queue/max_size_kb", PROPERTY_HINT_RANGE, "0,2048,1,or_greater"));
|
||||
buffer_size *= 1024;
|
||||
buffer = memnew_arr(uint8_t, buffer_size);
|
||||
}
|
||||
|
|
|
@ -1162,6 +1162,7 @@ ProjectSettings::ProjectSettings() {
|
|||
custom_prop_info["rendering/quality/intended_usage/framebuffer_allocation"] = PropertyInfo(Variant::INT, "rendering/quality/intended_usage/framebuffer_allocation", PROPERTY_HINT_ENUM, "2D,2D Without Sampling,3D,3D Without Effects");
|
||||
|
||||
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");
|
||||
|
||||
//assigning here, because using GLOBAL_GET on every block for compressing can be slow
|
||||
Compression::zstd_long_distance_matching = GLOBAL_DEF("compression/formats/zstd/long_distance_matching", false);
|
||||
|
|
|
@ -199,6 +199,7 @@ void register_core_types() {
|
|||
void register_core_settings() {
|
||||
//since in register core types, globals may not e present
|
||||
GLOBAL_DEF_RST("network/limits/packet_peer_stream/max_buffer_po2", (16));
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("network/limits/packet_peer_stream/max_buffer_po2", PropertyInfo(Variant::INT, "network/limits/packet_peer_stream/max_buffer_po2", PROPERTY_HINT_RANGE, "0,64,1,or_greater"));
|
||||
}
|
||||
|
||||
void register_core_singletons() {
|
||||
|
|
|
@ -1100,7 +1100,7 @@ ScriptDebuggerRemote::ScriptDebuggerRemote() :
|
|||
eh.userdata = this;
|
||||
add_error_handler(&eh);
|
||||
|
||||
profile_info.resize(CLAMP(int(ProjectSettings::get_singleton()->get("debug/settings/profiler/max_functions")), 128, 65535));
|
||||
profile_info.resize(GLOBAL_GET("debug/settings/profiler/max_functions"));
|
||||
profile_info_ptrs.resize(profile_info.size());
|
||||
}
|
||||
|
||||
|
|
|
@ -1111,6 +1111,7 @@ void RasterizerCanvasGLES2::initialize() {
|
|||
// polygon buffer
|
||||
{
|
||||
uint32_t poly_size = GLOBAL_DEF("rendering/limits/buffers/canvas_polygon_buffer_size_kb", 128);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("rendering/limits/buffers/canvas_polygon_buffer_size_kb", PropertyInfo(Variant::INT, "rendering/limits/buffers/canvas_polygon_buffer_size_kb", PROPERTY_HINT_RANGE, "0,256,1,or_greater"));
|
||||
poly_size *= 1024;
|
||||
poly_size = MAX(poly_size, (2 + 2 + 4) * 4 * sizeof(float));
|
||||
glGenBuffers(1, &data.polygon_buffer);
|
||||
|
@ -1122,6 +1123,7 @@ void RasterizerCanvasGLES2::initialize() {
|
|||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
|
||||
uint32_t index_size = GLOBAL_DEF("rendering/limits/buffers/canvas_polygon_index_size_kb", 128);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("rendering/limits/buffers/canvas_polygon_index_size_kb", PropertyInfo(Variant::INT, "rendering/limits/buffers/canvas_polygon_index_size_kb", PROPERTY_HINT_RANGE, "0,256,1,or_greater"));
|
||||
index_size *= 1024; // kb
|
||||
glGenBuffers(1, &data.polygon_index_buffer);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, data.polygon_index_buffer);
|
||||
|
|
|
@ -3046,6 +3046,7 @@ void RasterizerSceneGLES2::initialize() {
|
|||
|
||||
{
|
||||
uint32_t immediate_buffer_size = GLOBAL_DEF("rendering/limits/buffers/immediate_buffer_size_kb", 2048);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("rendering/limits/buffers/immediate_buffer_size_kb", PropertyInfo(Variant::INT, "rendering/limits/buffers/immediate_buffer_size_kb", PROPERTY_HINT_RANGE, "0,8192,1,or_greater"));
|
||||
|
||||
glGenBuffers(1, &state.immediate_buffer);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, state.immediate_buffer);
|
||||
|
|
|
@ -2027,6 +2027,7 @@ void RasterizerCanvasGLES3::initialize() {
|
|||
{
|
||||
|
||||
uint32_t poly_size = GLOBAL_DEF_RST("rendering/limits/buffers/canvas_polygon_buffer_size_kb", 128);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("rendering/limits/buffers/canvas_polygon_buffer_size_kb", PropertyInfo(Variant::INT, "rendering/limits/buffers/canvas_polygon_buffer_size_kb", PROPERTY_HINT_RANGE, "0,256,1,or_greater"));
|
||||
poly_size *= 1024; //kb
|
||||
poly_size = MAX(poly_size, (2 + 2 + 4) * 4 * sizeof(float));
|
||||
glGenBuffers(1, &data.polygon_buffer);
|
||||
|
@ -2074,6 +2075,7 @@ void RasterizerCanvasGLES3::initialize() {
|
|||
glGenVertexArrays(1, &data.polygon_buffer_pointer_array);
|
||||
|
||||
uint32_t index_size = GLOBAL_DEF_RST("rendering/limits/buffers/canvas_polygon_index_buffer_size_kb", 128);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("rendering/limits/buffers/canvas_polygon_index_buffer_size_kb", PropertyInfo(Variant::INT, "rendering/limits/buffers/canvas_polygon_index_buffer_size_kb", PROPERTY_HINT_RANGE, "0,256,1,or_greater"));
|
||||
index_size *= 1024; //kb
|
||||
glGenBuffers(1, &data.polygon_index_buffer);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, data.polygon_index_buffer);
|
||||
|
|
|
@ -436,6 +436,7 @@ void RasterizerGLES3::register_config() {
|
|||
GLOBAL_DEF("rendering/quality/filters/anisotropic_filter_level", 4);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/filters/anisotropic_filter_level", PropertyInfo(Variant::INT, "rendering/quality/filters/anisotropic_filter_level", PROPERTY_HINT_RANGE, "1,16,1"));
|
||||
GLOBAL_DEF("rendering/limits/time/time_rollover_secs", 3600);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("rendering/limits/time/time_rollover_secs", PropertyInfo(Variant::REAL, "rendering/limits/time/time_rollover_secs", PROPERTY_HINT_RANGE, "0,10000,1,or_greater"));
|
||||
}
|
||||
|
||||
RasterizerGLES3::RasterizerGLES3() {
|
||||
|
|
|
@ -4852,10 +4852,7 @@ void RasterizerSceneGLES3::initialize() {
|
|||
glBindBuffer(GL_UNIFORM_BUFFER, 0);
|
||||
|
||||
render_list.max_elements = GLOBAL_DEF_RST("rendering/limits/rendering/max_renderable_elements", (int)RenderList::DEFAULT_MAX_ELEMENTS);
|
||||
if (render_list.max_elements > 1000000)
|
||||
render_list.max_elements = 1000000;
|
||||
if (render_list.max_elements < 1024)
|
||||
render_list.max_elements = 1024;
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("rendering/limits/rendering/max_renderable_elements", PropertyInfo(Variant::INT, "rendering/limits/rendering/max_renderable_elements", PROPERTY_HINT_RANGE, "1024,1000000,1"));
|
||||
|
||||
{
|
||||
//quad buffers
|
||||
|
@ -5054,6 +5051,7 @@ void RasterizerSceneGLES3::initialize() {
|
|||
{
|
||||
|
||||
uint32_t immediate_buffer_size = GLOBAL_DEF("rendering/limits/buffers/immediate_buffer_size_kb", 2048);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("rendering/limits/buffers/immediate_buffer_size_kb", PropertyInfo(Variant::INT, "rendering/limits/buffers/immediate_buffer_size_kb", PROPERTY_HINT_RANGE, "0,8192,1,or_greater"));
|
||||
|
||||
glGenBuffers(1, &state.immediate_buffer);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, state.immediate_buffer);
|
||||
|
|
|
@ -7686,6 +7686,8 @@ void RasterizerStorageGLES3::initialize() {
|
|||
{
|
||||
//transform feedback buffers
|
||||
uint32_t xf_feedback_size = GLOBAL_DEF_RST("rendering/limits/buffers/blend_shape_max_buffer_size_kb", 4096);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("rendering/limits/buffers/blend_shape_max_buffer_size_kb", PropertyInfo(Variant::INT, "rendering/limits/buffers/blend_shape_max_buffer_size_kb", PROPERTY_HINT_RANGE, "0,8192,1,or_greater"));
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
|
||||
glGenBuffers(1, &resources.transform_feedback_buffers[i]);
|
||||
|
|
|
@ -738,9 +738,13 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
|||
}
|
||||
|
||||
GLOBAL_DEF("memory/limits/multithreaded_server/rid_pool_prealloc", 60);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("memory/limits/multithreaded_server/rid_pool_prealloc", PropertyInfo(Variant::INT, "memory/limits/multithreaded_server/rid_pool_prealloc", PROPERTY_HINT_RANGE, "0,500,1")); // No negative and limit to 500 due to crashes
|
||||
GLOBAL_DEF("network/limits/debugger_stdout/max_chars_per_second", 2048);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("network/limits/debugger_stdout/max_chars_per_second", PropertyInfo(Variant::INT, "network/limits/debugger_stdout/max_chars_per_second", PROPERTY_HINT_RANGE, "0, 4096, 1, or_greater"));
|
||||
GLOBAL_DEF("network/limits/debugger_stdout/max_messages_per_frame", 10);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("network/limits/debugger_stdout/max_messages_per_frame", PropertyInfo(Variant::INT, "network/limits/debugger_stdout/max_messages_per_frame", PROPERTY_HINT_RANGE, "0, 20, 1, or_greater"));
|
||||
GLOBAL_DEF("network/limits/debugger_stdout/max_errors_per_frame", 10);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("network/limits/debugger_stdout/max_errors_per_frame", PropertyInfo(Variant::INT, "network/limits/debugger_stdout/max_errors_per_frame", PROPERTY_HINT_RANGE, "0, 20, 1, or_greater"));
|
||||
|
||||
if (debug_mode == "remote") {
|
||||
|
||||
|
@ -813,6 +817,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
|||
GLOBAL_DEF("logging/file_logging/enable_file_logging", false);
|
||||
GLOBAL_DEF("logging/file_logging/log_path", "user://logs/log.txt");
|
||||
GLOBAL_DEF("logging/file_logging/max_log_files", 10);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("logging/file_logging/max_log_files", PropertyInfo(Variant::INT, "logging/file_logging/max_log_files", PROPERTY_HINT_RANGE, "0,20,1,or_greater")); //no negative numbers
|
||||
if (FileAccess::get_create_func(FileAccess::ACCESS_USERDATA) && GLOBAL_GET("logging/file_logging/enable_file_logging")) {
|
||||
String base_path = GLOBAL_GET("logging/file_logging/log_path");
|
||||
int max_files = GLOBAL_GET("logging/file_logging/max_log_files");
|
||||
|
@ -1003,6 +1008,7 @@ 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/physics_fps", 60));
|
||||
Engine::get_singleton()->set_physics_jitter_fix(GLOBAL_DEF("physics/common/physics_jitter_fix", 0.5));
|
||||
Engine::get_singleton()->set_target_fps(GLOBAL_DEF("debug/settings/fps/force_fps", 0));
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("debug/settings/fps/force_fps", PropertyInfo(Variant::INT, "debug/settings/fps/force_fps", PROPERTY_HINT_RANGE, "0,120,1,or_greater"));
|
||||
|
||||
GLOBAL_DEF("debug/settings/stdout/print_fps", false);
|
||||
|
||||
|
@ -1011,10 +1017,12 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
|||
|
||||
if (frame_delay == 0) {
|
||||
frame_delay = GLOBAL_DEF("application/run/frame_delay_msec", 0);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("application/run/frame_delay_msec", PropertyInfo(Variant::INT, "application/run/frame_delay_msec", PROPERTY_HINT_RANGE, "0,100,1,or_greater")); // No negative numbers
|
||||
}
|
||||
|
||||
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));
|
||||
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);
|
||||
|
||||
|
@ -1643,7 +1651,7 @@ bool Main::start() {
|
|||
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::STRING, "display/window/stretch/shrink", PROPERTY_HINT_RANGE, "1,8,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"));
|
||||
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);
|
||||
|
|
|
@ -2065,12 +2065,12 @@ GDScriptLanguage::GDScriptLanguage() {
|
|||
|
||||
_debug_call_stack_pos = 0;
|
||||
int dmcs = GLOBAL_DEF("debug/settings/gdscript/max_call_stack", 1024);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("debug/settings/gdscript/max_call_stack", PropertyInfo(Variant::INT, "debug/settings/gdscript/max_call_stack", PROPERTY_HINT_RANGE, "1024,4096,1,or_greater")); //minimum is 1024
|
||||
|
||||
if (ScriptDebugger::get_singleton()) {
|
||||
//debugging enabled!
|
||||
|
||||
_debug_max_call_stack = dmcs;
|
||||
if (_debug_max_call_stack < 1024)
|
||||
_debug_max_call_stack = 1024;
|
||||
_call_stack = memnew_arr(CallLevel, _debug_max_call_stack + 1);
|
||||
|
||||
} else {
|
||||
|
|
|
@ -2699,11 +2699,11 @@ VisualScriptLanguage::VisualScriptLanguage() {
|
|||
_debug_parse_err_file = "";
|
||||
_debug_call_stack_pos = 0;
|
||||
int dmcs = GLOBAL_DEF("debug/settings/visual_script/max_call_stack", 1024);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("debug/settings/visual_script/max_call_stack", PropertyInfo(Variant::INT, "debug/settings/visual_script/max_call_stack", PROPERTY_HINT_RANGE, "1024,4096,1,or_greater")); //minimum is 1024
|
||||
|
||||
if (ScriptDebugger::get_singleton()) {
|
||||
//debugging enabled!
|
||||
_debug_max_call_stack = dmcs;
|
||||
if (_debug_max_call_stack < 1024)
|
||||
_debug_max_call_stack = 1024;
|
||||
_call_stack = memnew_arr(CallLevel, _debug_max_call_stack + 1);
|
||||
|
||||
} else {
|
||||
|
|
|
@ -1524,6 +1524,7 @@ void ItemList::_bind_methods() {
|
|||
ADD_SIGNAL(MethodInfo("nothing_selected"));
|
||||
|
||||
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() {
|
||||
|
|
|
@ -6232,6 +6232,7 @@ void TextEdit::_bind_methods() {
|
|||
BIND_ENUM_CONSTANT(MENU_MAX);
|
||||
|
||||
GLOBAL_DEF("gui/timers/text_edit_idle_detect_sec", 3);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("gui/timers/text_edit_idle_detect_sec", PropertyInfo(Variant::REAL, "gui/timers/text_edit_idle_detect_sec", PROPERTY_HINT_RANGE, "0,10,0.01,or_greater")); // No negative numbers
|
||||
}
|
||||
|
||||
TextEdit::TextEdit() {
|
||||
|
|
|
@ -1944,6 +1944,7 @@ SceneTree::SceneTree() {
|
|||
debug_navigation_color = GLOBAL_DEF("debug/shapes/navigation/geometry_color", Color(0.1, 1.0, 0.7, 0.4));
|
||||
debug_navigation_disabled_color = GLOBAL_DEF("debug/shapes/navigation/disabled_geometry_color", Color(1.0, 0.7, 0.1, 0.4));
|
||||
collision_debug_contacts = GLOBAL_DEF("debug/shapes/collision/max_contacts_displayed", 10000);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("debug/shapes/collision/max_contacts_displayed", PropertyInfo(Variant::INT, "debug/shapes/collision/max_contacts_displayed", PROPERTY_HINT_RANGE, "0,20000,1")); // No negative
|
||||
|
||||
tree_version = 1;
|
||||
physics_process_time = 1;
|
||||
|
@ -1977,7 +1978,9 @@ SceneTree::SceneTree() {
|
|||
current_scene = NULL;
|
||||
|
||||
int ref_atlas_size = GLOBAL_DEF("rendering/quality/reflections/atlas_size", 2048);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/reflections/atlas_size", PropertyInfo(Variant::INT, "rendering/quality/reflections/atlas_size", PROPERTY_HINT_RANGE, "0,8192,or_greater")); //next_power_of_2 will return a 0 as min value
|
||||
int ref_atlas_subdiv = GLOBAL_DEF("rendering/quality/reflections/atlas_subdiv", 8);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/reflections/atlas_subdiv", PropertyInfo(Variant::INT, "rendering/quality/reflections/atlas_subdiv", PROPERTY_HINT_RANGE, "0,32,or_greater")); //next_power_of_2 will return a 0 as min value
|
||||
int msaa_mode = GLOBAL_DEF("rendering/quality/filters/msaa", 0);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/filters/msaa", PropertyInfo(Variant::INT, "rendering/quality/filters/msaa", PROPERTY_HINT_ENUM, "Disabled,2x,4x,8x,16x"));
|
||||
root->set_msaa(Viewport::MSAA(msaa_mode));
|
||||
|
|
|
@ -2945,6 +2945,7 @@ Viewport::Viewport() {
|
|||
|
||||
//gui.tooltip_timer->force_parent_owned();
|
||||
gui.tooltip_delay = GLOBAL_DEF("gui/timers/tooltip_delay_sec", 0.7);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("gui/timers/tooltip_delay_sec", PropertyInfo(Variant::REAL, "gui/timers/tooltip_delay_sec", PROPERTY_HINT_RANGE, "0,5,0.01,or_greater")); // No negative numbers
|
||||
|
||||
gui.tooltip = NULL;
|
||||
gui.tooltip_label = NULL;
|
||||
|
|
|
@ -934,6 +934,7 @@ void AudioServer::init() {
|
|||
|
||||
channel_disable_threshold_db = GLOBAL_DEF_RST("audio/channel_disable_threshold_db", -60.0);
|
||||
channel_disable_frames = float(GLOBAL_DEF_RST("audio/channel_disable_time", 2.0)) * get_mix_rate();
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("audio/channel_disable_time", PropertyInfo(Variant::REAL, "audio/channel_disable_time", PROPERTY_HINT_RANGE, "0,5,0.01,or_greater"));
|
||||
buffer_size = 1024; //hardcoded for now
|
||||
|
||||
init_channels_and_buffers();
|
||||
|
|
|
@ -1183,6 +1183,7 @@ SpaceSW::SpaceSW() {
|
|||
body_linear_velocity_sleep_threshold = GLOBAL_DEF("physics/3d/sleep_threshold_linear", 0.1);
|
||||
body_angular_velocity_sleep_threshold = GLOBAL_DEF("physics/3d/sleep_threshold_angular", (8.0 / 180.0 * Math_PI));
|
||||
body_time_to_sleep = GLOBAL_DEF("physics/3d/time_before_sleep", 0.5);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("physics/3d/time_before_sleep", PropertyInfo(Variant::REAL, "physics/3d/time_before_sleep", PROPERTY_HINT_RANGE, "0,5,0.01,or_greater"));
|
||||
body_angular_velocity_damp_ratio = 10;
|
||||
|
||||
broadphase = BroadPhaseSW::create_func();
|
||||
|
|
|
@ -635,11 +635,15 @@ BroadPhase2DSW *BroadPhase2DHashGrid::_create() {
|
|||
BroadPhase2DHashGrid::BroadPhase2DHashGrid() {
|
||||
|
||||
hash_table_size = GLOBAL_DEF("physics/2d/bp_hash_table_size", 4096);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("physics/2d/bp_hash_table_size", PropertyInfo(Variant::INT, "physics/2d/bp_hash_table_size", PROPERTY_HINT_RANGE, "0,8192,1,or_greater"));
|
||||
hash_table_size = Math::larger_prime(hash_table_size);
|
||||
hash_table = memnew_arr(PosBin *, hash_table_size);
|
||||
|
||||
cell_size = GLOBAL_DEF("physics/2d/cell_size", 128);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("physics/2d/cell_size", PropertyInfo(Variant::INT, "physics/2d/cell_size", PROPERTY_HINT_RANGE, "0,512,1,or_greater"));
|
||||
|
||||
large_object_min_surface = GLOBAL_DEF("physics/2d/large_object_surface_threshold_in_cells", 512);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("physics/2d/large_object_surface_threshold_in_cells", PropertyInfo(Variant::INT, "physics/2d/large_object_surface_threshold_in_cells", PROPERTY_HINT_RANGE, "0,1024,1,or_greater"));
|
||||
|
||||
for (uint32_t i = 0; i < hash_table_size; i++)
|
||||
hash_table[i] = NULL;
|
||||
|
|
|
@ -1233,6 +1233,7 @@ Space2DSW::Space2DSW() {
|
|||
body_linear_velocity_sleep_threshold = GLOBAL_DEF("physics/2d/sleep_threshold_linear", 2.0);
|
||||
body_angular_velocity_sleep_threshold = GLOBAL_DEF("physics/2d/sleep_threshold_angular", (8.0 / 180.0 * Math_PI));
|
||||
body_time_to_sleep = GLOBAL_DEF("physics/2d/time_before_sleep", 0.5);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("physics/2d/time_before_sleep", PropertyInfo(Variant::REAL, "physics/2d/time_before_sleep", PROPERTY_HINT_RANGE, "0,5,0.01,or_greater"));
|
||||
|
||||
broadphase = BroadPhase2DSW::create_func();
|
||||
broadphase->set_pair_callback(_broadphase_pair, this);
|
||||
|
|
|
@ -2370,6 +2370,7 @@ VisualServer::VisualServer() {
|
|||
|
||||
GLOBAL_DEF("rendering/quality/directional_shadow/size", 4096);
|
||||
GLOBAL_DEF("rendering/quality/directional_shadow/size.mobile", 2048);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/directional_shadow/size", PropertyInfo(Variant::INT, "rendering/quality/directional_shadow/size", PROPERTY_HINT_RANGE, "256,16384"));
|
||||
GLOBAL_DEF("rendering/quality/shadow_atlas/size", 4096);
|
||||
GLOBAL_DEF("rendering/quality/shadow_atlas/size.mobile", 2048);
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/shadow_atlas/size", PropertyInfo(Variant::INT, "rendering/quality/shadow_atlas/size", PROPERTY_HINT_RANGE, "256,16384"));
|
||||
|
|
Loading…
Reference in a new issue