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:
authorRobert Holcomb <bob_holcomb@hotmail.com>2007-07-10 06:06:10 +0400
committerRobert Holcomb <bob_holcomb@hotmail.com>2007-07-10 06:06:10 +0400
commit1d66563d9595d2036981decdec6978ebd90e588f (patch)
treeccdafa936a8106a1ed3652643eaacd059d8d8114 /source/blender/nodes/intern/CMP_nodes/CMP_math.c
parent4f01085709908e5626c735b01d6c2202236f41e6 (diff)
Committed patch fixing bug #6900. Math node now has reflective
behavior.
Diffstat (limited to 'source/blender/nodes/intern/CMP_nodes/CMP_math.c')
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_math.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_math.c b/source/blender/nodes/intern/CMP_nodes/CMP_math.c
index 27d7da16a59..e7b548052ee 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_math.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_math.c
@@ -137,21 +137,30 @@ static void do_math(bNode *node, float *out, float *in, float *in2)
static void node_composit_exec_math(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
{
+ CompBuf *cbuf=in[0]->data;
+ CompBuf *cbuf2=in[1]->data;
+ CompBuf *stackbuf;
+ int maxx=-1, maxy=-1;
+
/* stack order out: bw */
/* stack order in: col */
if(out[0]->hasoutput==0)
return;
-
- /* input no image? then only color operation */
- if(in[0]->data==NULL) {
- do_math(node, out[0]->vec, in[0]->vec, in[1]->vec);
+ /* check max size */
+ if(cbuf) {
+ maxx=cbuf->x;
+ maxy=cbuf->y;
}
- else {
- /* make output size of input image */
- CompBuf *cbuf= in[0]->data;
- CompBuf *stackbuf= alloc_compbuf(cbuf->x, cbuf->y, CB_VAL, 1); /* allocs */
-
+ if(cbuf2) {
+ if(cbuf2->x > maxx) maxx=cbuf2->x;
+ if(cbuf2->y > maxy) maxy=cbuf2->y;
+ }
+
+ /* operate in case there's valid size */
+ if((maxx != -1) && (maxy !=-1)) {
+ stackbuf=alloc_compbuf(maxx, maxy, CB_VAL, 1); /* allocs */
+
composit2_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[1]->data, in[1]->vec, do_math, CB_VAL, CB_VAL);
out[0]->data= stackbuf;