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:
authorLukas Toenne <lukas.toenne@googlemail.com>2011-02-07 12:33:36 +0300
committerLukas Toenne <lukas.toenne@googlemail.com>2011-02-07 12:33:36 +0300
commit2070356a329969be2287e6f8f7575a7e45d13543 (patch)
tree47ddc31594db82fb9e888b4ffbd71abadd21460b /source/blender/blenkernel/BKE_node.h
parentd272b70ee09be8c949247404c9324cfffc833976 (diff)
A simplified way of defining bNodeType structs. Instead of doing full struct member initialization for each node, this uses a couple of helper functions now. This will make it easier to change and extend the bNodeSocket interface in the future. Two examples (normal and mapping shader nodes) included, the rest should be converted too.
Diffstat (limited to 'source/blender/blenkernel/BKE_node.h')
-rw-r--r--source/blender/blenkernel/BKE_node.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index 857150cf873..941083734b4 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -206,6 +206,18 @@ void nodeCopyGroup(struct bNode *gnode);
/* ************** COMMON NODES *************** */
+/* Init a new node type struct with default values and callbacks */
+void node_type_init(struct bNodeType *ntype, int type, const char *name, short nclass, short flag,
+ struct bNodeSocketType *inputs, struct bNodeSocketType *outputs);
+void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth);
+void node_type_storage(struct bNodeType *ntype,
+ const char *storagename,
+ void (*initfunc)(struct bNode *),
+ void (*freestoragefunc)(struct bNode *),
+ void (*copystoragefunc)(struct bNode *, struct bNode *));
+void node_type_exec(struct bNodeType *ntype, void (*execfunc)(void *data, struct bNode *, struct bNodeStack **, struct bNodeStack **));
+void node_type_gpu(struct bNodeType *ntype, int (*gpufunc)(struct GPUMaterial *mat, struct bNode *node, struct GPUNodeStack *in, struct GPUNodeStack *out));
+
#define NODE_GROUP 2
#define NODE_GROUP_MENU 1000
#define NODE_DYNAMIC_MENU 4000