diff options
author | Robin Allen <roblovski@gmail.com> | 2009-08-18 00:30:11 +0400 |
---|---|---|
committer | Robin Allen <roblovski@gmail.com> | 2009-08-18 00:30:11 +0400 |
commit | f9ceeeede672a634913188c775e020c23170f4e1 (patch) | |
tree | 1f1068e7d4b118dd44795bc6412b46d36230fd28 /source/blender/nodes/intern/TEX_nodes/TEX_texture.c | |
parent | 9f5d25748397aad6a4347f40c7ec6c025dc93129 (diff) |
Slight refactor of texture nodes.
Delegates now receive a TexParams* instead of float *coords. This gives texture nodes access to dxt, dyt, cfra as well as coords. This fixes the time node and allows nice sampling to be implemented.
Diffstat (limited to 'source/blender/nodes/intern/TEX_nodes/TEX_texture.c')
-rw-r--r-- | source/blender/nodes/intern/TEX_nodes/TEX_texture.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_texture.c b/source/blender/nodes/intern/TEX_nodes/TEX_texture.c index 30492b84764..0ca80a82271 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_texture.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_texture.c @@ -21,7 +21,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Robin Allen * * ***** END GPL LICENSE BLOCK ***** */ @@ -40,10 +40,11 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { static float red[] = {1,0,0,1}; static float white[] = {1,1,1,1}; + float *coord = p->coord; Tex *nodetex = (Tex *)node->id; @@ -60,8 +61,8 @@ static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, shor float nor[] = {0,0,0}; float col1[4], col2[4]; - tex_input_rgba(col1, in[0], coord, thread); - tex_input_rgba(col2, in[1], coord, thread); + tex_input_rgba(col1, in[0], p, thread); + tex_input_rgba(col2, in[1], p, thread); texres.nor = nor; textype = multitex_ext(nodetex, coord, 0, 0, 0, &texres); |