src/scene.c

changeset 69
86d545f490e4
parent 65
9c44c55d327a
child 71
baa73a0be3ce
--- a/src/scene.c	Sun Aug 11 16:11:30 2024 +0200
+++ b/src/scene.c	Sun Aug 11 16:28:54 2024 +0200
@@ -100,13 +100,18 @@
         // TODO: implement culling
 
         // check if geometry needs update
+        asc_clear_flag(node->flags,
+                       ASC_SCENE_NODE_GRAPHICS_UPDATED
+                       | ASC_SCENE_NODE_TRANSFORM_UPDATED);
         if (asc_test_flag(node->flags, ASC_SCENE_NODE_UPDATE_GRAPHICS)) {
+            asc_set_flag(node->flags, ASC_SCENE_NODE_GRAPHICS_UPDATED);
+            asc_clear_flag(node->flags, ASC_SCENE_NODE_UPDATE_GRAPHICS);
             assert(node->update_func != NULL);
-            asc_clear_flag(node->flags, ASC_SCENE_NODE_UPDATE_GRAPHICS);
             node->update_func(node);
         }
         if (asc_test_flag(node->flags, ASC_SCENE_NODE_UPDATE_TRANSFORM)) {
-            asc_test_flag(node->flags, ASC_SCENE_NODE_UPDATE_TRANSFORM);
+            asc_set_flag(node->flags, ASC_SCENE_NODE_TRANSFORM_UPDATED);
+            asc_clear_flag(node->flags, ASC_SCENE_NODE_UPDATE_TRANSFORM);
             asc_transform_from_parts(
                     node->transform,
                     node->position,

mercurial