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:
authorRobin Allen <roblovski@gmail.com>2009-08-18 00:30:11 +0400
committerRobin Allen <roblovski@gmail.com>2009-08-18 00:30:11 +0400
commitf9ceeeede672a634913188c775e020c23170f4e1 (patch)
tree1f1068e7d4b118dd44795bc6412b46d36230fd28 /source/blender/nodes/intern/TEX_nodes/TEX_checker.c
parent9f5d25748397aad6a4347f40c7ec6c025dc93129 (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_checker.c')
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_checker.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_checker.c b/source/blender/nodes/intern/TEX_nodes/TEX_checker.c
index 60357782e25..b889f1e2164 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_checker.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_checker.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,12 +40,12 @@ 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)
{
- float x = coord[0];
- float y = coord[1];
- float z = coord[2];
- float sz = tex_input_value(in[2], coord, thread);
+ float x = p->coord[0];
+ float y = p->coord[1];
+ float z = p->coord[2];
+ float sz = tex_input_value(in[2], p, thread);
/* 0.00001 because of unit sized stuff */
int xi = (int)fabs(floor(0.00001 + x / sz));
@@ -53,9 +53,9 @@ static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, shor
int zi = (int)fabs(floor(0.00001 + z / sz));
if( (xi % 2 == yi % 2) == (zi % 2) ) {
- tex_input_rgba(out, in[0], coord, thread);
+ tex_input_rgba(out, in[0], p, thread);
} else {
- tex_input_rgba(out, in[1], coord, thread);
+ tex_input_rgba(out, in[1], p, thread);
}
}