diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-03-27 00:31:21 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-03-27 01:30:14 +0400 |
commit | 20a4e338379581e4ca8c96f3fc1d8bad76e8ee36 (patch) | |
tree | 16ecd09c9eabe97bf21a50dc42a27ee38a8f3631 /source/blender/blenlib/intern | |
parent | f26492d3e814af416fe96c69ee22db915bbb3d13 (diff) |
Code cleanup: use consistent arg order for math api poly funcs
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r-- | source/blender/blenlib/intern/math_geom.c | 15 | ||||
-rw-r--r-- | source/blender/blenlib/intern/polyfill2d.c | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 72b8f1ce024..6a812814afe 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -134,12 +134,13 @@ float area_tri_signed_v3(const float v1[3], const float v2[3], const float v3[3] return area; } -float area_poly_v3(int nr, float verts[][3], const float normal[3]) +float area_poly_v3(const float verts[][3], unsigned int nr, const float normal[3]) { - int a, px, py; + unsigned int a; + int px, py; const float max = axis_dominant_v3_max(&px, &py, normal); float area; - float *co_curr, *co_prev; + const float *co_curr, *co_prev; /* The Trapezium Area Rule */ co_prev = verts[nr - 1]; @@ -154,9 +155,9 @@ float area_poly_v3(int nr, float verts[][3], const float normal[3]) return fabsf(0.5f * area / max); } -float cross_poly_v2(int nr, float verts[][2]) +float cross_poly_v2(const float verts[][2], unsigned int nr) { - int a; + unsigned int a; float cross; const float *co_curr, *co_prev; @@ -173,9 +174,9 @@ float cross_poly_v2(int nr, float verts[][2]) return cross; } -float area_poly_v2(int nr, float verts[][2]) +float area_poly_v2(const float verts[][2], unsigned int nr) { - return fabsf(0.5f * cross_poly_v2(nr, verts)); + return fabsf(0.5f * cross_poly_v2(verts, nr)); } /********************************* Planes **********************************/ diff --git a/source/blender/blenlib/intern/polyfill2d.c b/source/blender/blenlib/intern/polyfill2d.c index 0b1b461ff73..6dff597c530 100644 --- a/source/blender/blenlib/intern/polyfill2d.c +++ b/source/blender/blenlib/intern/polyfill2d.c @@ -400,7 +400,7 @@ void BLI_polyfill_calc_ex( pf.tris_tot = 0; if ((coords_tot < 3) || - cross_poly_v2((int)coords_tot, (float(*)[2])coords) > 0.0f) + cross_poly_v2(coords, coords_tot) > 0.0f) { for (i = 0; i < coords_tot; i++) { indices[i] = i; |