64 |
|
FVECT uva[2]; /* tangent axes */ |
65 |
|
int ntris; /* number of triangles */ |
66 |
|
struct ptri { |
67 |
< |
float afrac; /* fraction of total area */ |
67 |
> |
double afrac; /* fraction of total area */ |
68 |
|
short vndx[3]; /* vertex indices */ |
69 |
|
} tri[1]; /* triangle array (extends struct) */ |
70 |
|
} POLYTRIS; /* triangulated polygon */ |
602 |
|
sp->priv = (void *)ptp; |
603 |
|
} |
604 |
|
/* pick triangle by partial area */ |
605 |
< |
for (i = 0; i < ptp->ntris && x > ptp->tri[i].afrac; i++) |
605 |
> |
for (i = 0; i < ptp->ntris-1 && x > ptp->tri[i].afrac; i++) |
606 |
|
x -= ptp->tri[i].afrac; |
607 |
|
SDmultiSamp(samp2, 2, x/ptp->tri[i].afrac); |
608 |
|
samp2[0] *= samp2[1] = sqrt(samp2[1]); |
1305 |
|
fputs(": -i, -I supported for pass-through only\n", stderr); |
1306 |
|
return(1); |
1307 |
|
} |
1308 |
< |
fmtopt[2] = (sizeof(RREAL)==sizeof(double)) ? 'd' : 'f'; |
1308 |
> |
#ifdef SMLFLT |
1309 |
> |
fmtopt[2] = 'f'; |
1310 |
> |
#else |
1311 |
> |
fmtopt[2] = 'd'; |
1312 |
> |
#endif |
1313 |
|
if (sampcnt <= 0) sampcnt = 10000; |
1314 |
|
} |
1315 |
|
sprintf(sampcntbuf, "%d", sampcnt); |