--- a/src/2d.c Mon Jul 14 21:56:53 2025 +0200 +++ b/src/2d.c Wed Jul 16 23:27:34 2025 +0200 @@ -189,17 +189,14 @@ rectangle->border_color = rectangle->color; } - AscSceneNode *node = &rectangle->node; - node->position = ASC_VEC3F(pos_x, pos_y, ASC_SCENE_2D_DEPTH_OFFSET); - node->scale = ASC_VEC3F_1; - asc_mat4f_unit(node->rotation); - node->render_group = asc_context.ink.alpha < 255 + asc_ptr_cast(AscSceneNode, node, rectangle); + asc_scene_node_init(node, + ASC_SCENE_NODE_FUNCS(asc_rectangle), + .pos2d = ASC_VEC2I(pos_x, pos_y), + .render_group = asc_context.ink.alpha < 255 ? ASC_RENDER_GROUP_2D_BLEND - : ASC_RENDER_GROUP_2D_OPAQUE; - node->update_func = asc_rectangle_update; - node->destroy_func = asc_rectangle_destroy; - node->draw_func = asc_rectangle_draw; - asc_scene_node_update(node); + : ASC_RENDER_GROUP_2D_OPAQUE + ); return node; } @@ -345,16 +342,13 @@ ellipsis->border_color = ellipsis->color; } - AscSceneNode *node = &ellipsis->node; - node->position = ASC_VEC3F(pos_x, pos_y, ASC_SCENE_2D_DEPTH_OFFSET); - node->scale = ASC_VEC3F_1; - asc_mat4f_unit(node->rotation); - node->render_group = asc_context.ink.alpha < 255 + asc_ptr_cast(AscSceneNode, node, ellipsis); + asc_scene_node_init(node, + ASC_SCENE_NODE_FUNCS(asc_ellipsis), + .pos2d = ASC_VEC2I(pos_x, pos_y), + .render_group = asc_context.ink.alpha < 255 ? ASC_RENDER_GROUP_2D_BLEND - : ASC_RENDER_GROUP_2D_OPAQUE; - node->update_func = asc_ellipsis_update; - node->destroy_func = asc_ellipsis_destroy; - node->draw_func = asc_ellipsis_draw; - asc_scene_node_update(node); + : ASC_RENDER_GROUP_2D_OPAQUE + ); return node; }