Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-10-11 16:50:46 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-10-12 17:38:55 +0300
commit01745051de735c37a2d817c1a58fda4585b77698 (patch)
tree119e9593fead5a3858ac17ece3ccdf46e6ce031f /source/blender/blenlib/BLI_link_utils.h
parent9b692ecabd3ddf675b4c6e09999415138df598d4 (diff)
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.
Diffstat (limited to 'source/blender/blenlib/BLI_link_utils.h')
-rw-r--r--source/blender/blenlib/BLI_link_utils.h9
1 files changed, 9 insertions, 0 deletions
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; \