Wed, 10 Apr 2024 19:31:26 +0200
make hidden flag a general attribute of nodes
src/ascension/scene.h | file | annotate | diff | comparison | revisions | |
src/ascension/ui/text.h | file | annotate | diff | comparison | revisions | |
src/scene.c | file | annotate | diff | comparison | revisions |
1.1 --- a/src/ascension/scene.h Wed Apr 10 19:29:09 2024 +0200 1.2 +++ b/src/ascension/scene.h Wed Apr 10 19:31:26 2024 +0200 1.3 @@ -62,6 +62,7 @@ 1.4 asc_transform transform; 1.5 asc_transform world_transform; 1.6 enum AscRenderGroup render_group; 1.7 + bool hidden; 1.8 bool need_graphics_update; 1.9 bool need_transform_update; 1.10 };
2.1 --- a/src/ascension/ui/text.h Wed Apr 10 19:29:09 2024 +0200 2.2 +++ b/src/ascension/ui/text.h Wed Apr 10 19:31:26 2024 +0200 2.3 @@ -38,7 +38,6 @@ 2.4 AscFont const *font; 2.5 asc_col4i color; 2.6 unsigned max_width; 2.7 - bool hidden; 2.8 bool centered; 2.9 AscTexture tex; 2.10 } AscText;
3.1 --- a/src/scene.c Wed Apr 10 19:29:09 2024 +0200 3.2 +++ b/src/scene.c Wed Apr 10 19:31:26 2024 +0200 3.3 @@ -83,6 +83,11 @@ 3.4 cx_foreach(AscSceneNode*, node, iter) { 3.5 node->depth = iter.depth; 3.6 3.7 + // skip hidden nodes (and all their children) 3.8 + if (node->hidden) { 3.9 + cxTreeVisitorContinue(iter); 3.10 + } 3.11 + 3.12 // execute behaviors, first 3.13 if (node->behaviors != NULL) { 3.14 CxIterator behavior_iter = cxListIterator(node->behaviors);