From 01745051de735c37a2d817c1a58fda4585b77698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Thu, 11 Oct 2018 15:50:46 +0200 Subject: DRW: Add DRW_shgroup_create_sub to create children shgroup This makes is easy to create nested drawcalls that will inherit all the parents properties. This is usefull if only a few uniforms changes for that drawcall. --- source/blender/blenlib/BLI_link_utils.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/blenlib/BLI_link_utils.h') diff --git a/source/blender/blenlib/BLI_link_utils.h b/source/blender/blenlib/BLI_link_utils.h index 5322547ac08..7a1a13a6b31 100644 --- a/source/blender/blenlib/BLI_link_utils.h +++ b/source/blender/blenlib/BLI_link_utils.h @@ -47,6 +47,15 @@ (list)->last = link; \ } (void)0 +/* Use for inserting after a certain element. */ +#define BLI_LINKS_INSERT_AFTER(list, node, link) { \ + if ((node)->next == NULL) { \ + (list)->last = link; \ + } \ + (link)->next = (node)->next; \ + (node)->next = link; \ +} (void)0 + #define BLI_LINKS_FREE(list) { \ while (list) { \ void *next = list->next; \ -- cgit v1.2.3