517 |
|
sp->wmax = wid; |
518 |
|
if (sp->alen >= sp->nall) { /* need more space? */ |
519 |
|
struct outdir_s *ndarr; |
520 |
< |
sp->nall += 1024; |
520 |
> |
sp->nall = (int)(1.5*sp->nall) + 256; |
521 |
|
ndarr = (struct outdir_s *)realloc(sp->darr, |
522 |
|
sizeof(struct outdir_s)*sp->nall); |
523 |
|
if (ndarr == NULL) { |
721 |
|
/* get projected solid angle(s) */ |
722 |
|
if (v2 != NULL) { |
723 |
|
const SDTre *sdt = (SDTre *)sdc->dist; |
724 |
< |
double hcube[SD_MAXDIM]; |
724 |
> |
double hcube[SD_MAXDIM+1]; |
725 |
|
if (SDqueryTre(sdt, v1, v2, hcube) < 0) { |
726 |
|
strcpy(SDerrorDetail, "Bad call to SDqueryTreProjSA"); |
727 |
|
return SDEinternal; |
804 |
|
/* emit from back? */ |
805 |
|
if ((cd->sidef == SD_BREFL) | (cd->sidef == SD_FXMIT)) |
806 |
|
gpos[2] = -gpos[2]; |
807 |
< |
if (cd->isodist) { /* rotate isotropic result */ |
807 |
> |
if (cd->isodist) { /* rotate isotropic sample */ |
808 |
|
rotangle = atan2(-ioVec[1],-ioVec[0]); |
809 |
< |
VCOPY(ioVec, gpos); |
810 |
< |
spinvector(ioVec, ioVec, zvec, rotangle); |
809 |
> |
spinvector(ioVec, gpos, zvec, rotangle); |
810 |
|
} else |
811 |
|
VCOPY(ioVec, gpos); |
812 |
|
return SDEnone; |