summaryrefslogtreecommitdiff
path: root/scene/2d/mesh_instance_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/mesh_instance_2d.cpp')
-rw-r--r--scene/2d/mesh_instance_2d.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/scene/2d/mesh_instance_2d.cpp b/scene/2d/mesh_instance_2d.cpp
index b7a0028199..178addd62d 100644
--- a/scene/2d/mesh_instance_2d.cpp
+++ b/scene/2d/mesh_instance_2d.cpp
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
+/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -30,11 +30,15 @@
#include "mesh_instance_2d.h"
+#include "scene/scene_string_names.h"
+
void MeshInstance2D::_notification(int p_what) {
- if (p_what == NOTIFICATION_DRAW) {
- if (mesh.is_valid()) {
- draw_mesh(mesh, texture);
- }
+ switch (p_what) {
+ case NOTIFICATION_DRAW: {
+ if (mesh.is_valid()) {
+ draw_mesh(mesh, texture);
+ }
+ } break;
}
}
@@ -70,7 +74,7 @@ void MeshInstance2D::set_texture(const Ref<Texture2D> &p_texture) {
}
texture = p_texture;
update();
- emit_signal("texture_changed");
+ emit_signal(SceneStringNames::get_singleton()->texture_changed);
}
void MeshInstance2D::set_normal_map(const Ref<Texture2D> &p_texture) {
@@ -95,6 +99,10 @@ Rect2 MeshInstance2D::_edit_get_rect() const {
return Node2D::_edit_get_rect();
}
+
+bool MeshInstance2D::_edit_use_rect() const {
+ return mesh.is_valid();
+}
#endif
MeshInstance2D::MeshInstance2D() {