diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-05-27 11:57:17 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-05-27 11:57:17 +0400 |
commit | d612fc04267ca035930eddbfa431f567599baa2c (patch) | |
tree | 9826916848dba3ef6e9f73d93a3f1294b4b3d19a /source/blender/nodes/texture | |
parent | ac0a8af41413b730c0ab17cf19390c65dee3134c (diff) |
style cleanup: nodes
Diffstat (limited to 'source/blender/nodes/texture')
11 files changed, 111 insertions, 111 deletions
diff --git a/source/blender/nodes/texture/nodes/node_texture_bricks.c b/source/blender/nodes/texture/nodes/node_texture_bricks.c index 4c23a21972f..91f4c067cbf 100644 --- a/source/blender/nodes/texture/nodes/node_texture_bricks.c +++ b/source/blender/nodes/texture/nodes/node_texture_bricks.c @@ -47,7 +47,7 @@ static bNodeSocketTemplate inputs[] = { }; static bNodeSocketTemplate outputs[] = { { SOCK_RGBA, 0, N_("Color")}, - { -1, 0, "" } + { -1, 0, ""} }; static void init(bNodeTree *UNUSED(ntree), bNode *node) @@ -91,15 +91,15 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor rownum = (int)floor(y / row_height); - if ( node->custom1 && node->custom2 ) { - brick_width *= ((int)(rownum) % node->custom2 ) ? 1.0f : node->custom4; /* squash */ - offset = ((int)(rownum) % node->custom1 ) ? 0 : (brick_width*node->custom3); /* offset */ + if (node->custom1 && node->custom2) { + brick_width *= ((int)(rownum) % node->custom2) ? 1.0f : node->custom4; /* squash */ + offset = ((int)(rownum) % node->custom1) ? 0 : (brick_width * node->custom3); /* offset */ } - bricknum = (int)floor((x+offset) / brick_width); + bricknum = (int)floor((x + offset) / brick_width); - ins_x = (x+offset) - brick_width*bricknum; - ins_y = y - row_height*rownum; + ins_x = (x + offset) - brick_width * bricknum; + ins_y = y - row_height * rownum; tint = noise((rownum << 16) + (bricknum & 0xFFFF)) + bias; CLAMP(tint, 0.0f, 1.0f); @@ -125,7 +125,7 @@ void register_node_type_tex_bricks(void) { static bNodeType ntype; - tex_node_type_base(&ntype, TEX_NODE_BRICKS, "Bricks", NODE_CLASS_PATTERN, NODE_PREVIEW|NODE_OPTIONS); + tex_node_type_base(&ntype, TEX_NODE_BRICKS, "Bricks", NODE_CLASS_PATTERN, NODE_PREVIEW | NODE_OPTIONS); node_type_socket_templates(&ntype, inputs, outputs); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, init); diff --git a/source/blender/nodes/texture/nodes/node_texture_checker.c b/source/blender/nodes/texture/nodes/node_texture_checker.c index 83f619c1d83..30ce8bee3b2 100644 --- a/source/blender/nodes/texture/nodes/node_texture_checker.c +++ b/source/blender/nodes/texture/nodes/node_texture_checker.c @@ -74,7 +74,7 @@ void register_node_type_tex_checker(void) { static bNodeType ntype; - tex_node_type_base(&ntype, TEX_NODE_CHECKER, "Checker", NODE_CLASS_PATTERN, NODE_PREVIEW|NODE_OPTIONS); + tex_node_type_base(&ntype, TEX_NODE_CHECKER, "Checker", NODE_CLASS_PATTERN, NODE_PREVIEW | NODE_OPTIONS); node_type_socket_templates(&ntype, inputs, outputs); node_type_exec(&ntype, NULL, NULL, exec); diff --git a/source/blender/nodes/texture/nodes/node_texture_common.c b/source/blender/nodes/texture/nodes/node_texture_common.c index c5ba3e1c726..7baea38d357 100644 --- a/source/blender/nodes/texture/nodes/node_texture_common.c +++ b/source/blender/nodes/texture/nodes/node_texture_common.c @@ -60,7 +60,7 @@ static void copy_stack(bNodeStack *to, bNodeStack *from) static void *group_initexec(bNodeExecContext *context, bNode *node, bNodeInstanceKey key) { - bNodeTree *ngroup= (bNodeTree*)node->id; + bNodeTree *ngroup = (bNodeTree *)node->id; void *exec; if (!ngroup) @@ -74,7 +74,7 @@ static void *group_initexec(bNodeExecContext *context, bNode *node, bNodeInstanc static void group_freeexec(bNode *UNUSED(node), void *nodedata) { - bNodeTreeExec*gexec= (bNodeTreeExec*)nodedata; + bNodeTreeExec *gexec = (bNodeTreeExec *)nodedata; ntreeTexEndExecTree_internal(gexec); } @@ -84,7 +84,7 @@ static void group_freeexec(bNode *UNUSED(node), void *nodedata) */ static void group_copy_inputs(bNode *gnode, bNodeStack **in, bNodeStack *gstack) { - bNodeTree *ngroup = (bNodeTree*)gnode->id; + bNodeTree *ngroup = (bNodeTree *)gnode->id; bNode *node; bNodeSocket *sock; bNodeStack *ns; @@ -105,7 +105,7 @@ static void group_copy_inputs(bNode *gnode, bNodeStack **in, bNodeStack *gstack) */ static void group_copy_outputs(bNode *gnode, bNodeStack **out, bNodeStack *gstack) { - bNodeTree *ngroup = (bNodeTree*)gnode->id; + bNodeTree *ngroup = (bNodeTree *)gnode->id; bNode *node; bNodeSocket *sock; bNodeStack *ns; @@ -118,14 +118,14 @@ static void group_copy_outputs(bNode *gnode, bNodeStack **out, bNodeStack *gstac if (ns) copy_stack(out[a], ns); } - break; /* only one active output node */ + break; /* only one active output node */ } } } static void group_execute(void *data, int thread, struct bNode *node, bNodeExecData *execdata, struct bNodeStack **in, struct bNodeStack **out) { - bNodeTreeExec *exec= execdata->data; + bNodeTreeExec *exec = execdata->data; bNodeThreadStack *nts; if (!exec) @@ -136,7 +136,7 @@ static void group_execute(void *data, int thread, struct bNode *node, bNodeExecD */ { bNode *inode; - for (inode=exec->nodetree->nodes.first; inode; inode=inode->next) + for (inode = exec->nodetree->nodes.first; inode; inode = inode->next) inode->need_exec = 1; } diff --git a/source/blender/nodes/texture/nodes/node_texture_curves.c b/source/blender/nodes/texture/nodes/node_texture_curves.c index 2efe1a38615..42e3df99075 100644 --- a/source/blender/nodes/texture/nodes/node_texture_curves.c +++ b/source/blender/nodes/texture/nodes/node_texture_curves.c @@ -44,10 +44,10 @@ static bNodeSocketTemplate time_outputs[] = { static void time_colorfn(float *out, TexParams *p, bNode *node, bNodeStack **UNUSED(in), short UNUSED(thread)) { /* stack order output: fac */ - float fac= 0.0f; + float fac = 0.0f; if (node->custom1 < node->custom2) - fac = (p->cfra - node->custom1)/(float)(node->custom2-node->custom1); + fac = (p->cfra - node->custom1) / (float)(node->custom2 - node->custom1); curvemapping_initialize(node->storage); fac = curvemapping_evaluateF(node->storage, 0, fac); @@ -62,9 +62,9 @@ static void time_exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData static void time_init(bNodeTree *UNUSED(ntree), bNode *node) { - node->custom1= 1; - node->custom2= 250; - node->storage= curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); + node->custom1 = 1; + node->custom2 = 250; + node->storage = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); } void register_node_type_tex_curve_time(void) @@ -89,7 +89,7 @@ static bNodeSocketTemplate rgb_inputs[] = { static bNodeSocketTemplate rgb_outputs[] = { { SOCK_RGBA, 0, N_("Color")}, - { -1, 0, "" } + { -1, 0, ""} }; static void rgb_colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) @@ -108,7 +108,7 @@ static void rgb_exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData static void rgb_init(bNodeTree *UNUSED(ntree), bNode *node) { - node->storage= curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f); + node->storage = curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f); } void register_node_type_tex_curve_rgb(void) diff --git a/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c b/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c index 3b6ca1c2dfb..e6a99319a98 100644 --- a/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c +++ b/source/blender/nodes/texture/nodes/node_texture_hueSatVal.c @@ -50,20 +50,20 @@ static bNodeSocketTemplate outputs[] = { static void do_hue_sat_fac(bNode *UNUSED(node), float *out, float hue, float sat, float val, float *in, float fac) { if (fac != 0 && (hue != 0.5f || sat != 1 || val != 1)) { - float col[3], hsv[3], mfac= 1.0f - fac; + float col[3], hsv[3], mfac = 1.0f - fac; - rgb_to_hsv(in[0], in[1], in[2], hsv, hsv+1, hsv+2); - hsv[0]+= (hue - 0.5f); - if (hsv[0]>1.0f) hsv[0]-=1.0f; else if (hsv[0]<0.0f) hsv[0]+= 1.0f; - hsv[1]*= sat; - if (hsv[1]>1.0f) hsv[1] = 1.0f; else if (hsv[1]<0.0f) hsv[1] = 0.0f; - hsv[2]*= val; - if (hsv[2]>1.0f) hsv[2] = 1.0f; else if (hsv[2]<0.0f) hsv[2] = 0.0f; - hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2); - - out[0] = mfac*in[0] + fac*col[0]; - out[1] = mfac*in[1] + fac*col[1]; - out[2] = mfac*in[2] + fac*col[2]; + rgb_to_hsv(in[0], in[1], in[2], hsv, hsv + 1, hsv + 2); + hsv[0] += (hue - 0.5f); + if (hsv[0] > 1.0f) hsv[0] -= 1.0f; else if (hsv[0] < 0.0f) hsv[0] += 1.0f; + hsv[1] *= sat; + if (hsv[1] > 1.0f) hsv[1] = 1.0f; else if (hsv[1] < 0.0f) hsv[1] = 0.0f; + hsv[2] *= val; + if (hsv[2] > 1.0f) hsv[2] = 1.0f; else if (hsv[2] < 0.0f) hsv[2] = 0.0f; + hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col + 1, col + 2); + + out[0] = mfac * in[0] + fac * col[0]; + out[1] = mfac * in[1] + fac * col[1]; + out[2] = mfac * in[2] + fac * col[2]; } else { copy_v4_v4(out, in); diff --git a/source/blender/nodes/texture/nodes/node_texture_image.c b/source/blender/nodes/texture/nodes/node_texture_image.c index b4cd759d88f..4d9f2febf7a 100644 --- a/source/blender/nodes/texture/nodes/node_texture_image.c +++ b/source/blender/nodes/texture/nodes/node_texture_image.c @@ -42,12 +42,12 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **UNUSED(i { float x = p->co[0]; float y = p->co[1]; - Image *ima= (Image *)node->id; - ImageUser *iuser= (ImageUser *)node->storage; + Image *ima = (Image *)node->id; + ImageUser *iuser = (ImageUser *)node->storage; - if ( ima ) { + if (ima) { ImBuf *ibuf = BKE_image_acquire_ibuf(ima, iuser, NULL); - if ( ibuf ) { + if (ibuf) { float xsize, ysize; float xoff, yoff; int px, py; @@ -58,24 +58,24 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **UNUSED(i ysize = ibuf->y / 2; xoff = yoff = -1; - px = (int)( (x-xoff) * xsize ); - py = (int)( (y-yoff) * ysize ); + px = (int)( (x - xoff) * xsize); + py = (int)( (y - yoff) * ysize); if ( (!xsize) || (!ysize) ) return; - if ( !ibuf->rect_float ) { + if (!ibuf->rect_float) { BLI_lock_thread(LOCK_IMAGE); - if ( !ibuf->rect_float ) + if (!ibuf->rect_float) IMB_float_from_rect(ibuf); BLI_unlock_thread(LOCK_IMAGE); } - while ( px < 0 ) px += ibuf->x; - while ( py < 0 ) py += ibuf->y; - while ( px >= ibuf->x ) px -= ibuf->x; - while ( py >= ibuf->y ) py -= ibuf->y; + while (px < 0) px += ibuf->x; + while (py < 0) py += ibuf->y; + while (px >= ibuf->x) px -= ibuf->x; + while (py >= ibuf->y) py -= ibuf->y; - result = ibuf->rect_float + py*ibuf->x*4 + px*4; + result = ibuf->rect_float + py * ibuf->x * 4 + px * 4; copy_v4_v4(out, result); BKE_image_release_ibuf(ima, ibuf, NULL); @@ -90,18 +90,18 @@ static void exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData *exe static void init(bNodeTree *UNUSED(ntree), bNode *node) { - ImageUser *iuser= MEM_callocN(sizeof(ImageUser), "node image user"); - node->storage= iuser; - iuser->sfra= 1; - iuser->fie_ima= 2; - iuser->ok= 1; + ImageUser *iuser = MEM_callocN(sizeof(ImageUser), "node image user"); + node->storage = iuser; + iuser->sfra = 1; + iuser->fie_ima = 2; + iuser->ok = 1; } void register_node_type_tex_image(void) { static bNodeType ntype; - tex_node_type_base(&ntype, TEX_NODE_IMAGE, "Image", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS); + tex_node_type_base(&ntype, TEX_NODE_IMAGE, "Image", NODE_CLASS_INPUT, NODE_PREVIEW | NODE_OPTIONS); node_type_socket_templates(&ntype, NULL, outputs); node_type_init(&ntype, init); node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage); diff --git a/source/blender/nodes/texture/nodes/node_texture_output.c b/source/blender/nodes/texture/nodes/node_texture_output.c index bdd3b5547cb..8b36a764eca 100644 --- a/source/blender/nodes/texture/nodes/node_texture_output.c +++ b/source/blender/nodes/texture/nodes/node_texture_output.c @@ -37,7 +37,7 @@ static bNodeSocketTemplate inputs[] = { { SOCK_RGBA, 1, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, PROP_DIRECTION}, - { -1, 0, "" } + { -1, 0, ""} }; /* applies to render pipeline */ @@ -88,10 +88,10 @@ static void unique_name(bNode *node) i = node; while (i->prev) i = i->prev; - for ( ; i; i = i->next) { + for (; i; i = i->next) { if (i == node || i->type != TEX_NODE_OUTPUT || - strcmp(name, ((TexNodeOutput*)(i->storage))->name)) + !STREQ(name, ((TexNodeOutput *)(i->storage))->name)) { continue; } @@ -130,11 +130,11 @@ static void assign_index(struct bNode *node) while (tnode->prev) tnode = tnode->prev; - check_index: - for (; tnode; tnode= tnode->next) +check_index: + for (; tnode; tnode = tnode->next) if (tnode->type == TEX_NODE_OUTPUT && tnode != node) if (tnode->custom1 == index) { - index ++; + index++; goto check_index; } @@ -144,7 +144,7 @@ static void assign_index(struct bNode *node) static void init(bNodeTree *UNUSED(ntree), bNode *node) { TexNodeOutput *tno = MEM_callocN(sizeof(TexNodeOutput), "TEX_output"); - node->storage= tno; + node->storage = tno; strcpy(tno->name, "Default"); unique_name(node); @@ -162,7 +162,7 @@ void register_node_type_tex_output(void) { static bNodeType ntype; - tex_node_type_base(&ntype, TEX_NODE_OUTPUT, "Output", NODE_CLASS_OUTPUT, NODE_PREVIEW|NODE_OPTIONS); + tex_node_type_base(&ntype, TEX_NODE_OUTPUT, "Output", NODE_CLASS_OUTPUT, NODE_PREVIEW | NODE_OPTIONS); node_type_socket_templates(&ntype, inputs, NULL); node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); node_type_init(&ntype, init); diff --git a/source/blender/nodes/texture/nodes/node_texture_proc.c b/source/blender/nodes/texture/nodes/node_texture_proc.c index 26cec3f7345..b903aa6dcd6 100644 --- a/source/blender/nodes/texture/nodes/node_texture_proc.c +++ b/source/blender/nodes/texture/nodes/node_texture_proc.c @@ -94,7 +94,7 @@ static void texfn( MapFn map_inputs, short thread) { - Tex tex = *((Tex*)(node->storage)); + Tex tex = *((Tex *)(node->storage)); float col1[4], col2[4]; tex_input_rgba(col1, in[0], p, thread); tex_input_rgba(col2, in[1], p, thread); @@ -108,7 +108,7 @@ static int count_outputs(bNode *node) { bNodeSocket *sock; int num = 0; - for (sock= node->outputs.first; sock; sock= sock->next) { + for (sock = node->outputs.first; sock; sock = sock->next) { num++; } return num; @@ -121,20 +121,20 @@ static int count_outputs(bNode *node) {} #define ProcDef(name) \ - static void name##_colorfn(float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \ - { \ - texfn(result, p, node, in, 0, &name##_map_inputs, thread); \ - } \ - static void name##_normalfn(float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \ - { \ - texfn(result, p, node, in, 1, &name##_map_inputs, thread); \ - } \ - static void name##_exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out) \ - { \ - int outs = count_outputs(node); \ - if (outs >= 1) tex_output(node, execdata, in, out[0], &name##_colorfn, data); \ - if (outs >= 2) tex_output(node, execdata, in, out[1], &name##_normalfn, data); \ - } + static void name##_colorfn(float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \ + { \ + texfn(result, p, node, in, 0, &name##_map_inputs, thread); \ + } \ + static void name##_normalfn(float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \ + { \ + texfn(result, p, node, in, 1, &name##_map_inputs, thread); \ + } \ + static void name##_exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out) \ + { \ + int outs = count_outputs(node); \ + if (outs >= 1) tex_output(node, execdata, in, out[0], &name##_colorfn, data); \ + if (outs >= 2) tex_output(node, execdata, in, out[1], &name##_normalfn, data); \ + } /* --- VORONOI -- */ @@ -152,13 +152,13 @@ static bNodeSocketTemplate voronoi_inputs[] = { }; static void voronoi_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) { - tex->vn_w1 = tex_input_value(in[I+0], p, thread); - tex->vn_w2 = tex_input_value(in[I+1], p, thread); - tex->vn_w3 = tex_input_value(in[I+2], p, thread); - tex->vn_w4 = tex_input_value(in[I+3], p, thread); + tex->vn_w1 = tex_input_value(in[I + 0], p, thread); + tex->vn_w2 = tex_input_value(in[I + 1], p, thread); + tex->vn_w3 = tex_input_value(in[I + 2], p, thread); + tex->vn_w4 = tex_input_value(in[I + 3], p, thread); - tex->ns_outscale = tex_input_value(in[I+4], p, thread); - tex->noisesize = tex_input_value(in[I+5], p, thread); + tex->ns_outscale = tex_input_value(in[I + 4], p, thread); + tex->noisesize = tex_input_value(in[I + 5], p, thread); } ProcDef(voronoi) @@ -178,7 +178,7 @@ static bNodeSocketTemplate magic_inputs[] = { }; static void magic_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) { - tex->turbul = tex_input_value(in[I+0], p, thread); + tex->turbul = tex_input_value(in[I + 0], p, thread); } ProcDef(magic) @@ -191,8 +191,8 @@ static bNodeSocketTemplate marble_inputs[] = { }; static void marble_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) { - tex->noisesize = tex_input_value(in[I+0], p, thread); - tex->turbul = tex_input_value(in[I+1], p, thread); + tex->noisesize = tex_input_value(in[I + 0], p, thread); + tex->turbul = tex_input_value(in[I + 1], p, thread); } ProcDef(marble) @@ -204,7 +204,7 @@ static bNodeSocketTemplate clouds_inputs[] = { }; static void clouds_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) { - tex->noisesize = tex_input_value(in[I+0], p, thread); + tex->noisesize = tex_input_value(in[I + 0], p, thread); } ProcDef(clouds) @@ -217,8 +217,8 @@ static bNodeSocketTemplate distnoise_inputs[] = { }; static void distnoise_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) { - tex->noisesize = tex_input_value(in[I+0], p, thread); - tex->dist_amount = tex_input_value(in[I+1], p, thread); + tex->noisesize = tex_input_value(in[I + 0], p, thread); + tex->dist_amount = tex_input_value(in[I + 1], p, thread); } ProcDef(distnoise) @@ -231,8 +231,8 @@ static bNodeSocketTemplate wood_inputs[] = { }; static void wood_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) { - tex->noisesize = tex_input_value(in[I+0], p, thread); - tex->turbul = tex_input_value(in[I+1], p, thread); + tex->noisesize = tex_input_value(in[I + 0], p, thread); + tex->turbul = tex_input_value(in[I + 1], p, thread); } ProcDef(wood) @@ -249,11 +249,11 @@ static bNodeSocketTemplate musgrave_inputs[] = { }; static void musgrave_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) { - tex->mg_H = tex_input_value(in[I+0], p, thread); - tex->mg_lacunarity = tex_input_value(in[I+1], p, thread); - tex->mg_octaves = tex_input_value(in[I+2], p, thread); - tex->ns_outscale = tex_input_value(in[I+3], p, thread); - tex->noisesize = tex_input_value(in[I+4], p, thread); + tex->mg_H = tex_input_value(in[I + 0], p, thread); + tex->mg_lacunarity = tex_input_value(in[I + 1], p, thread); + tex->mg_octaves = tex_input_value(in[I + 2], p, thread); + tex->ns_outscale = tex_input_value(in[I + 3], p, thread); + tex->noisesize = tex_input_value(in[I + 4], p, thread); } ProcDef(musgrave) @@ -274,8 +274,8 @@ static bNodeSocketTemplate stucci_inputs[] = { }; static void stucci_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) { - tex->noisesize = tex_input_value(in[I+0], p, thread); - tex->turbul = tex_input_value(in[I+1], p, thread); + tex->noisesize = tex_input_value(in[I + 0], p, thread); + tex->turbul = tex_input_value(in[I + 1], p, thread); } ProcDef(stucci) @@ -284,7 +284,7 @@ ProcDef(stucci) static void init(bNodeTree *UNUSED(ntree), bNode *node) { Tex *tex = MEM_callocN(sizeof(Tex), "Tex"); - node->storage= tex; + node->storage = tex; default_tex(tex); tex->type = node->type - TEX_NODE_PROC; diff --git a/source/blender/nodes/texture/nodes/node_texture_rotate.c b/source/blender/nodes/texture/nodes/node_texture_rotate.c index 9d8daadbe22..b0812c8c654 100644 --- a/source/blender/nodes/texture/nodes/node_texture_rotate.c +++ b/source/blender/nodes/texture/nodes/node_texture_rotate.c @@ -53,13 +53,13 @@ static void rotate(float new_co[3], float a, float ax[3], const float co[3]) float perp[3]; float cp[3]; - float cos_a = cos(a * (float)(2*M_PI)); - float sin_a = sin(a * (float)(2*M_PI)); + float cos_a = cosf(a * (float)(2 * M_PI)); + float sin_a = sinf(a * (float)(2 * M_PI)); // x' = xcosa + n(n.x)(1-cosa) + (x*n)sina mul_v3_v3fl(perp, co, cos_a); - mul_v3_v3fl(para, ax, dot_v3v3(co, ax)*(1 - cos_a)); + mul_v3_v3fl(para, ax, dot_v3v3(co, ax) * (1 - cos_a)); cross_v3_v3v3(cp, ax, co); mul_v3_fl(cp, sin_a); @@ -73,7 +73,7 @@ static void colorfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack ** { float new_co[3], new_dxt[3], new_dyt[3], a, ax[3]; - a= tex_input_value(in[1], p, thread); + a = tex_input_value(in[1], p, thread); tex_input_vec(ax, in[2], p, thread); rotate(new_co, a, ax, p->co); diff --git a/source/blender/nodes/texture/nodes/node_texture_texture.c b/source/blender/nodes/texture/nodes/node_texture_texture.c index 4b9434e9c71..96fb7e3a109 100644 --- a/source/blender/nodes/texture/nodes/node_texture_texture.c +++ b/source/blender/nodes/texture/nodes/node_texture_texture.c @@ -63,7 +63,7 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor zero_v3(dyt); } - if (node->custom2 || node->need_exec==0) { + if (node->custom2 || node->need_exec == 0) { /* this node refers to its own texture tree! */ copy_v4_v4(out, (fabsf(co[0] - co[1]) < 0.01f) ? white : red); } @@ -78,7 +78,7 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor texres.nor = nor; textype = multitex_nodes(nodetex, co, dxt, dyt, p->osatex, - &texres, thread, 0, p->shi, p->mtex, NULL); + &texres, thread, 0, p->shi, p->mtex, NULL); if (textype & TEX_RGB) { copy_v4_v4(out, &texres.tr); @@ -99,7 +99,7 @@ void register_node_type_tex_texture(void) { static bNodeType ntype; - tex_node_type_base(&ntype, TEX_NODE_TEXTURE, "Texture", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS); + tex_node_type_base(&ntype, TEX_NODE_TEXTURE, "Texture", NODE_CLASS_INPUT, NODE_PREVIEW | NODE_OPTIONS); node_type_socket_templates(&ntype, inputs, outputs); node_type_exec(&ntype, NULL, NULL, exec); diff --git a/source/blender/nodes/texture/nodes/node_texture_valToNor.c b/source/blender/nodes/texture/nodes/node_texture_valToNor.c index 8cd6194b201..19a167b2dfa 100644 --- a/source/blender/nodes/texture/nodes/node_texture_valToNor.c +++ b/source/blender/nodes/texture/nodes/node_texture_valToNor.c @@ -71,9 +71,9 @@ static void normalfn(float *out, TexParams *p, bNode *UNUSED(node), bNodeStack * new_co[2] = co[2] + nabla; nor[2] = tex_input_value(in[0], &np, thread); - out[0] = val-nor[0]; - out[1] = val-nor[1]; - out[2] = val-nor[2]; + out[0] = val - nor[0]; + out[1] = val - nor[1]; + out[2] = val - nor[2]; } static void exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out) { |