Cleanup some GLOBAL_DEFs

This commit is contained in:
kobewi 2023-08-24 22:39:40 +02:00
parent 5f1e56ff26
commit cd0aaab48c
7 changed files with 9 additions and 12 deletions

View File

@ -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());

View File

@ -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>

View File

@ -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;
}

View File

@ -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..

View File

@ -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) {

View File

@ -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() {

View File

@ -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);