diff options
Diffstat (limited to 'scene/2d/multimesh_instance_2d.cpp')
-rw-r--r-- | scene/2d/multimesh_instance_2d.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/scene/2d/multimesh_instance_2d.cpp b/scene/2d/multimesh_instance_2d.cpp index 6620027020..b99c0a3fa9 100644 --- a/scene/2d/multimesh_instance_2d.cpp +++ b/scene/2d/multimesh_instance_2d.cpp @@ -31,7 +31,6 @@ #include "multimesh_instance_2d.h" void MultiMeshInstance2D::_notification(int p_what) { - if (p_what == NOTIFICATION_DRAW) { if (multimesh.is_valid()) { draw_multimesh(multimesh, texture, normal_map); @@ -40,7 +39,6 @@ void MultiMeshInstance2D::_notification(int p_what) { } void MultiMeshInstance2D::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_multimesh", "multimesh"), &MultiMeshInstance2D::set_multimesh); ClassDB::bind_method(D_METHOD("get_multimesh"), &MultiMeshInstance2D::get_multimesh); @@ -58,20 +56,18 @@ void MultiMeshInstance2D::_bind_methods() { } void MultiMeshInstance2D::set_multimesh(const Ref<MultiMesh> &p_multimesh) { - multimesh = p_multimesh; update(); } Ref<MultiMesh> MultiMeshInstance2D::get_multimesh() const { - return multimesh; } void MultiMeshInstance2D::set_texture(const Ref<Texture2D> &p_texture) { - - if (p_texture == texture) + if (p_texture == texture) { return; + } texture = p_texture; update(); emit_signal("texture_changed"); @@ -79,24 +75,20 @@ void MultiMeshInstance2D::set_texture(const Ref<Texture2D> &p_texture) { } Ref<Texture2D> MultiMeshInstance2D::get_texture() const { - return texture; } void MultiMeshInstance2D::set_normal_map(const Ref<Texture2D> &p_texture) { - normal_map = p_texture; update(); } Ref<Texture2D> MultiMeshInstance2D::get_normal_map() const { - return normal_map; } #ifdef TOOLS_ENABLED Rect2 MultiMeshInstance2D::_edit_get_rect() const { - if (multimesh.is_valid()) { AABB aabb = multimesh->get_aabb(); return Rect2(aabb.position.x, aabb.position.y, aabb.size.x, aabb.size.y); |