diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-10 15:34:52 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-10 15:34:52 +0300 |
commit | 7daabec53482a5b0700f19a0d03ed7ae60d1e1a2 (patch) | |
tree | 8f5793fa08dad9a82cd31525a83e9a42051a6703 /source/blender/blenlib | |
parent | 763e8d0bec3c49ca3f1644ef551f1e0cfdf30adf (diff) |
mesh validation: bugfix for removing doubles, another fix coming...
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_boxpack2d.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/boxpack2d.c | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/blenlib/BLI_boxpack2d.h b/source/blender/blenlib/BLI_boxpack2d.h index a83e4c28882..008af55e1d0 100644 --- a/source/blender/blenlib/BLI_boxpack2d.h +++ b/source/blender/blenlib/BLI_boxpack2d.h @@ -41,5 +41,5 @@ typedef struct boxPack { struct boxVert *v[4]; } boxPack; -void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height); +void boxPack2D(boxPack *boxarray, const int len, float *tot_width, float *tot_height); diff --git a/source/blender/blenlib/intern/boxpack2d.c b/source/blender/blenlib/intern/boxpack2d.c index b20a42f5cf8..643dcb6efca 100644 --- a/source/blender/blenlib/intern/boxpack2d.c +++ b/source/blender/blenlib/intern/boxpack2d.c @@ -100,12 +100,10 @@ typedef struct boxVert { /* qsort function - sort largest to smallest */ static int box_areasort(const void *p1, const void *p2) { - const boxPack *b1=p1, *b2=p2; - float a1, a2; + const boxPack *b1= p1, *b2= p2; + const float a1= BOXAREA(b1); + const float a2= BOXAREA(b2); - a1 = BOXAREA(b1); - a2 = BOXAREA(b2); - if ( a1 < a2 ) return 1; else if ( a1 > a2 ) return -1; return 0; @@ -149,7 +147,7 @@ static int vertex_sort(const void *p1, const void *p2) * len - the number of boxes in the array. * tot_width and tot_height are set so you can normalize the data. * */ -void boxPack2D(boxPack *boxarray, int len, float *tot_width, float *tot_height) +void boxPack2D(boxPack *boxarray, const int len, float *tot_width, float *tot_height) { boxVert *vert; /* the current vert */ int box_index, verts_pack_len, i, j, k, isect; |