summaryrefslogtreecommitdiffstats
path: root/scene/resources/immediate_mesh.cpp
diff options
context:
space:
mode:
authorTrevor Davenport <trevor.davenport@gmail.com>2024-10-03 08:14:19 -0600
committerTrevor Davenport <trevor.davenport@gmail.com>2024-10-03 18:08:49 -0600
commit47f75547ce976988fd067c66ae6345d57771616b (patch)
treefc84ef85578e69fd44f8137c3e8599ba775f786d /scene/resources/immediate_mesh.cpp
parent2e144928793f17ebd70e1475bb7a7f4fd1095484 (diff)
downloadredot-engine-47f75547ce976988fd067c66ae6345d57771616b.tar.gz
Fix immediate mesh modifications that don't call set_mesh
Mesh_instance_2d has no way to know when the mesh had been modified unless you called set_mesh. This meant that you could modify the underlying mesh without it knowing which could result in incorrect result. Modified mesh_instance_2d to be more similar to mesh_instance_3d which connects to the changed signal of the mesh and reacts occordingly.
Diffstat (limited to 'scene/resources/immediate_mesh.cpp')
-rw-r--r--scene/resources/immediate_mesh.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/resources/immediate_mesh.cpp b/scene/resources/immediate_mesh.cpp
index 907c0ab4ca..072542f0ad 100644
--- a/scene/resources/immediate_mesh.cpp
+++ b/scene/resources/immediate_mesh.cpp
@@ -312,6 +312,8 @@ void ImmediateMesh::surface_end() {
uses_uv2s = false;
surface_active = false;
+
+ emit_changed();
}
void ImmediateMesh::clear_surfaces() {