summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-06-29 12:28:30 +0200
committerGitHub <noreply@github.com>2019-06-29 12:28:30 +0200
commit52355c638b03ff9316ee3f39e32ac968252489d3 (patch)
treecabf1815270f0b415c3640e680ef40535793dae5 /modules
parente222e31fe633f6b4ae0abbc3cb2fb6a80ad2f9cd (diff)
parent0c4c36d823bb6792917dfac86491f61cec3f9b27 (diff)
Merge pull request #29380 from bojidar-bg/16086-docs-default-value
Add default values to the editor help, docs, and generated RST
Diffstat (limited to 'modules')
-rw-r--r--modules/enet/networked_multiplayer_enet.cpp4
-rw-r--r--modules/gdnative/arvr/arvr_interface_gdnative.cpp26
-rw-r--r--modules/gdnative/arvr/arvr_interface_gdnative.h2
-rw-r--r--modules/gdnative/net/multiplayer_peer_gdnative.cpp2
-rw-r--r--modules/webrtc/webrtc_data_channel_gdnative.cpp1
5 files changed, 19 insertions, 16 deletions
diff --git a/modules/enet/networked_multiplayer_enet.cpp b/modules/enet/networked_multiplayer_enet.cpp
index dcb4b7fd75..a5a356ced2 100644
--- a/modules/enet/networked_multiplayer_enet.cpp
+++ b/modules/enet/networked_multiplayer_enet.cpp
@@ -882,7 +882,9 @@ NetworkedMultiplayerENet::NetworkedMultiplayerENet() {
NetworkedMultiplayerENet::~NetworkedMultiplayerENet() {
- close_connection();
+ if (active) {
+ close_connection();
+ }
}
// Sets IP for ENet to bind when using create_server or create_client
diff --git a/modules/gdnative/arvr/arvr_interface_gdnative.cpp b/modules/gdnative/arvr/arvr_interface_gdnative.cpp
index da01f573ce..64e2c362b2 100644
--- a/modules/gdnative/arvr/arvr_interface_gdnative.cpp
+++ b/modules/gdnative/arvr/arvr_interface_gdnative.cpp
@@ -33,9 +33,13 @@
#include "servers/arvr/arvr_positional_tracker.h"
#include "servers/visual/visual_server_globals.h"
+void ARVRInterfaceGDNative::_bind_methods() {
+ ADD_PROPERTY_DEFAULT("interface_is_initialized", false);
+ ADD_PROPERTY_DEFAULT("ar_is_anchor_detection_enabled", false);
+}
+
ARVRInterfaceGDNative::ARVRInterfaceGDNative() {
- // testing
- printf("Construct gdnative interface\n");
+ print_verbose("Construct gdnative interface\n");
// we won't have our data pointer until our library gets set
data = NULL;
@@ -44,9 +48,9 @@ ARVRInterfaceGDNative::ARVRInterfaceGDNative() {
}
ARVRInterfaceGDNative::~ARVRInterfaceGDNative() {
- printf("Destruct gdnative interface\n");
+ print_verbose("Destruct gdnative interface\n");
- if (is_initialized()) {
+ if (interface != NULL && is_initialized()) {
uninitialize();
};
@@ -99,13 +103,10 @@ int ARVRInterfaceGDNative::get_capabilities() const {
}
bool ARVRInterfaceGDNative::get_anchor_detection_is_enabled() const {
- bool enabled;
ERR_FAIL_COND_V(interface == NULL, false);
- enabled = interface->get_anchor_detection_is_enabled(data);
-
- return enabled;
+ return interface->get_anchor_detection_is_enabled(data);
}
void ARVRInterfaceGDNative::set_anchor_detection_is_enabled(bool p_enable) {
@@ -137,21 +138,16 @@ bool ARVRInterfaceGDNative::is_stereo() {
}
bool ARVRInterfaceGDNative::is_initialized() const {
- bool initialized;
ERR_FAIL_COND_V(interface == NULL, false);
- initialized = interface->is_initialized(data);
-
- return initialized;
+ return interface->is_initialized(data);
}
bool ARVRInterfaceGDNative::initialize() {
- bool initialized;
-
ERR_FAIL_COND_V(interface == NULL, false);
- initialized = interface->initialize(data);
+ bool initialized = interface->initialize(data);
if (initialized) {
// if we successfully initialize our interface and we don't have a primary interface yet, this becomes our primary interface
diff --git a/modules/gdnative/arvr/arvr_interface_gdnative.h b/modules/gdnative/arvr/arvr_interface_gdnative.h
index 651e5c8715..ab7090876a 100644
--- a/modules/gdnative/arvr/arvr_interface_gdnative.h
+++ b/modules/gdnative/arvr/arvr_interface_gdnative.h
@@ -49,6 +49,8 @@ protected:
const godot_arvr_interface_gdnative *interface;
void *data;
+ static void _bind_methods();
+
public:
/** general interface information **/
ARVRInterfaceGDNative();
diff --git a/modules/gdnative/net/multiplayer_peer_gdnative.cpp b/modules/gdnative/net/multiplayer_peer_gdnative.cpp
index bdeba149d2..d2c95efa77 100644
--- a/modules/gdnative/net/multiplayer_peer_gdnative.cpp
+++ b/modules/gdnative/net/multiplayer_peer_gdnative.cpp
@@ -113,6 +113,8 @@ NetworkedMultiplayerPeer::ConnectionStatus MultiplayerPeerGDNative::get_connecti
}
void MultiplayerPeerGDNative::_bind_methods() {
+ ADD_PROPERTY_DEFAULT("transfer_mode", TRANSFER_MODE_UNRELIABLE);
+ ADD_PROPERTY_DEFAULT("refuse_new_connections", true);
}
extern "C" {
diff --git a/modules/webrtc/webrtc_data_channel_gdnative.cpp b/modules/webrtc/webrtc_data_channel_gdnative.cpp
index 4f33491af2..6362634626 100644
--- a/modules/webrtc/webrtc_data_channel_gdnative.cpp
+++ b/modules/webrtc/webrtc_data_channel_gdnative.cpp
@@ -35,6 +35,7 @@
#include "modules/gdnative/nativescript/nativescript.h"
void WebRTCDataChannelGDNative::_bind_methods() {
+ ADD_PROPERTY_DEFAULT("write_mode", WRITE_MODE_BINARY);
}
WebRTCDataChannelGDNative::WebRTCDataChannelGDNative() {