summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/base/classes.xml7
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp2
-rw-r--r--modules/visual_script/visual_script_builtin_funcs.cpp2
-rw-r--r--scene/main/scene_main_loop.cpp5
-rw-r--r--scene/main/scene_main_loop.h1
5 files changed, 15 insertions, 2 deletions
diff --git a/doc/base/classes.xml b/doc/base/classes.xml
index 4e4fb3cd23..17f45c64a2 100644
--- a/doc/base/classes.xml
+++ b/doc/base/classes.xml
@@ -35451,6 +35451,13 @@
Returns true if this SceneTree's [NetworkedMultiplayerPeer] is in server mode (listening for connections).
</description>
</method>
+ <method name="has_network_peer" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ Returns true if there is a [NetworkedMultiplayerPeer] set (with [method SceneTree.set_network_peer]).
+ </description>
+ </method>
<method name="is_paused" qualifiers="const">
<return type="bool">
</return>
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 73adeaf723..03a5834ca7 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -2806,7 +2806,7 @@ void RasterizerSceneGLES3::_copy_to_front_buffer(Environment *env) {
//no environment, simply convert from linear to srgb
storage->shaders.copy.set_conditional(CopyShaderGLES3::LINEAR_TO_SRGB,true);
} else {
- /* Why are both statements equal? */
+ /* FIXME: Why are both statements equal? */
storage->shaders.copy.set_conditional(CopyShaderGLES3::LINEAR_TO_SRGB,true);
}
diff --git a/modules/visual_script/visual_script_builtin_funcs.cpp b/modules/visual_script/visual_script_builtin_funcs.cpp
index 1acd5bff8d..f9780400d8 100644
--- a/modules/visual_script/visual_script_builtin_funcs.cpp
+++ b/modules/visual_script/visual_script_builtin_funcs.cpp
@@ -329,7 +329,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const
case LOGIC_CLAMP: {
if (p_idx==0)
return PropertyInfo(Variant::REAL,"a");
- else if (p_idx==0) // is it ok to test p_idx == 0 twice?
+ else if (p_idx==0) // FIXME: is it ok to test p_idx == 0 twice?
return PropertyInfo(Variant::REAL,"min");
else
return PropertyInfo(Variant::REAL,"max");
diff --git a/scene/main/scene_main_loop.cpp b/scene/main/scene_main_loop.cpp
index 418eb92ee2..093359ab16 100644
--- a/scene/main/scene_main_loop.cpp
+++ b/scene/main/scene_main_loop.cpp
@@ -1803,6 +1803,10 @@ bool SceneTree::is_network_server() const {
}
+bool SceneTree::has_network_peer() const {
+ return network_peer.is_valid();
+}
+
int SceneTree::get_network_unique_id() const {
ERR_FAIL_COND_V(!network_peer.is_valid(),0);
@@ -2310,6 +2314,7 @@ void SceneTree::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_network_peer","peer:NetworkedMultiplayerPeer"),&SceneTree::set_network_peer);
ClassDB::bind_method(D_METHOD("is_network_server"),&SceneTree::is_network_server);
+ ClassDB::bind_method(D_METHOD("has_network_peer"),&SceneTree::has_network_peer);
ClassDB::bind_method(D_METHOD("get_network_unique_id"),&SceneTree::get_network_unique_id);
ClassDB::bind_method(D_METHOD("set_refuse_new_network_connections","refuse"),&SceneTree::set_refuse_new_network_connections);
ClassDB::bind_method(D_METHOD("is_refusing_new_network_connections"),&SceneTree::is_refusing_new_network_connections);
diff --git a/scene/main/scene_main_loop.h b/scene/main/scene_main_loop.h
index fec8534b40..7f69f5eef7 100644
--- a/scene/main/scene_main_loop.h
+++ b/scene/main/scene_main_loop.h
@@ -447,6 +447,7 @@ public:
void set_network_peer(const Ref<NetworkedMultiplayerPeer>& p_network_peer);
bool is_network_server() const;
+ bool has_network_peer() const;
int get_network_unique_id() const;
void set_refuse_new_network_connections(bool p_refuse);