1.1 --- a/src/ascension/scene.h Fri Apr 12 22:23:31 2024 +0200 1.2 +++ b/src/ascension/scene.h Fri Apr 12 22:43:00 2024 +0200 1.3 @@ -62,9 +62,6 @@ 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 /** 1.11 * Custom flags for this node. 1.12 * The #ASC_SCENE_NODE_FLAGS_MASK bits are reserved for general flags. 1.13 @@ -72,7 +69,10 @@ 1.14 uint32_t flags; 1.15 }; 1.16 1.17 -#define ASC_SCENE_NODE_FLAGS_MASK 0xFF000000 1.18 +#define ASC_SCENE_NODE_FLAGS_MASK 0xFF000000 1.19 +#define ASC_SCENE_NODE_UPDATE_GRAPHICS 0x01000000 1.20 +#define ASC_SCENE_NODE_UPDATE_TRANSFORM 0x02000000 1.21 +#define ASC_SCENE_NODE_HIDDEN 0x80000000 1.22 1.23 /** 1.24 * Place this as first member of a structure that shall be used as a scene node. 1.25 @@ -161,12 +161,11 @@ 1.26 asc_scene_update_func behavior 1.27 ); 1.28 1.29 -#define asc_node_update(node) \ 1.30 - ((AscSceneNode*)node)->need_graphics_update = true 1.31 - 1.32 +__attribute__((__nonnull__)) 1.33 +void asc_node_update(AscSceneNode *node); 1.34 1.35 __attribute__((__nonnull__)) 1.36 -void asc_update_transform(AscSceneNode *node); 1.37 +void asc_node_update_transform(AscSceneNode *node); 1.38 1.39 1.40 __attribute__((__nonnull__)) static inline 1.41 @@ -174,7 +173,7 @@ 1.42 node->position.x = x; 1.43 node->position.y = y; 1.44 node->position.z = z; 1.45 - asc_update_transform(node); 1.46 + asc_node_update_transform(node); 1.47 } 1.48 1.49 __attribute__((__nonnull__)) static inline 1.50 @@ -182,7 +181,7 @@ 1.51 node->position.x = (float)x; 1.52 node->position.y = (float)y; 1.53 node->position.z = 0.f; 1.54 - asc_update_transform(node); 1.55 + asc_node_update_transform(node); 1.56 } 1.57 1.58 __attribute__((__nonnull__)) static inline 1.59 @@ -195,7 +194,7 @@ 1.60 node->scale.width = width; 1.61 node->scale.height = height; 1.62 node->scale.depth = depth; 1.63 - asc_update_transform(node); 1.64 + asc_node_update_transform(node); 1.65 } 1.66 1.67 __attribute__((__nonnull__)) static inline 1.68 @@ -203,7 +202,7 @@ 1.69 node->scale.width = (float)width; 1.70 node->scale.height = (float)height; 1.71 node->scale.depth = 1.f; 1.72 - asc_update_transform(node); 1.73 + asc_node_update_transform(node); 1.74 } 1.75 1.76 __attribute__((__nonnull__)) static inline