diff options
Diffstat (limited to 'core/config')
-rw-r--r-- | core/config/engine.cpp | 9 | ||||
-rw-r--r-- | core/config/engine.h | 4 | ||||
-rw-r--r-- | core/config/project_settings.cpp | 14 |
3 files changed, 20 insertions, 7 deletions
diff --git a/core/config/engine.cpp b/core/config/engine.cpp index 21e910be5b..7aa5f4d06d 100644 --- a/core/config/engine.cpp +++ b/core/config/engine.cpp @@ -48,6 +48,15 @@ int Engine::get_physics_ticks_per_second() const { return ips; } +void Engine::set_max_physics_steps_per_frame(int p_max_physics_steps) { + ERR_FAIL_COND_MSG(p_max_physics_steps <= 0, "Maximum number of physics steps per frame must be greater than 0."); + max_physics_steps_per_frame = p_max_physics_steps; +} + +int Engine::get_max_physics_steps_per_frame() const { + return max_physics_steps_per_frame; +} + void Engine::set_physics_jitter_fix(double p_threshold) { if (p_threshold < 0) { p_threshold = 0; diff --git a/core/config/engine.h b/core/config/engine.h index 21517e46b7..1b179c5727 100644 --- a/core/config/engine.h +++ b/core/config/engine.h @@ -63,6 +63,7 @@ private: int _max_fps = 0; double _time_scale = 1.0; uint64_t _physics_frames = 0; + int max_physics_steps_per_frame = 8; double _physics_interpolation_fraction = 0.0f; bool abort_on_gpu_errors = false; bool use_validation_layers = false; @@ -93,6 +94,9 @@ public: virtual void set_physics_ticks_per_second(int p_ips); virtual int get_physics_ticks_per_second() const; + virtual void set_max_physics_steps_per_frame(int p_max_physics_steps); + virtual int get_max_physics_steps_per_frame() const; + void set_physics_jitter_fix(double p_threshold); double get_physics_jitter_fix() const; diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index 4d2006d42a..7aaa9a46b7 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -82,7 +82,7 @@ String ProjectSettings::get_imported_files_path() const { // Returns the features that a project must have when opened with this build of Godot. // This is used by the project manager to provide the initial_settings for config/features. const PackedStringArray ProjectSettings::get_required_features() { - PackedStringArray features = PackedStringArray(); + PackedStringArray features; features.append(VERSION_BRANCH); #ifdef REAL_T_IS_DOUBLE features.append("Double Precision"); @@ -115,7 +115,7 @@ const PackedStringArray ProjectSettings::_get_supported_features() { // Returns the features that this project needs but this build of Godot lacks. const PackedStringArray ProjectSettings::get_unsupported_features(const PackedStringArray &p_project_features) { - PackedStringArray unsupported_features = PackedStringArray(); + PackedStringArray unsupported_features; PackedStringArray supported_features = singleton->_get_supported_features(); for (int i = 0; i < p_project_features.size(); i++) { if (!supported_features.has(p_project_features[i])) { @@ -1246,12 +1246,12 @@ ProjectSettings::ProjectSettings() { GLOBAL_DEF_BASIC("audio/buses/default_bus_layout", "res://default_bus_layout.tres"); custom_prop_info["audio/buses/default_bus_layout"] = PropertyInfo(Variant::STRING, "audio/buses/default_bus_layout", PROPERTY_HINT_FILE, "*.tres"); - GLOBAL_DEF_RST("audio/general/2d_panning_strength", 1.0f); - custom_prop_info["audio/general/2d_panning_strength"] = PropertyInfo(Variant::FLOAT, "audio/general/2d_panning_strength", PROPERTY_HINT_RANGE, "0,4,0.01"); - GLOBAL_DEF_RST("audio/general/3d_panning_strength", 1.0f); - custom_prop_info["audio/general/3d_panning_strength"] = PropertyInfo(Variant::FLOAT, "audio/general/3d_panning_strength", PROPERTY_HINT_RANGE, "0,4,0.01"); + GLOBAL_DEF_RST("audio/general/2d_panning_strength", 0.5f); + custom_prop_info["audio/general/2d_panning_strength"] = PropertyInfo(Variant::FLOAT, "audio/general/2d_panning_strength", PROPERTY_HINT_RANGE, "0,2,0.01"); + GLOBAL_DEF_RST("audio/general/3d_panning_strength", 0.5f); + custom_prop_info["audio/general/3d_panning_strength"] = PropertyInfo(Variant::FLOAT, "audio/general/3d_panning_strength", PROPERTY_HINT_RANGE, "0,2,0.01"); - PackedStringArray extensions = PackedStringArray(); + PackedStringArray extensions; extensions.push_back("gd"); if (Engine::get_singleton()->has_singleton("GodotSharp")) { extensions.push_back("cs"); |