mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Cleanup some GLOBAL_DEFs
This commit is contained in:
parent
5f1e56ff26
commit
cd0aaab48c
7 changed files with 9 additions and 12 deletions
|
@ -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) {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue