summaryrefslogtreecommitdiffstats
path: root/scene/2d
diff options
context:
space:
mode:
authorGeorge L. Albany <Megacake1234@gmail.com>2024-11-06 11:06:08 +0000
committerGitHub <noreply@github.com>2024-11-06 11:06:08 +0000
commite7894c2c4efdd51049a21af4892005381fe57cd6 (patch)
tree849c2d29b6fb90100f31de20340d5f0ef4238edf /scene/2d
parentd14f2a31558686f00c4f351ea659918576711a7a (diff)
parentb8b8a7127e3040582c5937fd2dff4c99e94a3b57 (diff)
downloadredot-engine-e7894c2c4efdd51049a21af4892005381fe57cd6.tar.gz
Merge pull request #843 from Spartan322/merge/87318a2
Merge commit godotengine/godot@87318a2
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/animated_sprite_2d.cpp6
-rw-r--r--scene/2d/animated_sprite_2d.h9
-rw-r--r--scene/2d/back_buffer_copy.cpp4
-rw-r--r--scene/2d/back_buffer_copy.h4
-rw-r--r--scene/2d/light_2d.cpp7
-rw-r--r--scene/2d/light_2d.h5
-rw-r--r--scene/2d/light_occluder_2d.cpp14
-rw-r--r--scene/2d/light_occluder_2d.h9
-rw-r--r--scene/2d/line_2d.cpp2
-rw-r--r--scene/2d/line_2d.h2
-rw-r--r--scene/2d/marker_2d.cpp4
-rw-r--r--scene/2d/marker_2d.h4
-rw-r--r--scene/2d/mesh_instance_2d.cpp4
-rw-r--r--scene/2d/mesh_instance_2d.h4
-rw-r--r--scene/2d/multimesh_instance_2d.cpp4
-rw-r--r--scene/2d/multimesh_instance_2d.h4
-rw-r--r--scene/2d/navigation_link_2d.cpp4
-rw-r--r--scene/2d/navigation_link_2d.h4
-rw-r--r--scene/2d/navigation_region_2d.cpp4
-rw-r--r--scene/2d/navigation_region_2d.h4
-rw-r--r--scene/2d/path_2d.cpp2
-rw-r--r--scene/2d/path_2d.h2
-rw-r--r--scene/2d/physics/collision_polygon_2d.cpp2
-rw-r--r--scene/2d/physics/collision_polygon_2d.h2
-rw-r--r--scene/2d/physics/collision_shape_2d.h4
-rw-r--r--scene/2d/polygon_2d.cpp4
-rw-r--r--scene/2d/polygon_2d.h5
-rw-r--r--scene/2d/sprite_2d.cpp4
-rw-r--r--scene/2d/sprite_2d.h5
-rw-r--r--scene/2d/tile_map.cpp16
-rw-r--r--scene/2d/tile_map.h8
-rw-r--r--scene/2d/touch_screen_button.cpp4
-rw-r--r--scene/2d/touch_screen_button.h4
-rw-r--r--scene/2d/visible_on_screen_notifier_2d.cpp4
-rw-r--r--scene/2d/visible_on_screen_notifier_2d.h4
35 files changed, 95 insertions, 77 deletions
diff --git a/scene/2d/animated_sprite_2d.cpp b/scene/2d/animated_sprite_2d.cpp
index adc12be14e..8473d8a61d 100644
--- a/scene/2d/animated_sprite_2d.cpp
+++ b/scene/2d/animated_sprite_2d.cpp
@@ -58,7 +58,9 @@ Point2 AnimatedSprite2D::_edit_get_pivot() const {
bool AnimatedSprite2D::_edit_use_pivot() const {
return true;
}
+#endif // TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
Rect2 AnimatedSprite2D::_edit_get_rect() const {
return _get_rect();
}
@@ -77,7 +79,7 @@ bool AnimatedSprite2D::_edit_use_rect() const {
}
return t.is_valid();
}
-#endif
+#endif // DEBUG_ENABLED
Rect2 AnimatedSprite2D::get_anchorable_rect() const {
return _get_rect();
@@ -595,7 +597,7 @@ void AnimatedSprite2D::get_argument_options(const StringName &p_function, int p_
}
Node2D::get_argument_options(p_function, p_idx, r_options);
}
-#endif
+#endif // TOOLS_ENABLED
#ifndef DISABLE_DEPRECATED
bool AnimatedSprite2D::_set(const StringName &p_name, const Variant &p_value) {
diff --git a/scene/2d/animated_sprite_2d.h b/scene/2d/animated_sprite_2d.h
index f3adc621d4..295cf23c6b 100644
--- a/scene/2d/animated_sprite_2d.h
+++ b/scene/2d/animated_sprite_2d.h
@@ -68,7 +68,7 @@ class AnimatedSprite2D : public Node2D {
protected:
#ifndef DISABLE_DEPRECATED
bool _set(const StringName &p_name, const Variant &p_value);
-#endif
+#endif // DISABLE_DEPRECATED
static void _bind_methods();
void _notification(int p_what);
void _validate_property(PropertyInfo &p_property) const;
@@ -81,9 +81,12 @@ public:
virtual void _edit_set_pivot(const Point2 &p_pivot) override;
virtual Point2 _edit_get_pivot() const override;
virtual bool _edit_use_pivot() const override;
+#endif // TOOLS_ENABLED
+
+#ifdef DEBUG_ENABLED
virtual Rect2 _edit_get_rect() const override;
virtual bool _edit_use_rect() const override;
-#endif
+#endif // DEBUG_ENABLED
virtual Rect2 get_anchorable_rect() const override;
@@ -131,7 +134,7 @@ public:
#ifdef TOOLS_ENABLED
virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override;
-#endif
+#endif // TOOLS_ENABLED
AnimatedSprite2D();
};
diff --git a/scene/2d/back_buffer_copy.cpp b/scene/2d/back_buffer_copy.cpp
index f9d200c9d0..f69da09b82 100644
--- a/scene/2d/back_buffer_copy.cpp
+++ b/scene/2d/back_buffer_copy.cpp
@@ -47,7 +47,7 @@ void BackBufferCopy::_update_copy_mode() {
}
}
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
Rect2 BackBufferCopy::_edit_get_rect() const {
return rect;
}
@@ -55,7 +55,7 @@ Rect2 BackBufferCopy::_edit_get_rect() const {
bool BackBufferCopy::_edit_use_rect() const {
return true;
}
-#endif
+#endif // DEBUG_ENABLED
Rect2 BackBufferCopy::get_anchorable_rect() const {
return rect;
diff --git a/scene/2d/back_buffer_copy.h b/scene/2d/back_buffer_copy.h
index 8cc426bd34..c07836049b 100644
--- a/scene/2d/back_buffer_copy.h
+++ b/scene/2d/back_buffer_copy.h
@@ -56,10 +56,10 @@ protected:
void _validate_property(PropertyInfo &p_property) const;
public:
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
Rect2 _edit_get_rect() const override;
virtual bool _edit_use_rect() const override;
-#endif
+#endif // DEBUG_ENABLED
void set_rect(const Rect2 &p_rect);
Rect2 get_rect() const;
diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp
index 94fc1c5ff2..ce35aebd71 100644
--- a/scene/2d/light_2d.cpp
+++ b/scene/2d/light_2d.cpp
@@ -56,7 +56,7 @@ void Light2D::_update_light_visibility() {
if (editor_only) {
editor_ok = false;
}
-#endif
+#endif // TOOLS_ENABLED
RS::get_singleton()->canvas_light_set_enabled(canvas_light, enabled && is_visible_in_tree() && editor_ok);
}
@@ -345,7 +345,6 @@ Light2D::~Light2D() {
//////////////////////////////
#ifdef TOOLS_ENABLED
-
Dictionary PointLight2D::_edit_get_state() const {
Dictionary state = Node2D::_edit_get_state();
state["offset"] = get_texture_offset();
@@ -369,7 +368,9 @@ Point2 PointLight2D::_edit_get_pivot() const {
bool PointLight2D::_edit_use_pivot() const {
return true;
}
+#endif // TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
Rect2 PointLight2D::_edit_get_rect() const {
if (texture.is_null()) {
return Rect2();
@@ -382,7 +383,7 @@ Rect2 PointLight2D::_edit_get_rect() const {
bool PointLight2D::_edit_use_rect() const {
return !texture.is_null();
}
-#endif
+#endif // DEBUG_ENABLED
Rect2 PointLight2D::get_anchorable_rect() const {
if (texture.is_null()) {
diff --git a/scene/2d/light_2d.h b/scene/2d/light_2d.h
index 9eec41c69b..d812c49788 100644
--- a/scene/2d/light_2d.h
+++ b/scene/2d/light_2d.h
@@ -162,9 +162,12 @@ public:
virtual void _edit_set_pivot(const Point2 &p_pivot) override;
virtual Point2 _edit_get_pivot() const override;
virtual bool _edit_use_pivot() const override;
+#endif // TOOLS_ENABLED
+
+#ifdef DEBUG_ENABLED
virtual Rect2 _edit_get_rect() const override;
virtual bool _edit_use_rect() const override;
-#endif
+#endif // DEBUG_ENABLED
virtual Rect2 get_anchorable_rect() const override;
diff --git a/scene/2d/light_occluder_2d.cpp b/scene/2d/light_occluder_2d.cpp
index 77f181b28a..6bc2916c4a 100644
--- a/scene/2d/light_occluder_2d.cpp
+++ b/scene/2d/light_occluder_2d.cpp
@@ -37,7 +37,7 @@
#define LINE_GRAB_WIDTH 8
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
Rect2 OccluderPolygon2D::_edit_get_rect() const {
if (rect_cache_dirty) {
if (closed) {
@@ -85,7 +85,7 @@ bool OccluderPolygon2D::_edit_is_selected_on_click(const Point2 &p_point, double
return false;
}
}
-#endif
+#endif // DEBUG_ENABLED
void OccluderPolygon2D::set_polygon(const Vector<Vector2> &p_polygon) {
polygon = p_polygon;
@@ -158,7 +158,7 @@ OccluderPolygon2D::~OccluderPolygon2D() {
void LightOccluder2D::_poly_changed() {
#ifdef DEBUG_ENABLED
queue_redraw();
-#endif
+#endif // DEBUG_ENABLED
}
void LightOccluder2D::_physics_interpolated_changed() {
@@ -220,7 +220,7 @@ void LightOccluder2D::_notification(int p_what) {
}
}
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
Rect2 LightOccluder2D::_edit_get_rect() const {
return occluder_polygon.is_valid() ? occluder_polygon->_edit_get_rect() : Rect2();
}
@@ -228,14 +228,14 @@ Rect2 LightOccluder2D::_edit_get_rect() const {
bool LightOccluder2D::_edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const {
return occluder_polygon.is_valid() ? occluder_polygon->_edit_is_selected_on_click(p_point, p_tolerance) : false;
}
-#endif
+#endif // DEBUG_ENABLED
void LightOccluder2D::set_occluder_polygon(const Ref<OccluderPolygon2D> &p_polygon) {
#ifdef DEBUG_ENABLED
if (occluder_polygon.is_valid()) {
occluder_polygon->disconnect_changed(callable_mp(this, &LightOccluder2D::_poly_changed));
}
-#endif
+#endif // DEBUG_ENABLED
occluder_polygon = p_polygon;
if (occluder_polygon.is_valid()) {
@@ -249,7 +249,7 @@ void LightOccluder2D::set_occluder_polygon(const Ref<OccluderPolygon2D> &p_polyg
occluder_polygon->connect_changed(callable_mp(this, &LightOccluder2D::_poly_changed));
}
queue_redraw();
-#endif
+#endif // DEBUG_ENABLED
}
Ref<OccluderPolygon2D> LightOccluder2D::get_occluder_polygon() const {
diff --git a/scene/2d/light_occluder_2d.h b/scene/2d/light_occluder_2d.h
index 6855307606..996c0e70d7 100644
--- a/scene/2d/light_occluder_2d.h
+++ b/scene/2d/light_occluder_2d.h
@@ -58,11 +58,10 @@ protected:
static void _bind_methods();
public:
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
virtual Rect2 _edit_get_rect() const;
virtual bool _edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const;
-#endif
-
+#endif // DEBUG_ENABLED
void set_polygon(const Vector<Vector2> &p_polygon);
Vector<Vector2> get_polygon() const;
@@ -95,10 +94,10 @@ protected:
static void _bind_methods();
public:
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
virtual Rect2 _edit_get_rect() const override;
virtual bool _edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const override;
-#endif
+#endif // DEBUG_ENABLED
void set_occluder_polygon(const Ref<OccluderPolygon2D> &p_polygon);
Ref<OccluderPolygon2D> get_occluder_polygon() const;
diff --git a/scene/2d/line_2d.cpp b/scene/2d/line_2d.cpp
index a7df39af34..643d60b7ba 100644
--- a/scene/2d/line_2d.cpp
+++ b/scene/2d/line_2d.cpp
@@ -38,7 +38,7 @@
Line2D::Line2D() {
}
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
Rect2 Line2D::_edit_get_rect() const {
if (_points.size() == 0) {
return Rect2(0, 0, 0, 0);
diff --git a/scene/2d/line_2d.h b/scene/2d/line_2d.h
index 0a37a4e8e5..8c527ed906 100644
--- a/scene/2d/line_2d.h
+++ b/scene/2d/line_2d.h
@@ -57,7 +57,7 @@ public:
LINE_TEXTURE_STRETCH
};
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
virtual Rect2 _edit_get_rect() const override;
virtual bool _edit_use_rect() const override;
virtual bool _edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const override;
diff --git a/scene/2d/marker_2d.cpp b/scene/2d/marker_2d.cpp
index a7fe235fe1..e187f36e52 100644
--- a/scene/2d/marker_2d.cpp
+++ b/scene/2d/marker_2d.cpp
@@ -63,7 +63,7 @@ void Marker2D::_draw_cross() {
draw_multiline_colors(points, colors);
}
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
Rect2 Marker2D::_edit_get_rect() const {
real_t extents = get_gizmo_extents();
return Rect2(Point2(-extents, -extents), Size2(extents * 2, extents * 2));
@@ -72,7 +72,7 @@ Rect2 Marker2D::_edit_get_rect() const {
bool Marker2D::_edit_use_rect() const {
return false;
}
-#endif
+#endif // DEBUG_ENABLED
void Marker2D::_notification(int p_what) {
switch (p_what) {
diff --git a/scene/2d/marker_2d.h b/scene/2d/marker_2d.h
index 4c6351591b..a408185b61 100644
--- a/scene/2d/marker_2d.h
+++ b/scene/2d/marker_2d.h
@@ -47,10 +47,10 @@ protected:
static void _bind_methods();
public:
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
virtual Rect2 _edit_get_rect() const override;
virtual bool _edit_use_rect() const override;
-#endif
+#endif // DEBUG_ENABLED
void set_gizmo_extents(real_t p_extents);
real_t get_gizmo_extents() const;
diff --git a/scene/2d/mesh_instance_2d.cpp b/scene/2d/mesh_instance_2d.cpp
index aa28bb2908..a30e1576bf 100644
--- a/scene/2d/mesh_instance_2d.cpp
+++ b/scene/2d/mesh_instance_2d.cpp
@@ -90,7 +90,7 @@ Ref<Texture2D> MeshInstance2D::get_texture() const {
return texture;
}
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
Rect2 MeshInstance2D::_edit_get_rect() const {
if (mesh.is_valid()) {
AABB aabb = mesh->get_aabb();
@@ -103,7 +103,7 @@ Rect2 MeshInstance2D::_edit_get_rect() const {
bool MeshInstance2D::_edit_use_rect() const {
return mesh.is_valid();
}
-#endif
+#endif // DEBUG_ENABLED
MeshInstance2D::MeshInstance2D() {
}
diff --git a/scene/2d/mesh_instance_2d.h b/scene/2d/mesh_instance_2d.h
index 14260ac75c..1166dff4e0 100644
--- a/scene/2d/mesh_instance_2d.h
+++ b/scene/2d/mesh_instance_2d.h
@@ -47,10 +47,10 @@ protected:
static void _bind_methods();
public:
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
virtual Rect2 _edit_get_rect() const override;
virtual bool _edit_use_rect() const override;
-#endif
+#endif // DEBUG_ENABLED
void set_mesh(const Ref<Mesh> &p_mesh);
Ref<Mesh> get_mesh() const;
diff --git a/scene/2d/multimesh_instance_2d.cpp b/scene/2d/multimesh_instance_2d.cpp
index 078e7e52d1..2ab5612cff 100644
--- a/scene/2d/multimesh_instance_2d.cpp
+++ b/scene/2d/multimesh_instance_2d.cpp
@@ -86,7 +86,7 @@ Ref<Texture2D> MultiMeshInstance2D::get_texture() const {
return texture;
}
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
Rect2 MultiMeshInstance2D::_edit_get_rect() const {
if (multimesh.is_valid()) {
AABB aabb = multimesh->get_aabb();
@@ -95,7 +95,7 @@ Rect2 MultiMeshInstance2D::_edit_get_rect() const {
return Node2D::_edit_get_rect();
}
-#endif
+#endif // DEBUG_ENABLED
MultiMeshInstance2D::MultiMeshInstance2D() {
}
diff --git a/scene/2d/multimesh_instance_2d.h b/scene/2d/multimesh_instance_2d.h
index f4bbda30b4..dd3c6d2256 100644
--- a/scene/2d/multimesh_instance_2d.h
+++ b/scene/2d/multimesh_instance_2d.h
@@ -48,9 +48,9 @@ protected:
static void _bind_methods();
public:
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
virtual Rect2 _edit_get_rect() const override;
-#endif
+#endif // DEBUG_ENABLED
void set_multimesh(const Ref<MultiMesh> &p_multimesh);
Ref<MultiMesh> get_multimesh() const;
diff --git a/scene/2d/navigation_link_2d.cpp b/scene/2d/navigation_link_2d.cpp
index 4872c696b4..c8f1e5c192 100644
--- a/scene/2d/navigation_link_2d.cpp
+++ b/scene/2d/navigation_link_2d.cpp
@@ -134,7 +134,7 @@ void NavigationLink2D::_notification(int p_what) {
}
}
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
Rect2 NavigationLink2D::_edit_get_rect() const {
if (!is_inside_tree()) {
return Rect2();
@@ -154,7 +154,7 @@ bool NavigationLink2D::_edit_is_selected_on_click(const Point2 &p_point, double
Vector2 closest_point = Geometry2D::get_closest_point_to_segment(p_point, segment);
return p_point.distance_to(closest_point) < p_tolerance;
}
-#endif // TOOLS_ENABLED
+#endif // DEBUG_ENABLED
RID NavigationLink2D::get_rid() const {
return link;
diff --git a/scene/2d/navigation_link_2d.h b/scene/2d/navigation_link_2d.h
index 446850574a..d6826353d2 100644
--- a/scene/2d/navigation_link_2d.h
+++ b/scene/2d/navigation_link_2d.h
@@ -64,10 +64,10 @@ protected:
#endif // DISABLE_DEPRECATED
public:
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
virtual Rect2 _edit_get_rect() const override;
virtual bool _edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const override;
-#endif
+#endif // DEBUG_ENABLED
RID get_rid() const;
void set_enabled(bool p_enabled);
diff --git a/scene/2d/navigation_region_2d.cpp b/scene/2d/navigation_region_2d.cpp
index 01349b2618..cf28fd2227 100644
--- a/scene/2d/navigation_region_2d.cpp
+++ b/scene/2d/navigation_region_2d.cpp
@@ -144,7 +144,7 @@ RID NavigationRegion2D::get_region_rid() const {
return get_rid();
}
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
Rect2 NavigationRegion2D::_edit_get_rect() const {
return navigation_polygon.is_valid() ? navigation_polygon->_edit_get_rect() : Rect2();
}
@@ -152,7 +152,7 @@ Rect2 NavigationRegion2D::_edit_get_rect() const {
bool NavigationRegion2D::_edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const {
return navigation_polygon.is_valid() ? navigation_polygon->_edit_is_selected_on_click(p_point, p_tolerance) : false;
}
-#endif
+#endif // DEBUG_ENABLED
void NavigationRegion2D::_notification(int p_what) {
switch (p_what) {
diff --git a/scene/2d/navigation_region_2d.h b/scene/2d/navigation_region_2d.h
index e57e4de26d..7c27524fa9 100644
--- a/scene/2d/navigation_region_2d.h
+++ b/scene/2d/navigation_region_2d.h
@@ -77,10 +77,10 @@ protected:
#endif // DISABLE_DEPRECATED
public:
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
virtual Rect2 _edit_get_rect() const override;
virtual bool _edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const override;
-#endif
+#endif // DEBUG_ENABLED
RID get_rid() const;
void set_enabled(bool p_enabled);
diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp
index c1fbd46d16..e89d963c3a 100644
--- a/scene/2d/path_2d.cpp
+++ b/scene/2d/path_2d.cpp
@@ -39,7 +39,7 @@
#include "editor/themes/editor_scale.h"
#endif
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
Rect2 Path2D::_edit_get_rect() const {
if (!curve.is_valid() || curve->get_point_count() == 0) {
return Rect2(0, 0, 0, 0);
diff --git a/scene/2d/path_2d.h b/scene/2d/path_2d.h
index 71229af2d8..39f63d8784 100644
--- a/scene/2d/path_2d.h
+++ b/scene/2d/path_2d.h
@@ -50,7 +50,7 @@ protected:
static void _bind_methods();
public:
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
virtual Rect2 _edit_get_rect() const override;
virtual bool _edit_use_rect() const override;
virtual bool _edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const override;
diff --git a/scene/2d/physics/collision_polygon_2d.cpp b/scene/2d/physics/collision_polygon_2d.cpp
index a2fb3b0f9f..1afbe8c960 100644
--- a/scene/2d/physics/collision_polygon_2d.cpp
+++ b/scene/2d/physics/collision_polygon_2d.cpp
@@ -219,7 +219,7 @@ CollisionPolygon2D::BuildMode CollisionPolygon2D::get_build_mode() const {
return build_mode;
}
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
Rect2 CollisionPolygon2D::_edit_get_rect() const {
return aabb;
}
diff --git a/scene/2d/physics/collision_polygon_2d.h b/scene/2d/physics/collision_polygon_2d.h
index 1eb52c3ea5..7754960fa7 100644
--- a/scene/2d/physics/collision_polygon_2d.h
+++ b/scene/2d/physics/collision_polygon_2d.h
@@ -67,7 +67,7 @@ protected:
static void _bind_methods();
public:
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
virtual Rect2 _edit_get_rect() const override;
virtual bool _edit_use_rect() const override;
virtual bool _edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const override;
diff --git a/scene/2d/physics/collision_shape_2d.h b/scene/2d/physics/collision_shape_2d.h
index e5f022934a..80916b0726 100644
--- a/scene/2d/physics/collision_shape_2d.h
+++ b/scene/2d/physics/collision_shape_2d.h
@@ -61,11 +61,11 @@ protected:
static void _bind_methods();
public:
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
virtual bool _edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const override;
#else
virtual bool _edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const;
-#endif // TOOLS_ENABLED
+#endif // DEBUG_ENABLED
void set_shape(const Ref<Shape2D> &p_shape);
Ref<Shape2D> get_shape() const;
diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp
index 6a73e180e5..a2026179a6 100644
--- a/scene/2d/polygon_2d.cpp
+++ b/scene/2d/polygon_2d.cpp
@@ -59,7 +59,9 @@ Point2 Polygon2D::_edit_get_pivot() const {
bool Polygon2D::_edit_use_pivot() const {
return true;
}
+#endif // TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
Rect2 Polygon2D::_edit_get_rect() const {
if (rect_cache_dirty) {
int l = polygon.size();
@@ -90,7 +92,7 @@ bool Polygon2D::_edit_is_selected_on_click(const Point2 &p_point, double p_toler
}
return Geometry2D::is_point_in_polygon(p_point - get_offset(), polygon2d);
}
-#endif
+#endif // DEBUG_ENABLED
void Polygon2D::_validate_property(PropertyInfo &p_property) const {
if (!invert && p_property.name == "invert_border") {
diff --git a/scene/2d/polygon_2d.h b/scene/2d/polygon_2d.h
index 4b65511a14..d5fd5b772b 100644
--- a/scene/2d/polygon_2d.h
+++ b/scene/2d/polygon_2d.h
@@ -89,11 +89,14 @@ public:
virtual void _edit_set_pivot(const Point2 &p_pivot) override;
virtual Point2 _edit_get_pivot() const override;
virtual bool _edit_use_pivot() const override;
+#endif // TOOLS_ENABLED
+
+#ifdef DEBUG_ENABLED
virtual Rect2 _edit_get_rect() const override;
virtual bool _edit_use_rect() const override;
virtual bool _edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const override;
-#endif
+#endif // DEBUG_ENABLED
void set_polygon(const Vector<Vector2> &p_polygon);
Vector<Vector2> get_polygon() const;
diff --git a/scene/2d/sprite_2d.cpp b/scene/2d/sprite_2d.cpp
index 90775a2e2d..b50476e6f7 100644
--- a/scene/2d/sprite_2d.cpp
+++ b/scene/2d/sprite_2d.cpp
@@ -58,7 +58,9 @@ Point2 Sprite2D::_edit_get_pivot() const {
bool Sprite2D::_edit_use_pivot() const {
return true;
}
+#endif // TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
bool Sprite2D::_edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const {
return is_pixel_opaque(p_point);
}
@@ -70,7 +72,7 @@ Rect2 Sprite2D::_edit_get_rect() const {
bool Sprite2D::_edit_use_rect() const {
return texture.is_valid();
}
-#endif
+#endif // DEBUG_ENABLED
Rect2 Sprite2D::get_anchorable_rect() const {
return get_rect();
diff --git a/scene/2d/sprite_2d.h b/scene/2d/sprite_2d.h
index ae20038055..3aa687ce80 100644
--- a/scene/2d/sprite_2d.h
+++ b/scene/2d/sprite_2d.h
@@ -76,11 +76,14 @@ public:
virtual void _edit_set_pivot(const Point2 &p_pivot) override;
virtual Point2 _edit_get_pivot() const override;
virtual bool _edit_use_pivot() const override;
+#endif // TOOLS_ENABLED
+
+#ifdef DEBUG_ENABLED
virtual bool _edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const override;
virtual Rect2 _edit_get_rect() const override;
virtual bool _edit_use_rect() const override;
-#endif
+#endif // DEBUG_ENABLED
bool is_pixel_opaque(const Point2 &p_point) const;
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index 2b6ce77979..cb66cfe3b5 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -91,8 +91,8 @@ void TileMap::_set_tile_map_data_using_compatibility_format(int p_layer, TileMap
SWAP(local[8], local[11]);
SWAP(local[9], local[10]);
}
-#endif
- // Extracts position in TileMap.
+#endif // BIG_ENDIAN_ENABLED
+ // Extracts position in TileMap.
int16_t x = decode_uint16(&local[0]);
int16_t y = decode_uint16(&local[2]);
@@ -174,7 +174,7 @@ void TileMap::_notification(int p_what) {
bool in_editor = false;
#ifdef TOOLS_ENABLED
in_editor = Engine::get_singleton()->is_editor_hint();
-#endif
+#endif // TOOLS_ENABLED
if (is_inside_tree() && collision_animatable && !in_editor) {
// Update transform on the physics tick when in animatable mode.
last_valid_transform = new_transform;
@@ -190,7 +190,7 @@ void TileMap::_notification(int p_what) {
bool in_editor = false;
#ifdef TOOLS_ENABLED
in_editor = Engine::get_singleton()->is_editor_hint();
-#endif
+#endif // TOOLS_ENABLED
if (is_inside_tree() && collision_animatable && !in_editor) {
// Store last valid transform.
@@ -211,7 +211,7 @@ void TileMap::force_update(int p_layer) {
notify_runtime_tile_data_update(p_layer);
update_internals();
}
-#endif
+#endif // DISABLE_DEPRECATED
void TileMap::set_rendering_quadrant_size(int p_size) {
ERR_FAIL_COND_MSG(p_size < 1, "TileMapQuadrant size cannot be smaller than 1.");
@@ -651,7 +651,7 @@ void TileMap::notify_runtime_tile_data_update(int p_layer) {
}
}
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
Rect2 TileMap::_edit_get_rect() const {
// Return the visible rect of the tilemap.
if (layers.is_empty()) {
@@ -669,7 +669,7 @@ Rect2 TileMap::_edit_get_rect() const {
const_cast<TileMap *>(this)->item_rect_changed(any_changed);
return rect;
}
-#endif
+#endif // DEBUG_ENABLED
bool TileMap::_set(const StringName &p_name, const Variant &p_value) {
int index;
@@ -728,7 +728,7 @@ bool TileMap::_get(const StringName &p_name, Variant &r_ret) const {
r_ret = get_rendering_quadrant_size();
return true;
}
-#endif
+#endif // DISABLE_DEPRECATED
else {
return property_helper.property_get_value(sname, r_ret);
}
diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h
index fb3e56622e..7783eba508 100644
--- a/scene/2d/tile_map.h
+++ b/scene/2d/tile_map.h
@@ -109,16 +109,16 @@ protected:
VisibilityMode _get_navigation_visibility_mode_bind_compat_87115();
static void _bind_compatibility_methods();
-#endif
+#endif // DISABLE_DEPRECATED
public:
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
virtual Rect2 _edit_get_rect() const override;
-#endif
+#endif // DEBUG_ENABLED
#ifndef DISABLE_DEPRECATED
void force_update(int p_layer);
-#endif
+#endif // DISABLE_DEPRECATED
void set_rendering_quadrant_size(int p_size);
int get_rendering_quadrant_size() const;
diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp
index f003442265..c566f26399 100644
--- a/scene/2d/touch_screen_button.cpp
+++ b/scene/2d/touch_screen_button.cpp
@@ -332,7 +332,7 @@ void TouchScreenButton::_release(bool p_exiting_tree) {
}
}
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
Rect2 TouchScreenButton::_edit_get_rect() const {
if (texture_normal.is_null()) {
return CanvasItem::_edit_get_rect();
@@ -344,7 +344,7 @@ Rect2 TouchScreenButton::_edit_get_rect() const {
bool TouchScreenButton::_edit_use_rect() const {
return !texture_normal.is_null();
}
-#endif
+#endif // DEBUG_ENABLED
Rect2 TouchScreenButton::get_anchorable_rect() const {
if (texture_normal.is_null()) {
diff --git a/scene/2d/touch_screen_button.h b/scene/2d/touch_screen_button.h
index 678ab087b7..d859dd224b 100644
--- a/scene/2d/touch_screen_button.h
+++ b/scene/2d/touch_screen_button.h
@@ -78,10 +78,10 @@ protected:
#endif // DISABLE_DEPRECATED
public:
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
virtual Rect2 _edit_get_rect() const override;
virtual bool _edit_use_rect() const override;
-#endif
+#endif // DEBUG_ENABLED
void set_texture_normal(const Ref<Texture2D> &p_texture);
Ref<Texture2D> get_texture_normal() const;
diff --git a/scene/2d/visible_on_screen_notifier_2d.cpp b/scene/2d/visible_on_screen_notifier_2d.cpp
index b36b270db1..92f015a6c0 100644
--- a/scene/2d/visible_on_screen_notifier_2d.cpp
+++ b/scene/2d/visible_on_screen_notifier_2d.cpp
@@ -32,7 +32,7 @@
#include "visible_on_screen_notifier_2d.h"
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
Rect2 VisibleOnScreenNotifier2D::_edit_get_rect() const {
return rect;
}
@@ -40,7 +40,7 @@ Rect2 VisibleOnScreenNotifier2D::_edit_get_rect() const {
bool VisibleOnScreenNotifier2D::_edit_use_rect() const {
return true;
}
-#endif
+#endif // DEBUG_ENABLED
void VisibleOnScreenNotifier2D::_visibility_enter() {
if (!is_inside_tree() || Engine::get_singleton()->is_editor_hint()) {
diff --git a/scene/2d/visible_on_screen_notifier_2d.h b/scene/2d/visible_on_screen_notifier_2d.h
index 5a5e11e433..d980b3e0c8 100644
--- a/scene/2d/visible_on_screen_notifier_2d.h
+++ b/scene/2d/visible_on_screen_notifier_2d.h
@@ -56,10 +56,10 @@ protected:
static void _bind_methods();
public:
-#ifdef TOOLS_ENABLED
+#ifdef DEBUG_ENABLED
virtual Rect2 _edit_get_rect() const override;
virtual bool _edit_use_rect() const override;
-#endif
+#endif // DEBUG_ENABLED
void set_rect(const Rect2 &p_rect);
Rect2 get_rect() const;