summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/csg/csg_shape.cpp4
-rw-r--r--modules/gridmap/doc_classes/GridMap.xml4
-rw-r--r--modules/gridmap/grid_map.cpp13
-rw-r--r--modules/gridmap/grid_map.h2
-rw-r--r--modules/noise/noise_texture_2d.cpp10
-rw-r--r--modules/noise/noise_texture_3d.cpp10
-rw-r--r--modules/noise/tests/test_noise_texture_2d.h8
-rw-r--r--modules/noise/tests/test_noise_texture_3d.h6
8 files changed, 27 insertions, 30 deletions
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp
index c241f1cabd..4c217dac28 100644
--- a/modules/csg/csg_shape.cpp
+++ b/modules/csg/csg_shape.cpp
@@ -953,12 +953,12 @@ void CSGMesh3D::set_mesh(const Ref<Mesh> &p_mesh) {
return;
}
if (mesh.is_valid()) {
- mesh->disconnect("changed", callable_mp(this, &CSGMesh3D::_mesh_changed));
+ mesh->disconnect_changed(callable_mp(this, &CSGMesh3D::_mesh_changed));
}
mesh = p_mesh;
if (mesh.is_valid()) {
- mesh->connect("changed", callable_mp(this, &CSGMesh3D::_mesh_changed));
+ mesh->connect_changed(callable_mp(this, &CSGMesh3D::_mesh_changed));
}
_mesh_changed();
diff --git a/modules/gridmap/doc_classes/GridMap.xml b/modules/gridmap/doc_classes/GridMap.xml
index 6973bd3cd8..f9c3ca476a 100644
--- a/modules/gridmap/doc_classes/GridMap.xml
+++ b/modules/gridmap/doc_classes/GridMap.xml
@@ -138,11 +138,11 @@
Returns the position of a grid cell in the GridMap's local coordinate space. To convert the returned value into global coordinates, use [method Node3D.to_global]. See also [method map_to_local].
</description>
</method>
- <method name="resource_changed">
+ <method name="resource_changed" is_deprecated="true">
<return type="void" />
<param index="0" name="resource" type="Resource" />
<description>
- Notifies the [GridMap] about changed resource and recreates octant data.
+ [i]Obsoleted.[/i] Use [signal Resource.changed] instead.
</description>
</method>
<method name="set_cell_item">
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp
index c77fa98be2..f1e2218434 100644
--- a/modules/gridmap/grid_map.cpp
+++ b/modules/gridmap/grid_map.cpp
@@ -258,11 +258,11 @@ RID GridMap::get_navigation_map() const {
void GridMap::set_mesh_library(const Ref<MeshLibrary> &p_mesh_library) {
if (!mesh_library.is_null()) {
- mesh_library->unregister_owner(this);
+ mesh_library->disconnect_changed(callable_mp(this, &GridMap::_recreate_octant_data));
}
mesh_library = p_mesh_library;
if (!mesh_library.is_null()) {
- mesh_library->register_owner(this);
+ mesh_library->connect_changed(callable_mp(this, &GridMap::_recreate_octant_data));
}
_recreate_octant_data();
@@ -1005,9 +1005,10 @@ void GridMap::clear() {
clear_baked_meshes();
}
+#ifndef DISABLE_DEPRECATED
void GridMap::resource_changed(const Ref<Resource> &p_res) {
- _recreate_octant_data();
}
+#endif
void GridMap::_update_octants_callback() {
if (!awaiting_update) {
@@ -1079,7 +1080,9 @@ void GridMap::_bind_methods() {
ClassDB::bind_method(D_METHOD("map_to_local", "map_position"), &GridMap::map_to_local);
ClassDB::bind_method(D_METHOD("_update_octants_callback"), &GridMap::_update_octants_callback);
+#ifndef DISABLE_DEPRECATED
ClassDB::bind_method(D_METHOD("resource_changed", "resource"), &GridMap::resource_changed);
+#endif
ClassDB::bind_method(D_METHOD("set_center_x", "enable"), &GridMap::set_center_x);
ClassDB::bind_method(D_METHOD("get_center_x"), &GridMap::get_center_x);
@@ -1336,10 +1339,6 @@ void GridMap::_navigation_map_changed(RID p_map) {
#endif // DEBUG_ENABLED
GridMap::~GridMap() {
- if (!mesh_library.is_null()) {
- mesh_library->unregister_owner(this);
- }
-
clear();
#ifdef DEBUG_ENABLED
NavigationServer3D::get_singleton()->disconnect("map_changed", callable_mp(this, &GridMap::_navigation_map_changed));
diff --git a/modules/gridmap/grid_map.h b/modules/gridmap/grid_map.h
index 18c3f90269..e05979efbc 100644
--- a/modules/gridmap/grid_map.h
+++ b/modules/gridmap/grid_map.h
@@ -203,7 +203,9 @@ class GridMap : public Node3D {
void _queue_octants_dirty();
void _update_octants_callback();
+#ifndef DISABLE_DEPRECATED
void resource_changed(const Ref<Resource> &p_res);
+#endif
void _clear_internal();
diff --git a/modules/noise/noise_texture_2d.cpp b/modules/noise/noise_texture_2d.cpp
index a7176e0816..1b0c5cb9e3 100644
--- a/modules/noise/noise_texture_2d.cpp
+++ b/modules/noise/noise_texture_2d.cpp
@@ -32,8 +32,6 @@
#include "noise.h"
-#include "core/core_string_names.h"
-
NoiseTexture2D::NoiseTexture2D() {
noise = Ref<Noise>();
@@ -223,11 +221,11 @@ void NoiseTexture2D::set_noise(Ref<Noise> p_noise) {
return;
}
if (noise.is_valid()) {
- noise->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &NoiseTexture2D::_queue_update));
+ noise->disconnect_changed(callable_mp(this, &NoiseTexture2D::_queue_update));
}
noise = p_noise;
if (noise.is_valid()) {
- noise->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &NoiseTexture2D::_queue_update));
+ noise->connect_changed(callable_mp(this, &NoiseTexture2D::_queue_update));
}
_queue_update();
}
@@ -347,11 +345,11 @@ void NoiseTexture2D::set_color_ramp(const Ref<Gradient> &p_gradient) {
return;
}
if (color_ramp.is_valid()) {
- color_ramp->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &NoiseTexture2D::_queue_update));
+ color_ramp->disconnect_changed(callable_mp(this, &NoiseTexture2D::_queue_update));
}
color_ramp = p_gradient;
if (color_ramp.is_valid()) {
- color_ramp->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &NoiseTexture2D::_queue_update));
+ color_ramp->connect_changed(callable_mp(this, &NoiseTexture2D::_queue_update));
}
_queue_update();
}
diff --git a/modules/noise/noise_texture_3d.cpp b/modules/noise/noise_texture_3d.cpp
index f6c67b0f2d..ed242e7faa 100644
--- a/modules/noise/noise_texture_3d.cpp
+++ b/modules/noise/noise_texture_3d.cpp
@@ -32,8 +32,6 @@
#include "noise.h"
-#include "core/core_string_names.h"
-
NoiseTexture3D::NoiseTexture3D() {
noise = Ref<Noise>();
@@ -214,11 +212,11 @@ void NoiseTexture3D::set_noise(Ref<Noise> p_noise) {
return;
}
if (noise.is_valid()) {
- noise->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &NoiseTexture3D::_queue_update));
+ noise->disconnect_changed(callable_mp(this, &NoiseTexture3D::_queue_update));
}
noise = p_noise;
if (noise.is_valid()) {
- noise->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &NoiseTexture3D::_queue_update));
+ noise->connect_changed(callable_mp(this, &NoiseTexture3D::_queue_update));
}
_queue_update();
}
@@ -297,11 +295,11 @@ void NoiseTexture3D::set_color_ramp(const Ref<Gradient> &p_gradient) {
return;
}
if (color_ramp.is_valid()) {
- color_ramp->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &NoiseTexture3D::_queue_update));
+ color_ramp->disconnect_changed(callable_mp(this, &NoiseTexture3D::_queue_update));
}
color_ramp = p_gradient;
if (color_ramp.is_valid()) {
- color_ramp->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &NoiseTexture3D::_queue_update));
+ color_ramp->connect_changed(callable_mp(this, &NoiseTexture3D::_queue_update));
}
_queue_update();
}
diff --git a/modules/noise/tests/test_noise_texture_2d.h b/modules/noise/tests/test_noise_texture_2d.h
index e2ec39ef48..938e8fd6ab 100644
--- a/modules/noise/tests/test_noise_texture_2d.h
+++ b/modules/noise/tests/test_noise_texture_2d.h
@@ -210,7 +210,7 @@ TEST_CASE("[NoiseTexture2D][SceneTree] Generating a basic noise texture with mip
noise_texture->set_generate_mipmaps(true);
Ref<NoiseTextureTester> tester = memnew(NoiseTextureTester(noise_texture.ptr()));
- noise_texture->connect("changed", callable_mp(tester.ptr(), &NoiseTextureTester::check_mip_and_color_ramp));
+ noise_texture->connect_changed(callable_mp(tester.ptr(), &NoiseTextureTester::check_mip_and_color_ramp));
MessageQueue::get_singleton()->flush();
}
@@ -227,7 +227,7 @@ TEST_CASE("[NoiseTexture2D][SceneTree] Generating a normal map without mipmaps")
noise_texture->set_generate_mipmaps(false);
Ref<NoiseTextureTester> tester = memnew(NoiseTextureTester(noise_texture.ptr()));
- noise_texture->connect("changed", callable_mp(tester.ptr(), &NoiseTextureTester::check_normal_map));
+ noise_texture->connect_changed(callable_mp(tester.ptr(), &NoiseTextureTester::check_normal_map));
MessageQueue::get_singleton()->flush();
}
@@ -245,7 +245,7 @@ TEST_CASE("[NoiseTexture2D][SceneTree] Generating a seamless noise texture") {
SUBCASE("Grayscale(L8) 16x16, with seamless blend skirt of 0.05") {
noise_texture->set_seamless_blend_skirt(0.05);
- noise_texture->connect("changed", callable_mp(tester.ptr(), &NoiseTextureTester::check_seamless_texture_grayscale));
+ noise_texture->connect_changed(callable_mp(tester.ptr(), &NoiseTextureTester::check_seamless_texture_grayscale));
MessageQueue::get_singleton()->flush();
}
@@ -257,7 +257,7 @@ TEST_CASE("[NoiseTexture2D][SceneTree] Generating a seamless noise texture") {
gradient->set_points(points);
noise_texture->set_color_ramp(gradient);
noise_texture->set_seamless_blend_skirt(1.0);
- noise_texture->connect("changed", callable_mp(tester.ptr(), &NoiseTextureTester::check_seamless_texture_rgba));
+ noise_texture->connect_changed(callable_mp(tester.ptr(), &NoiseTextureTester::check_seamless_texture_rgba));
MessageQueue::get_singleton()->flush();
}
}
diff --git a/modules/noise/tests/test_noise_texture_3d.h b/modules/noise/tests/test_noise_texture_3d.h
index a612f2920a..b708eac43b 100644
--- a/modules/noise/tests/test_noise_texture_3d.h
+++ b/modules/noise/tests/test_noise_texture_3d.h
@@ -194,7 +194,7 @@ TEST_CASE("[NoiseTexture3D][SceneTree] Generating a basic noise texture with mip
noise_texture->set_depth(16);
Ref<NoiseTexture3DTester> tester = memnew(NoiseTexture3DTester(noise_texture.ptr()));
- noise_texture->connect("changed", callable_mp(tester.ptr(), &NoiseTexture3DTester::check_mip_and_color_ramp));
+ noise_texture->connect_changed(callable_mp(tester.ptr(), &NoiseTexture3DTester::check_mip_and_color_ramp));
MessageQueue::get_singleton()->flush();
}
@@ -213,7 +213,7 @@ TEST_CASE("[NoiseTexture3D][SceneTree] Generating a seamless noise texture") {
SUBCASE("Grayscale(L8) 16x16x16, with seamless blend skirt of 0.05") {
noise_texture->set_seamless_blend_skirt(0.05);
- noise_texture->connect("changed", callable_mp(tester.ptr(), &NoiseTexture3DTester::check_seamless_texture_grayscale));
+ noise_texture->connect_changed(callable_mp(tester.ptr(), &NoiseTexture3DTester::check_seamless_texture_grayscale));
MessageQueue::get_singleton()->flush();
}
@@ -225,7 +225,7 @@ TEST_CASE("[NoiseTexture3D][SceneTree] Generating a seamless noise texture") {
gradient->set_points(points);
noise_texture->set_color_ramp(gradient);
noise_texture->set_seamless_blend_skirt(1.0);
- noise_texture->connect("changed", callable_mp(tester.ptr(), &NoiseTexture3DTester::check_seamless_texture_rgba));
+ noise_texture->connect_changed(callable_mp(tester.ptr(), &NoiseTexture3DTester::check_seamless_texture_rgba));
MessageQueue::get_singleton()->flush();
}
}