Scanfill: avoid converting int<>intptr_t for displist indices

This commit is contained in:
2014-02-06 01:07:18 +11:00
parent 41d23116aa
commit 6213d88c85
2 changed files with 8 additions and 9 deletions

View File

@@ -458,7 +458,7 @@ void BKE_displist_fill(ListBase *dispbase, ListBase *to, const float normal_proj
DispList *dlnew = NULL, *dl; DispList *dlnew = NULL, *dl;
float *f1; float *f1;
int colnr = 0, charidx = 0, cont = 1, tot, a, *index, nextcol = 0; int colnr = 0, charidx = 0, cont = 1, tot, a, *index, nextcol = 0;
intptr_t totvert; int totvert;
if (dispbase == NULL) if (dispbase == NULL)
return; return;
@@ -541,23 +541,22 @@ void BKE_displist_fill(ListBase *dispbase, ListBase *to, const float normal_proj
f1 += 3; f1 += 3;
/* index number */ /* index number */
sf_vert->tmp.l = totvert; sf_vert->tmp.i = totvert;
totvert++; totvert++;
} }
/* index data */ /* index data */
sf_tri = sf_ctx.fillfacebase.first;
index = dlnew->index; index = dlnew->index;
while (sf_tri) { for (sf_tri = sf_ctx.fillfacebase.first; sf_tri; sf_tri = sf_tri->next) {
index[0] = (intptr_t)sf_tri->v1->tmp.l; index[0] = sf_tri->v1->tmp.i;
index[1] = (intptr_t)sf_tri->v2->tmp.l; index[1] = sf_tri->v2->tmp.i;
index[2] = (intptr_t)sf_tri->v3->tmp.l; index[2] = sf_tri->v3->tmp.i;
if (flipnormal) if (flipnormal)
SWAP(int, index[0], index[2]); SWAP(int, index[0], index[2]);
index += 3; index += 3;
sf_tri = sf_tri->next;
} }
} }

View File

@@ -61,7 +61,7 @@ typedef struct ScanFillVert {
union { union {
struct ScanFillVert *v; struct ScanFillVert *v;
void *p; void *p;
intptr_t l; int i;
unsigned int u; unsigned int u;
} tmp; } tmp;
float co[3]; /* vertex location */ float co[3]; /* vertex location */