use math functions rather then macros for bicubic interpolation.

This commit is contained in:
Campbell Barton
2013-05-25 09:33:08 +00:00
parent 08be3e06d9
commit e63ab3505f
2 changed files with 6 additions and 6 deletions

View File

@@ -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);
}

View File

@@ -357,7 +357,7 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
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 @@ static void node_update_basis(const bContext *C, bNodeTree *ntree, bNode *node)
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 */