src/scene.c

changeset 108
d619bf7dd87b
parent 106
895f92cff6b8
equal deleted inserted replaced
107:a35b39abe2b2 108:d619bf7dd87b
26 */ 26 */
27 27
28 #include "ascension/error.h" 28 #include "ascension/error.h"
29 #include "ascension/context.h" 29 #include "ascension/context.h"
30 #include "ascension/scene.h" 30 #include "ascension/scene.h"
31 #include "ascension/behavior.h"
31 #include "ascension/shader.h" 32 #include "ascension/shader.h"
32 #include "ascension/2d.h" 33 #include "ascension/2d.h"
33 34
34 #include <cx/tree.h> 35 #include <cx/tree.h>
35 #include <cx/linked_list.h> 36 #include <cx/linked_list.h>
91 if (asc_test_flag(node->flags, ASC_SCENE_NODE_HIDDEN)) { 92 if (asc_test_flag(node->flags, ASC_SCENE_NODE_HIDDEN)) {
92 cxTreeVisitorContinue(iter); 93 cxTreeVisitorContinue(iter);
93 } 94 }
94 95
95 // execute behaviors, first 96 // execute behaviors, first
96 if (node->behaviors != NULL) { 97 // TODO: move to a separate iteration that is decoupled from drawing - issue #646
97 CxIterator behavior_iter = cxListIterator(node->behaviors); 98 CxIterator behavior_iter = cxListIterator(node->behaviors);
98 cx_foreach(asc_scene_update_func, behavior, behavior_iter) { 99 cx_foreach(AscBehavior*, behavior, behavior_iter) {
99 behavior(node); 100 behavior->func(behavior);
100 }
101 } 101 }
102 102
103 // TODO: implement culling 103 // TODO: implement culling
104 104
105 // check if geometry needs update 105 // check if geometry needs update

mercurial