1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

Add more property hint ranges for project settings

- Tweak property hint ranges for some networking settings to ensure
  the minimum values don't break the debugger entirely.
- Ensure shader time rollover is set to at least 1, as 0 causes a division by
  zero to occur.

All relevant project settings are now covered by a range hint.
This commit is contained in:
Hugo Locurcio
2024-10-26 16:18:11 +02:00
parent 216b3302f3
commit 62c17911ea
10 changed files with 28 additions and 28 deletions

View File

@@ -1493,7 +1493,7 @@ void AudioServer::init_channels_and_buffers() {
}
void AudioServer::init() {
channel_disable_threshold_db = GLOBAL_DEF_RST("audio/buses/channel_disable_threshold_db", -60.0);
channel_disable_threshold_db = GLOBAL_DEF_RST(PropertyInfo(Variant::FLOAT, "audio/buses/channel_disable_threshold_db", PROPERTY_HINT_RANGE, "-80,0,0.1,suffix:dB"), -60.0);
channel_disable_frames = float(GLOBAL_DEF_RST(PropertyInfo(Variant::FLOAT, "audio/buses/channel_disable_time", PROPERTY_HINT_RANGE, "0,5,0.01,or_greater"), 2.0)) * get_mix_rate();
// TODO: Buffer size is hardcoded for now. This would be really nice to have as a project setting because currently it limits audio latency to an absolute minimum of 11ms with default mix rate, but there's some additional work required to make that happen. See TODOs in `_mix_step_for_channel`.
// When this becomes a project setting, it should be specified in milliseconds rather than raw sample count, because 512 samples at 192khz is shorter than it is at 48khz, for example.
@@ -1514,7 +1514,7 @@ void AudioServer::init() {
set_edited(false); //avoid editors from thinking this was edited
#endif
GLOBAL_DEF_RST("audio/video/video_delay_compensation_ms", 0);
GLOBAL_DEF_RST(PropertyInfo(Variant::INT, "audio/video/video_delay_compensation_ms", PROPERTY_HINT_RANGE, "-1000,1000,1,suffix:ms"), 0);
}
void AudioServer::update() {