=== Node editor ===

* refactor copying and freeing of node->storage by handlerizing them.
  - freestoragefunc
  - copystoragefunc
  - node_util.c/h have generic handlers for these.
This commit is contained in:
Nathan Letwory
2007-04-04 13:58:12 +00:00
parent afdd54fa37
commit fb0f61c0b0
60 changed files with 549 additions and 283 deletions

View File

@@ -78,10 +78,17 @@ typedef struct bNodeType {
void (*execfunc)(void *data, struct bNode *, struct bNodeStack **, struct bNodeStack **);
/* after this line is set on startup of blender */
/* this line is set on startup of blender */
int (*butfunc)(struct uiBlock *, struct bNodeTree *, struct bNode *, struct rctf *);
void (*initfunc)(struct bNode *);
void (*initfunc)(struct bNode *);
void (*freestoragefunc)(struct bNode *);
void (*copystoragefunc)(struct bNode *, struct bNode *);
/* for use with dynamic typedefs */
ID *id;
void *script; /* holds pointer to python script */
void *dict; /* holds pointer to python script dictionary (scope)*/
} bNodeType;

View File

@@ -239,7 +239,7 @@ void ntreeVerifyTypes(bNodeTree *ntree)
/* ************** Group stuff ********** */
bNodeType node_group_typeinfo= {
/* next,prev */ NULL, NULL,
/* next,prev */ NULL, NULL,
/* type code */ NODE_GROUP,
/* name */ "Group",
/* width+range */ 120, 60, 200,
@@ -248,8 +248,11 @@ bNodeType node_group_typeinfo= {
/* output sock */ NULL,
/* storage */ "",
/* execfunc */ NULL,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};
/* tag internal sockets */
@@ -349,13 +352,13 @@ void ntreeMakeOwnType(bNodeTree *ngroup)
}
/* make own type struct */
ngroup->owntype= MEM_mallocN(sizeof(bNodeType), "group type");
ngroup->owntype= MEM_callocN(sizeof(bNodeType), "group type");
*ngroup->owntype= node_group_typeinfo; /* copy data, for init */
/* input type arrays */
if(totin) {
bNodeSocketType *stype;
bNodeSocketType *inputs= MEM_mallocN(sizeof(bNodeSocketType)*(totin+1), "bNodeSocketType");
bNodeSocketType *inputs= MEM_callocN(sizeof(bNodeSocketType)*(totin+1), "bNodeSocketType");
a= 0;
for(node= ngroup->nodes.first; node; node= node->next) {
@@ -380,7 +383,7 @@ void ntreeMakeOwnType(bNodeTree *ngroup)
/* output type arrays */
if(totout) {
bNodeSocketType *stype;
bNodeSocketType *outputs= MEM_mallocN(sizeof(bNodeSocketType)*(totout+1), "bNodeSocketType");
bNodeSocketType *outputs= MEM_callocN(sizeof(bNodeSocketType)*(totout+1), "bNodeSocketType");
a= 0;
for(node= ngroup->nodes.first; node; node= node->next) {
@@ -817,23 +820,8 @@ bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node)
if(nnode->id)
nnode->id->us++;
if(nnode->storage) {
/* another candidate for handlerizing! */
if(ntree->type==NTREE_SHADER) {
if(node->type==SH_NODE_CURVE_VEC || node->type==SH_NODE_CURVE_RGB)
nnode->storage= curvemapping_copy(node->storage);
else
nnode->storage= MEM_dupallocN(nnode->storage);
}
else if(ntree->type==NTREE_COMPOSIT) {
if(ELEM3(node->type, CMP_NODE_TIME, CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB))
nnode->storage= curvemapping_copy(node->storage);
else
nnode->storage= MEM_dupallocN(nnode->storage);
}
else
nnode->storage= MEM_dupallocN(nnode->storage);
}
if(node->typeinfo->copystoragefunc)
node->typeinfo->copystoragefunc(node, nnode);
node->new_node= nnode;
nnode->new_node= NULL;
@@ -1012,22 +1000,8 @@ void nodeFreeNode(bNodeTree *ntree, bNode *node)
MEM_freeN(node->preview->rect);
MEM_freeN(node->preview);
}
if(node->storage) {
/* could be handlerized at some point, now only 1 exception still */
if(ntree->type==NTREE_SHADER) {
if(node->type==SH_NODE_CURVE_VEC || node->type==SH_NODE_CURVE_RGB)
curvemapping_free(node->storage);
else
MEM_freeN(node->storage);
}
else if(ntree->type==NTREE_COMPOSIT) {
if(ELEM3(node->type, CMP_NODE_TIME, CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB))
curvemapping_free(node->storage);
else
MEM_freeN(node->storage);
}
else
MEM_freeN(node->storage);
if(node->typeinfo && node->typeinfo->freestoragefunc) {
node->typeinfo->freestoragefunc(node);
}
MEM_freeN(node);
}

View File

@@ -117,8 +117,11 @@ bNodeType cmp_node_alphaover= {
/* output sock */ cmp_node_alphaover_out,
/* storage */ "",
/* execfunc */ node_composit_exec_alphaover,
/* butfunc */ NULL,
/*initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -629,16 +629,19 @@ static void node_composit_init_blur(bNode* node)
bNodeType cmp_node_blur= {
/* *next,*prev */ NULL, NULL,
/* type code */ CMP_NODE_BLUR,
/* name */ "Blur",
/* width+range */ 120, 80, 200,
/* class+opts */ NODE_CLASS_OP_FILTER, NODE_OPTIONS,
/* input sock */ cmp_node_blur_in,
/* output sock */ cmp_node_blur_out,
/* storage */ "NodeBlurData",
/* execfunc */ node_composit_exec_blur,
/* butfunc */ NULL,
/*initfunc */ node_composit_init_blur
/* type code */ CMP_NODE_BLUR,
/* name */ "Blur",
/* width+range */ 120, 80, 200,
/* class+opts */ NODE_CLASS_OP_FILTER, NODE_OPTIONS,
/* input sock */ cmp_node_blur_in,
/* output sock */ cmp_node_blur_out,
/* storage */ "NodeBlurData",
/* execfunc */ node_composit_exec_blur,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_blur,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
/* id */ NULL
};

View File

@@ -191,14 +191,17 @@ static void node_composit_init_channel_matte(bNode *node)
bNodeType cmp_node_channel_matte={
/* *next,*prev */ NULL, NULL,
/* type code */ CMP_NODE_CHANNEL_MATTE,
/* name */ "Channel Key",
/* width+range */ 200, 80, 250,
/* class+opts */ NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS,
/* input sock */ cmp_node_channel_matte_in,
/* output sock */ cmp_node_channel_matte_out,
/* storage */ "NodeChroma",
/* execfunc */ node_composit_exec_channel_matte,
/* butfunc */ NULL,
node_composit_init_channel_matte
/* type code */ CMP_NODE_CHANNEL_MATTE,
/* name */ "Channel Key",
/* width+range */ 200, 80, 250,
/* class+opts */ NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS,
/* input sock */ cmp_node_channel_matte_in,
/* output sock */ cmp_node_channel_matte_out,
/* storage */ "NodeChroma",
/* execfunc */ node_composit_exec_channel_matte,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_channel_matte,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
/* id */ NULL
};

View File

@@ -174,16 +174,19 @@ static void node_composit_init_chroma_matte(bNode *node)
bNodeType cmp_node_chroma={
/* *next,*prev */ NULL, NULL,
/* type code */ CMP_NODE_CHROMA,
/* name */ "Chroma Key",
/* width+range */ 200, 80, 300,
/* class+opts */ NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS,
/* input sock */ cmp_node_chroma_in,
/* output sock */ cmp_node_chroma_out,
/* storage */ "NodeChroma",
/* execfunc */ node_composit_exec_chroma_matte,
/* butfunc */ NULL,
node_composit_init_chroma_matte
/* type code */ CMP_NODE_CHROMA,
/* name */ "Chroma Key",
/* width+range */ 200, 80, 300,
/* class+opts */ NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS,
/* input sock */ cmp_node_chroma_in,
/* output sock */ cmp_node_chroma_out,
/* storage */ "NodeChroma",
/* execfunc */ node_composit_exec_chroma_matte,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_chroma_matte,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
/* id */ NULL
};

View File

@@ -123,19 +123,22 @@ static void node_composit_init_color_spill(bNode *node)
c->fsize= 0.0f;
c->fstrength= 0.0f;
node->custom1= 2; /* green channel */
};
}
bNodeType cmp_node_color_spill={
/* *next,*prev */ NULL, NULL,
/* type code */ CMP_NODE_COLOR_SPILL,
/* name */ "Color Spill",
/* width+range */ 140, 80, 200,
/* class+opts */ NODE_CLASS_MATTE, NODE_OPTIONS,
/* input sock */ cmp_node_color_spill_in,
/* output sock */ cmp_node_color_spill_out,
/* storage */ "NodeChroma",
/* execfunc */ node_composit_exec_color_spill,
/* butfunc */ NULL,
node_composit_init_color_spill
/* type code */ CMP_NODE_COLOR_SPILL,
/* name */ "Color Spill",
/* width+range */ 140, 80, 200,
/* class+opts */ NODE_CLASS_MATTE, NODE_OPTIONS,
/* input sock */ cmp_node_color_spill_in,
/* output sock */ cmp_node_color_spill_out,
/* storage */ "NodeChroma",
/* execfunc */ node_composit_exec_color_spill,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_color_spill,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
/* id */ NULL
};

View File

@@ -97,6 +97,9 @@ bNodeType cmp_node_composite= {
/* output sock */ NULL,
/* storage */ "",
/* execfunc */ node_composit_exec_composite,
/* butfunc */ NULL,
/*initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -68,8 +68,11 @@ bNodeType cmp_node_curve_time= {
/* output sock */ cmp_node_time_out,
/* storage */ "CurveMapping",
/* execfunc */ node_composit_exec_curves_time,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_curves_time
/* butfunc */ NULL,
/* initfunc */ node_composit_init_curves_time,
/* freestoragefunc */ node_free_curves,
/* copystoragefunc */ node_copy_curves,
/* id */ NULL
};
@@ -108,8 +111,11 @@ bNodeType cmp_node_curve_vec= {
/* output sock */ cmp_node_curve_vec_out,
/* storage */ "CurveMapping",
/* execfunc */ node_composit_exec_curve_vec,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_curve_vec
/* butfunc */ NULL,
/* initfunc */ node_composit_init_curve_vec,
/* freestoragefunc */ node_free_curves,
/* copystoragefunc */ node_copy_curves,
/* id */ NULL
};
@@ -191,7 +197,10 @@ bNodeType cmp_node_curve_rgb= {
/* output sock */ cmp_node_curve_rgb_out,
/* storage */ "CurveMapping",
/* execfunc */ node_composit_exec_curve_rgb,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_curve_rgb
/* butfunc */ NULL,
/* initfunc */ node_composit_init_curve_rgb,
/* freestoragefunc */ node_free_curves,
/* copystoragefunc */ node_copy_curves,
/* id */ NULL
};

View File

@@ -811,7 +811,7 @@ static void node_composit_init_defocus(bNode* node)
nbd->scale = 1.f;
nbd->no_zbuf = 1;
node->storage = nbd;
};
}
bNodeType cmp_node_defocus = {
/* *next,*prev */ NULL, NULL,
@@ -823,8 +823,11 @@ bNodeType cmp_node_defocus = {
/* output sock */ cmp_node_defocus_out,
/* storage */ "NodeDefocus",
/* execfunc */ node_composit_exec_defocus,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_defocus
/* butfunc */ NULL,
/* initfunc */ node_composit_init_defocus,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
/* id */ NULL
};

View File

@@ -199,16 +199,19 @@ static void node_composit_init_diff_matte(bNode *node)
bNodeType cmp_node_diff_matte={
/* *next,*prev */ NULL, NULL,
/* type code */ CMP_NODE_DIFF_MATTE,
/* name */ "Difference Key",
/* width+range */ 200, 80, 250,
/* class+opts */ NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS,
/* input sock */ cmp_node_diff_matte_in,
/* output sock */ cmp_node_diff_matte_out,
/* storage */ "NodeChroma",
/* execfunc */ node_composit_exec_diff_matte,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_diff_matte
/* type code */ CMP_NODE_DIFF_MATTE,
/* name */ "Difference Key",
/* width+range */ 200, 80, 250,
/* class+opts */ NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS,
/* input sock */ cmp_node_diff_matte_in,
/* output sock */ cmp_node_diff_matte_out,
/* storage */ "NodeChroma",
/* execfunc */ node_composit_exec_diff_matte,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_diff_matte,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
/* id */ NULL
};

View File

@@ -153,8 +153,11 @@ bNodeType cmp_node_dilateerode= {
/* output sock */ cmp_node_dilateerode_out,
/* storage */ "",
/* execfunc */ node_composit_exec_dilateerode,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -154,7 +154,10 @@ bNodeType cmp_node_displace= {
/* output sock */ cmp_node_displace_out,
/* storage */ "",
/* execfunc */ node_composit_exec_displace,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -224,8 +224,11 @@ bNodeType cmp_node_filter= {
/* output sock */ cmp_node_filter_out,
/* storage */ "",
/* execfunc */ node_composit_exec_filter,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -95,8 +95,11 @@ bNodeType cmp_node_flip= {
/* output sock */ cmp_node_flip_out,
/* storage */ "",
/* execfunc */ node_composit_exec_flip,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -111,8 +111,11 @@ bNodeType cmp_node_hue_sat= {
/* output sock */ cmp_node_hue_sat_out,
/* storage */ "NodeHueSat",
/* execfunc */ node_composit_exec_hue_sat,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_hue_sat
/* butfunc */ NULL,
/* initfunc */ node_composit_init_hue_sat,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
/* id */ NULL
};

View File

@@ -94,8 +94,11 @@ bNodeType cmp_node_idmask= {
/* output sock */ cmp_node_idmask_out,
/* storage */ "",
/* execfunc */ node_composit_exec_idmask,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -212,16 +212,19 @@ static void node_composit_init_image(bNode* node)
bNodeType cmp_node_image= {
/* *next,*prev */ NULL, NULL,
/* type code */ CMP_NODE_IMAGE,
/* name */ "Image",
/* width+range */ 120, 80, 300,
/* class+opts */ NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS,
/* input sock */ NULL,
/* output sock */ cmp_node_rlayers_out,
/* storage */ "ImageUser",
/* execfunc */ node_composit_exec_image,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_image
/* type code */ CMP_NODE_IMAGE,
/* name */ "Image",
/* width+range */ 120, 80, 300,
/* class+opts */ NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS,
/* input sock */ NULL,
/* output sock */ cmp_node_rlayers_out,
/* storage */ "ImageUser",
/* execfunc */ node_composit_exec_image,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_image,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
/* id */ NULL
};
/* **************** RENDER RESULT ******************** */
@@ -330,16 +333,19 @@ static void node_composit_exec_rlayers(void *data, bNode *node, bNodeStack **in,
bNodeType cmp_node_rlayers= {
/* *next,*prev */ NULL, NULL,
/* type code */ CMP_NODE_R_LAYERS,
/* name */ "Render Layers",
/* width+range */ 150, 100, 300,
/* class+opts */ NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS,
/* input sock */ NULL,
/* output sock */ cmp_node_rlayers_out,
/* storage */ "",
/* execfunc */ node_composit_exec_rlayers,
/* butfunc */ NULL,
/* initfunc */ NULL
/* type code */ CMP_NODE_R_LAYERS,
/* name */ "Render Layers",
/* width+range */ 150, 100, 300,
/* class+opts */ NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS,
/* input sock */ NULL,
/* output sock */ cmp_node_rlayers_out,
/* storage */ "",
/* execfunc */ node_composit_exec_rlayers,
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -105,15 +105,18 @@ static void node_composit_init_luma_matte(bNode *node)
bNodeType cmp_node_luma_matte={
/* *next,*prev */ NULL, NULL,
/* type code */ CMP_NODE_LUMA_MATTE,
/* name */ "Luminance Key",
/* width+range */ 200, 80, 250,
/* class+opts */ NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS,
/* input sock */ cmp_node_luma_matte_in,
/* output sock */ cmp_node_luma_matte_out,
/* storage */ "NodeChroma",
/* execfunc */ node_composit_exec_luma_matte,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_luma_matte
/* type code */ CMP_NODE_LUMA_MATTE,
/* name */ "Luminance Key",
/* width+range */ 200, 80, 250,
/* class+opts */ NODE_CLASS_MATTE, NODE_PREVIEW|NODE_OPTIONS,
/* input sock */ cmp_node_luma_matte_in,
/* output sock */ cmp_node_luma_matte_out,
/* storage */ "NodeChroma",
/* execfunc */ node_composit_exec_luma_matte,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_luma_matte,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
/* id */ NULL
};

View File

@@ -140,7 +140,10 @@ bNodeType cmp_node_mapuv= {
/* storage */ "",
/* execfunc */ node_composit_exec_mapuv,
/* butfunc */ NULL,
/* initfunc */ NULL
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -89,8 +89,11 @@ bNodeType cmp_node_map_value= {
/* output sock */ cmp_node_map_value_out,
/* storage */ "TexMapping",
/* execfunc */ node_composit_exec_map_value,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_map_value
/* butfunc */ NULL,
/* initfunc */ node_composit_init_map_value,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
/* id */ NULL
};

View File

@@ -168,8 +168,11 @@ bNodeType cmp_node_math= {
/* output sock */ cmp_node_math_out,
/* storage */ "",
/* execfunc */ node_composit_exec_math,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -87,7 +87,10 @@ bNodeType cmp_node_mix_rgb= {
/* output sock */ cmp_node_mix_rgb_out,
/* storage */ "",
/* execfunc */ node_composit_exec_mix_rgb,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -87,8 +87,11 @@ bNodeType cmp_node_normal= {
/* output sock */ cmp_node_normal_out,
/* storage */ "",
/* execfunc */ node_composit_exec_normal,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -102,7 +102,10 @@ bNodeType cmp_node_output_file= {
/* storage */ "NodeImageFile",
/* execfunc */ node_composit_exec_output_file,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_output_file
/* initfunc */ node_composit_init_output_file,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
/* id */ NULL
};

View File

@@ -54,7 +54,10 @@ bNodeType cmp_node_rgb= {
/* storage */ "",
/* execfunc */ node_composit_exec_rgb,
/* butfunc */ NULL,
/* initfunc */ NULL
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -142,6 +142,9 @@ bNodeType cmp_node_rotate= {
/* output sock */ cmp_node_rotate_out,
/* storage */ "",
/* execfunc */ node_composit_exec_rotate,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -111,8 +111,11 @@ bNodeType cmp_node_scale= {
/* output sock */ cmp_node_scale_out,
/* storage */ "",
/* execfunc */ node_composit_exec_scale,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -106,8 +106,11 @@ bNodeType cmp_node_sephsva= {
/* output sock */ cmp_node_sephsva_out,
/* storage */ "",
/* execfunc */ node_composit_exec_sephsva,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};
@@ -170,16 +173,19 @@ static void node_composit_exec_combhsva(void *data, bNode *node, bNodeStack **in
bNodeType cmp_node_combhsva= {
/* *next,*prev */ NULL, NULL,
/* type code */ CMP_NODE_COMBHSVA,
/* name */ "Combine HSVA",
/* width+range */ 80, 40, 140,
/* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS,
/* input sock */ cmp_node_combhsva_in,
/* output sock */ cmp_node_combhsva_out,
/* storage */ "",
/* execfunc */ node_composit_exec_combhsva,
/* butfunc */ NULL,
/* initfunc */ NULL
/* type code */ CMP_NODE_COMBHSVA,
/* name */ "Combine HSVA",
/* width+range */ 80, 40, 140,
/* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS,
/* input sock */ cmp_node_combhsva_in,
/* output sock */ cmp_node_combhsva_out,
/* storage */ "",
/* execfunc */ node_composit_exec_combhsva,
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -84,8 +84,11 @@ bNodeType cmp_node_seprgba= {
/* output sock */ cmp_node_seprgba_out,
/* storage */ "",
/* execfunc */ node_composit_exec_seprgba,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};
@@ -154,8 +157,11 @@ bNodeType cmp_node_combrgba= {
/* output sock */ cmp_node_combrgba_out,
/* storage */ "",
/* execfunc */ node_composit_exec_combrgba,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -96,17 +96,20 @@ static void node_composit_exec_sepycca(void *data, bNode *node, bNodeStack **in,
}
bNodeType cmp_node_sepycca= {
/* *next,*prev */ NULL, NULL,
/* type code */ CMP_NODE_SEPYCCA,
/* name */ "Separate YCbCrA",
/* width+range */ 80, 40, 140,
/* class+opts */ NODE_CLASS_CONVERTOR, 0,
/* input sock */ cmp_node_sepycca_in,
/* output sock */ cmp_node_sepycca_out,
/* storage */ "",
/* execfunc */ node_composit_exec_sepycca,
/* butfunc */ NULL,
/* initfunc */ NULL
/* *next,*prev */ NULL, NULL,
/* type code */ CMP_NODE_SEPYCCA,
/* name */ "Separate YCbCrA",
/* width+range */ 80, 40, 140,
/* class+opts */ NODE_CLASS_CONVERTOR, 0,
/* input sock */ cmp_node_sepycca_in,
/* output sock */ cmp_node_sepycca_out,
/* storage */ "",
/* execfunc */ node_composit_exec_sepycca,
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};
@@ -184,8 +187,11 @@ bNodeType cmp_node_combycca= {
/* output sock */ cmp_node_combycca_out,
/* storage */ "",
/* execfunc */ node_composit_exec_combycca,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -98,16 +98,19 @@ static void node_composit_exec_sepyuva(void *data, bNode *node, bNodeStack **in,
bNodeType cmp_node_sepyuva= {
/* *next,*prev */ NULL, NULL,
/* type code */ CMP_NODE_SEPYUVA,
/* name */ "Separate YUVA",
/* width+range */ 80, 40, 140,
/* class+opts */ NODE_CLASS_CONVERTOR, 0,
/* input sock */ cmp_node_sepyuva_in,
/* output sock */ cmp_node_sepyuva_out,
/* storage */ "",
/* execfunc */ node_composit_exec_sepyuva,
/* butfunc */ NULL,
/* initfunc */ NULL
/* type code */ CMP_NODE_SEPYUVA,
/* name */ "Separate YUVA",
/* width+range */ 80, 40, 140,
/* class+opts */ NODE_CLASS_CONVERTOR, 0,
/* input sock */ cmp_node_sepyuva_in,
/* output sock */ cmp_node_sepyuva_out,
/* storage */ "",
/* execfunc */ node_composit_exec_sepyuva,
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};
@@ -178,7 +181,10 @@ bNodeType cmp_node_combyuva= {
/* output sock */ cmp_node_combyuva_out,
/* storage */ "",
/* execfunc */ node_composit_exec_combyuva,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -80,7 +80,10 @@ bNodeType cmp_node_setalpha= {
/* output sock */ cmp_node_setalpha_out,
/* storage */ "",
/* execfunc */ node_composit_exec_setalpha,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -152,8 +152,11 @@ bNodeType cmp_node_splitviewer= {
/* output sock */ NULL,
/* storage */ "ImageUser",
/* execfunc */ node_composit_exec_splitviewer,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_splitviewer
/* butfunc */ NULL,
/* initfunc */ node_composit_init_splitviewer,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
/* id */ NULL
};

View File

@@ -127,8 +127,11 @@ bNodeType cmp_node_texture= {
/* output sock */ cmp_node_texture_out,
/* storage */ "",
/* execfunc */ node_composit_exec_texture,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -66,7 +66,10 @@ bNodeType cmp_node_translate= {
/* output sock */ cmp_node_translate_out,
/* storage */ "",
/* execfunc */ node_composit_exec_translate,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -90,8 +90,11 @@ bNodeType cmp_node_valtorgb= {
/* output sock */ cmp_node_valtorgb_out,
/* storage */ "ColorBand",
/* execfunc */ node_composit_exec_valtorgb,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_valtorgb
/* butfunc */ NULL,
/* initfunc */ node_composit_init_valtorgb,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
/* id */ NULL
};
@@ -144,8 +147,10 @@ bNodeType cmp_node_rgbtobw= {
/* output sock */ cmp_node_rgbtobw_out,
/* storage */ "",
/* execfunc */ node_composit_exec_rgbtobw,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -52,7 +52,10 @@ bNodeType cmp_node_value= {
/* output sock */ cmp_node_value_out,
/* storage */ "",
/* execfunc */ node_composit_exec_value,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -90,7 +90,6 @@ static void node_composit_init_vecblur(bNode* node)
nbd->fac= 1.0f;
};
/* custom1: itterations, custom2: maxspeed (0 = nolimit) */
bNodeType cmp_node_vecblur= {
/* next, prev */ NULL, NULL,
@@ -101,8 +100,11 @@ bNodeType cmp_node_vecblur= {
/* input sock */ cmp_node_vecblur_in,
/* output sock */ cmp_node_vecblur_out,
/* storage */ "NodeBlurData",
/* execfunc */ node_composit_exec_vecblur,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_vecblur
/* execfunc */ node_composit_exec_vecblur,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_vecblur,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
/* id */ NULL
};

View File

@@ -134,8 +134,11 @@ bNodeType cmp_node_viewer= {
/* output sock */ NULL,
/* storage */ "ImageUser",
/* execfunc */ node_composit_exec_viewer,
/* butfunc */ NULL,
/* initfunc */ node_composit_init_viewer
/* butfunc */ NULL,
/* initfunc */ node_composit_init_viewer,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
/* id */ NULL
};

View File

@@ -146,7 +146,10 @@ bNodeType cmp_node_zcombine= {
/* output sock */ cmp_node_zcombine_out,
/* storage */ "",
/* execfunc */ node_composit_exec_zcombine,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -62,7 +62,7 @@
#include "BKE_library.h"
#include "../CMP_node.h"
#include "node_util.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"

View File

@@ -59,7 +59,10 @@ bNodeType sh_node_camera= {
/* output sock */ sh_node_camera_out,
/* storage */ "node_camera",
/* execfunc */ node_shader_exec_camera,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -66,8 +66,11 @@ bNodeType sh_node_curve_vec= {
/* output sock */ sh_node_curve_vec_out,
/* storage */ "CurveMapping",
/* execfunc */ node_shader_exec_curve_vec,
/* butfunc */ NULL,
/* initfunc */ node_shader_init_curve_vec
/* butfunc */ NULL,
/* initfunc */ node_shader_init_curve_vec,
/* freestoragefunc */ node_free_curves,
/* copystoragefunc */ node_copy_curves,
/* id */ NULL
};
@@ -108,6 +111,9 @@ bNodeType sh_node_curve_rgb= {
/* storage */ "CurveMapping",
/* execfunc */ node_shader_exec_curve_rgb,
/* butfunc */ NULL,
/* initfunc */ node_shader_init_curve_rgb
/* initfunc */ node_shader_init_curve_rgb,
/* freestoragefunc */ node_free_curves,
/* copystoragefunc */ node_copy_curves,
/* id */ NULL
};

View File

@@ -124,7 +124,10 @@ bNodeType sh_node_geom= {
/* output sock */ sh_node_geom_out,
/* storage */ "NodeGeometry",
/* execfunc */ node_shader_exec_geom,
/* butfunc */ NULL,
/* initfunc */ node_shader_init_geometry
/* butfunc */ NULL,
/* initfunc */ node_shader_init_geometry,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
/* id */ NULL
};

View File

@@ -79,8 +79,11 @@ bNodeType sh_node_mapping= {
/* output sock */ sh_node_mapping_out,
/* storage */ "TexMapping",
/* execfunc */ node_shader_exec_mapping,
/* butfunc */ NULL,
/* initfunc */ node_shader_init_mapping
/* butfunc */ NULL,
/* initfunc */ node_shader_init_mapping,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
/* id */ NULL
};

View File

@@ -145,8 +145,11 @@ bNodeType sh_node_material= {
/* output sock */ sh_node_material_out,
/* storage */ "",
/* execfunc */ node_shader_exec_material,
/* butfunc */ NULL,
/* initfunc */ node_shader_init_material
/* butfunc */ NULL,
/* initfunc */ node_shader_init_material,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -180,15 +180,18 @@ bNodeStack **out)
bNodeType sh_node_math= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_MATH,
/* name */ "Math",
/* width+range */ 120, 110, 160,
/* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS,
/* input sock */ sh_node_math_in,
/* output sock */ sh_node_math_out,
/* storage */ "node_math",
/* execfunc */ node_shader_exec_math,
/* butfunc */ NULL,
/* initfunc */ NULL
/* type code */ SH_NODE_MATH,
/* name */ "Math",
/* width+range */ 120, 110, 160,
/* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS,
/* input sock */ sh_node_math_in,
/* output sock */ sh_node_math_out,
/* storage */ "node_math",
/* execfunc */ node_shader_exec_math,
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -70,7 +70,10 @@ bNodeType sh_node_mix_rgb= {
/* output sock */ sh_node_mix_rgb_out,
/* storage */ "",
/* execfunc */ node_shader_exec_mix_rgb,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -67,7 +67,10 @@ bNodeType sh_node_normal= {
/* output sock */ sh_node_normal_out,
/* storage */ "",
/* execfunc */ node_shader_exec_normal,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -72,8 +72,11 @@ bNodeType sh_node_output= {
/* output sock */ NULL,
/* storage */ "",
/* execfunc */ node_shader_exec_output,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -52,7 +52,10 @@ bNodeType sh_node_rgb= {
/* output sock */ sh_node_rgb_out,
/* storage */ "",
/* execfunc */ node_shader_exec_rgb,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -56,15 +56,18 @@ bNodeStack **out)
bNodeType sh_node_squeeze= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_SQUEEZE,
/* name */ "Squeeze Value",
/* width+range */ 120, 110, 160,
/* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS,
/* input sock */ sh_node_squeeze_in,
/* output sock */ sh_node_squeeze_out,
/* storage */ "node_squeeze",
/* execfunc */ node_shader_exec_squeeze,
/* butfunc */ NULL,
/* initfunc */ NULL
/* type code */ SH_NODE_SQUEEZE,
/* name */ "Squeeze Value",
/* width+range */ 120, 110, 160,
/* class+opts */ NODE_CLASS_CONVERTOR, NODE_OPTIONS,
/* input sock */ sh_node_squeeze_in,
/* output sock */ sh_node_squeeze_out,
/* storage */ "node_squeeze",
/* execfunc */ node_shader_exec_squeeze,
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -120,8 +120,11 @@ bNodeType sh_node_texture= {
/* output sock */ sh_node_texture_out,
/* storage */ "",
/* execfunc */ node_shader_exec_texture,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -69,8 +69,11 @@ bNodeType sh_node_valtorgb= {
/* output sock */ sh_node_valtorgb_out,
/* storage */ "ColorBand",
/* execfunc */ node_shader_exec_valtorgb,
/* butfunc */ NULL,
/* initfunc */ node_shader_init_valtorgb
/* butfunc */ NULL,
/* initfunc */ node_shader_init_valtorgb,
/* freestoragefunc */ node_free_standard_storage,
/* copystoragefunc */ node_copy_standard_storage,
/* id */ NULL
};
@@ -95,16 +98,19 @@ static void node_shader_exec_rgbtobw(void *data, bNode *node, bNodeStack **in, b
bNodeType sh_node_rgbtobw= {
/* *next,*prev */ NULL, NULL,
/* type code */ SH_NODE_RGBTOBW,
/* name */ "RGB to BW",
/* width+range */ 80, 40, 120,
/* class+opts */ NODE_CLASS_CONVERTOR, 0,
/* input sock */ sh_node_rgbtobw_in,
/* output sock */ sh_node_rgbtobw_out,
/* storage */ "",
/* execfunc */ node_shader_exec_rgbtobw,
/* butfunc */ NULL,
/* initfunc */ NULL
/* type code */ SH_NODE_RGBTOBW,
/* name */ "RGB to BW",
/* width+range */ 80, 40, 120,
/* class+opts */ NODE_CLASS_CONVERTOR, 0,
/* input sock */ sh_node_rgbtobw_in,
/* output sock */ sh_node_rgbtobw_out,
/* storage */ "",
/* execfunc */ node_shader_exec_rgbtobw,
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -54,8 +54,11 @@ bNodeType sh_node_value= {
/* output sock */ sh_node_value_out,
/* storage */ "",
/* execfunc */ node_shader_exec_value,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -109,7 +109,10 @@ bNodeType sh_node_vect_math= {
/* output sock */ sh_node_vect_math_out,
/* storage */ "node_vect_math",
/* execfunc */ node_shader_exec_vect_math,
/* butfunc */ NULL,
/* initfunc */ NULL
/* butfunc */ NULL,
/* initfunc */ NULL,
/* freestoragefunc */ NULL,
/* copystoragefunc */ NULL,
/* id */ NULL
};

View File

@@ -60,6 +60,7 @@
#include "BKE_library.h"
#include "../SHD_node.h"
#include "node_util.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"

View File

@@ -0,0 +1,52 @@
/**
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2007 Blender Foundation.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): Nathan Letwory.
*
* ***** END GPL LICENSE BLOCK *****
*/
#include "CMP_util.h"
#include "SHD_util.h"
void node_free_curves(bNode* node)
{
curvemapping_free(node->storage);
}
void node_free_standard_storage(bNode *node)
{
MEM_freeN(node->storage);
}
void node_copy_curves(bNode* orig_node, bNode* new_node)
{
new_node->storage= curvemapping_copy(orig_node->storage);
}
void node_copy_standard_storage(bNode *orig_node, bNode *new_node)
{
new_node->storage= MEM_dupallocN(orig_node->storage);
}

View File

@@ -0,0 +1,42 @@
/**
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2007 Blender Foundation.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): Nathan Letwory.
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef NODE_UTIL_H_
#define NODE_UTIL_H_
#include "MEM_guardedalloc.h"
extern void node_free_curves(struct bNode* node);
extern void node_free_standard_storage(struct bNode *node);
extern void node_copy_curves(struct bNode* orig_node, struct bNode* new_node);
extern void node_copy_standard_storage(struct bNode *orig_node, struct bNode *new_node);
#endif