[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57013] trunk/blender/source/blender: use math functions rather then macros for bicubic interpolation.

Campbell Barton ideasman42 at gmail.com
Sat May 25 11:33:08 CEST 2013


Revision: 57013
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57013
Author:   campbellbarton
Date:     2013-05-25 09:33:08 +0000 (Sat, 25 May 2013)
Log Message:
-----------
use math functions rather then macros for bicubic interpolation.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/intern/math_interp.c
    trunk/blender/source/blender/editors/space_node/node_draw.c

Modified: trunk/blender/source/blender/blenlib/intern/math_interp.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_interp.c	2013-05-25 09:33:05 UTC (rev 57012)
+++ trunk/blender/source/blender/blenlib/intern/math_interp.c	2013-05-25 09:33:08 UTC (rev 57013)
@@ -44,10 +44,10 @@
 static float P(float k)
 {
 	float p1, p2, p3, p4;
-	p1 = MAX2(k + 2.0f, 0);
-	p2 = MAX2(k + 1.0f, 0);
-	p3 = MAX2(k, 0);
-	p4 = MAX2(k - 1.0f, 0);
+	p1 = max_ff(k + 2.0f, 0.0f);
+	p2 = max_ff(k + 1.0f, 0.0f);
+	p3 = max_ff(k, 0.0f);
+	p4 = max_ff(k - 1.0f, 0.0f);
 	return (float)(1.0f / 6.0f) * (p1 * p1 * p1 - 4.0f * p2 * p2 * p2 + 6.0f * p3 * p3 * p3 - 4.0f * p4 * p4 * p4);
 }
 

Modified: trunk/blender/source/blender/editors/space_node/node_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/node_draw.c	2013-05-25 09:33:05 UTC (rev 57012)
+++ trunk/blender/source/blender/editors/space_node/node_draw.c	2013-05-25 09:33:08 UTC (rev 57013)
@@ -357,7 +357,7 @@
 		uiBlockLayoutResolve(node->block, NULL, &buty);
 		
 		/* ensure minimum socket height in case layout is empty */
-		buty = MIN2(buty, dy - NODE_DY);
+		buty = min_ii(buty, dy - NODE_DY);
 		
 		nsock->locx = locx + NODE_WIDTH(node);
 		/* place the socket circle in the middle of the layout */
@@ -444,7 +444,7 @@
 		uiBlockLayoutResolve(node->block, NULL, &buty);
 		
 		/* ensure minimum socket height in case layout is empty */
-		buty = MIN2(buty, dy - NODE_DY);
+		buty = min_ii(buty, dy - NODE_DY);
 		
 		nsock->locx = locx;
 		/* place the socket circle in the middle of the layout */




More information about the Bf-blender-cvs mailing list