src/scene.c

changeset 108
d619bf7dd87b
parent 106
895f92cff6b8
--- a/src/scene.c	Sat May 03 14:37:57 2025 +0200
+++ b/src/scene.c	Sat May 03 19:48:57 2025 +0200
@@ -28,6 +28,7 @@
 #include "ascension/error.h"
 #include "ascension/context.h"
 #include "ascension/scene.h"
+#include "ascension/behavior.h"
 #include "ascension/shader.h"
 #include "ascension/2d.h"
 
@@ -93,11 +94,10 @@
         }
 
         // execute behaviors, first
-        if (node->behaviors != NULL) {
-            CxIterator behavior_iter = cxListIterator(node->behaviors);
-            cx_foreach(asc_scene_update_func, behavior, behavior_iter) {
-                behavior(node);
-            }
+        // TODO: move to a separate iteration that is decoupled from drawing - issue #646
+        CxIterator behavior_iter = cxListIterator(node->behaviors);
+        cx_foreach(AscBehavior*, behavior, behavior_iter) {
+            behavior->func(behavior);
         }
 
         // TODO: implement culling

mercurial