From dda7e3b69565c5701207a640201a1c8052f76743 Mon Sep 17 00:00:00 2001 From: Aaron Carlisle Date: Thu, 19 Apr 2018 18:41:06 -0400 Subject: VSE Effects: Wipe box: fix compilation errors This is still broken I cant tell if it is the fact that the in_band funtion does not work properally or an issue in the box algorithm, or both. It seems like the calculation of the size of the box while roatated needs to be fixed also. --- source/blender/blenkernel/intern/seqeffects.c | 28 ++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 49f120de250..176d1224979 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -1767,12 +1767,13 @@ static float check_zone(WipeZone *wipezone, int x, int y, Sequence *seq, float f if (output != output) output = 1; if (wipe->forward) output = 1 - output; break; - /* BOX WIPE IS NOT WORKING YET */ + /* BOX WIPE IS NOT WORKING YET */ /* case DO_CROSS_WIPE: */ /* BOX WIPE IS NOT WORKING YET */ #if 0 case DO_BOX_WIPE: - if (invert) facf0 = 1 - facf0; + if (!wipe->forward) + facf0 = 1.0f - facf0; /* Go the other direction */ width = (int)(wipe->edgeWidth * ((xo + yo) / 2.0)); hwidth = (float)width / 2.0; @@ -1790,22 +1791,23 @@ static float check_zone(WipeZone *wipezone, int x, int y, Sequence *seq, float f if (b2 < b1 && b2 < b3) { if (hwidth < pointdist) - output = in_band(wipezone, hwidth, hyp, facf0, 0, 1); + output = in_band(hwidth, hyp, 0, 1); } else if (b2 > b1 && b2 > b3) { if (hwidth < pointdist) - output = in_band(wipezone, hwidth, hyp2, facf0, 0, 1); + output = in_band(hwidth, hyp2, 0, 1); } else { if (hyp < hwidth && hyp2 > hwidth) - output = in_band(wipezone, hwidth, hyp, facf0, 1, 1); + output = in_band(hwidth, hyp, 1, 1); else if (hyp > hwidth && hyp2 < hwidth) - output = in_band(wipezone, hwidth, hyp2, facf0, 1, 1); + output = in_band(hwidth, hyp2, 1, 1); else - output = in_band(wipezone, hwidth, hyp2, facf0, 1, 1) * in_band(wipezone, hwidth, hyp, facf0, 1, 1); + output = in_band(hwidth, hyp2, 1, 1) * in_band(hwidth, hyp, 1, 1); } - if (invert) facf0 = 1 - facf0; + if (!wipe->forward) + facf0 = 1.0f - facf0; /* Go the other direction */ angle = -1 / angle; b1 = posy / 2 - (-angle) * posx / 2; b3 = (yo - posy / 2) - (-angle) * (xo - posx / 2); @@ -1816,19 +1818,19 @@ static float check_zone(WipeZone *wipezone, int x, int y, Sequence *seq, float f if (b2 < b1 && b2 < b3) { if (hwidth < pointdist) - output *= in_band(wipezone, hwidth, hyp, facf0, 0, 1); + output *= in_band(hwidth, hyp, 0, 1); } else if (b2 > b1 && b2 > b3) { if (hwidth < pointdist) - output *= in_band(wipezone, hwidth, hyp2, facf0, 0, 1); + output *= in_band(hwidth, hyp2, 0, 1); } else { if (hyp < hwidth && hyp2 > hwidth) - output *= in_band(wipezone, hwidth, hyp, facf0, 1, 1); + output *= in_band(hwidth, hyp, 1, 1); else if (hyp > hwidth && hyp2 < hwidth) - output *= in_band(wipezone, hwidth, hyp2, facf0, 1, 1); + output *= in_band(hwidth, hyp2, 1, 1); else - output *= in_band(wipezone, hwidth, hyp2, facf0, 1, 1) * in_band(wipezone, hwidth, hyp, facf0, 1, 1); + output *= in_band(hwidth, hyp2, 1, 1) * in_band(hwidth, hyp, 1, 1); } break; -- cgit v1.2.3