diff options
author | kobewi <kobewi4e@gmail.com> | 2023-08-24 22:39:40 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2023-09-15 21:32:23 +0200 |
commit | cd0aaab48c789cbca3e6ddfa5e0daf1e4cb6b0db (patch) | |
tree | 95c13c0f85166d5d8f6aac29cf59f136477e447d | |
parent | 5f1e56ff26be4070496aa51095b9ac2f2b4f4ed8 (diff) | |
download | redot-engine-cd0aaab48c789cbca3e6ddfa5e0daf1e4cb6b0db.tar.gz |
Cleanup some GLOBAL_DEFs
-rw-r--r-- | core/config/project_settings.cpp | 2 | ||||
-rw-r--r-- | doc/classes/ProjectSettings.xml | 3 | ||||
-rw-r--r-- | editor/gui/editor_run_bar.cpp | 2 | ||||
-rw-r--r-- | editor/import/editor_import_collada.cpp | 2 | ||||
-rw-r--r-- | modules/webrtc/register_types.cpp | 8 | ||||
-rw-r--r-- | modules/webrtc/webrtc_data_channel.cpp | 2 | ||||
-rw-r--r-- | modules/webrtc/webrtc_data_channel.h | 2 |
7 files changed, 9 insertions, 12 deletions
diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index 9ffbac3553..5ba800ebfe 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -1398,6 +1398,8 @@ ProjectSettings::ProjectSettings() { GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "rendering/textures/canvas_textures/default_texture_filter", PROPERTY_HINT_ENUM, "Nearest,Linear,Linear Mipmap,Nearest Mipmap"), 1); GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "rendering/textures/canvas_textures/default_texture_repeat", PROPERTY_HINT_ENUM, "Disable,Enable,Mirror"), 0); + GLOBAL_DEF("collada/use_ambient", false); + // These properties will not show up in the dialog. If you want to exclude whole groups, use add_hidden_prefix(). GLOBAL_DEF_INTERNAL("application/config/features", PackedStringArray()); GLOBAL_DEF_INTERNAL("internationalization/locale/translation_remaps", PackedStringArray()); diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 6f900e06dd..87c642c6d3 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -400,6 +400,9 @@ <member name="audio/video/video_delay_compensation_ms" type="int" setter="" getter="" default="0"> Setting to hardcode audio delay when playing video. Best to leave this untouched unless you know what you are doing. </member> + <member name="collada/use_ambient" type="bool" setter="" getter="" default="false"> + If [code]true[/code], ambient lights will be imported from COLLADA models as [DirectionalLight3D]. If [code]false[/code], ambient lights will be ignored. + </member> <member name="compression/formats/gzip/compression_level" type="int" setter="" getter="" default="-1"> The default compression level for gzip. Affects compressed scenes and resources. Higher levels result in smaller files at the cost of compression speed. Decompression speed is mostly unaffected by the compression level. [code]-1[/code] uses the default gzip compression level, which is identical to [code]6[/code] but could change in the future due to underlying zlib updates. </member> diff --git a/editor/gui/editor_run_bar.cpp b/editor/gui/editor_run_bar.cpp index 4dfe40f0ad..497c92d951 100644 --- a/editor/gui/editor_run_bar.cpp +++ b/editor/gui/editor_run_bar.cpp @@ -220,7 +220,7 @@ void EditorRunBar::_run_scene(const String &p_scene_path) { return; } - run_filename = GLOBAL_DEF_BASIC("application/run/main_scene", ""); + run_filename = GLOBAL_GET("application/run/main_scene"); } break; } diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index 5f714e4488..62343777a9 100644 --- a/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -208,7 +208,7 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Node3D *p_parent) { return OK; //do nothing not needed } - if (!bool(GLOBAL_DEF("collada/use_ambient", false))) { + if (!bool(GLOBAL_GET("collada/use_ambient"))) { return OK; } //well, it's an ambient light.. diff --git a/modules/webrtc/register_types.cpp b/modules/webrtc/register_types.cpp index 687c7b711e..28ce36f1e8 100644 --- a/modules/webrtc/register_types.cpp +++ b/modules/webrtc/register_types.cpp @@ -42,11 +42,7 @@ void initialize_webrtc_module(ModuleInitializationLevel p_level) { if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { return; } - -#define SET_HINT(NAME, _VAL_, _MAX_) \ - GLOBAL_DEF(PropertyInfo(Variant::INT, NAME, PROPERTY_HINT_RANGE, "2," #_MAX_ ",1,or_greater"), _VAL_); - - SET_HINT(WRTC_IN_BUF, 64, 4096); + GLOBAL_DEF(PropertyInfo(Variant::INT, "network/limits/webrtc/max_channel_in_buffer_kb", PROPERTY_HINT_RANGE, "2,4096,1,or_greater"), 64); ClassDB::register_custom_instance_class<WebRTCPeerConnection>(); GDREGISTER_CLASS(WebRTCPeerConnectionExtension); @@ -55,8 +51,6 @@ void initialize_webrtc_module(ModuleInitializationLevel p_level) { GDREGISTER_CLASS(WebRTCDataChannelExtension); GDREGISTER_CLASS(WebRTCMultiplayerPeer); - -#undef SET_HINT } void uninitialize_webrtc_module(ModuleInitializationLevel p_level) { diff --git a/modules/webrtc/webrtc_data_channel.cpp b/modules/webrtc/webrtc_data_channel.cpp index bebf5c2741..6c0d0bea37 100644 --- a/modules/webrtc/webrtc_data_channel.cpp +++ b/modules/webrtc/webrtc_data_channel.cpp @@ -61,7 +61,7 @@ void WebRTCDataChannel::_bind_methods() { } WebRTCDataChannel::WebRTCDataChannel() { - _in_buffer_shift = nearest_shift((int)GLOBAL_GET(WRTC_IN_BUF) - 1) + 10; + _in_buffer_shift = nearest_shift((int)GLOBAL_GET("network/limits/webrtc/max_channel_in_buffer_kb") - 1) + 10; } WebRTCDataChannel::~WebRTCDataChannel() { diff --git a/modules/webrtc/webrtc_data_channel.h b/modules/webrtc/webrtc_data_channel.h index e884c8425d..f35461a5a0 100644 --- a/modules/webrtc/webrtc_data_channel.h +++ b/modules/webrtc/webrtc_data_channel.h @@ -33,8 +33,6 @@ #include "core/io/packet_peer.h" -#define WRTC_IN_BUF PNAME("network/limits/webrtc/max_channel_in_buffer_kb") - class WebRTCDataChannel : public PacketPeer { GDCLASS(WebRTCDataChannel, PacketPeer); |