| 908 |
|
static int |
| 909 |
|
prepare_sampler(PARAMS *p) |
| 910 |
|
{ |
| 911 |
< |
if (p->slist == NULL) { /* missing sample surface! */ |
| 912 |
< |
error(USER, "no sender surface"); |
| 911 |
> |
if (p->slist == NULL) { /* missing sample surface! */ |
| 912 |
> |
fputs(progname, stderr); |
| 913 |
> |
fputs(": no sender surface!\n", stderr); |
| 914 |
|
return(-1); |
| 915 |
|
} |
| 916 |
|
/* misplaced output file spec. */ |
| 917 |
< |
if (p->outfn[0]) { |
| 918 |
< |
sprintf(errmsg, "ignoring output file in sender ('%s')", |
| 919 |
< |
p->outfn); |
| 919 |
< |
error(WARNING, errmsg); |
| 920 |
< |
} |
| 917 |
> |
if ((p->outfn != NULL) & !(verbose & NOWARN)) |
| 918 |
> |
fprintf(stderr, "%s: warning - ignoring output file in sender ('%s')\n", |
| 919 |
> |
progname, p->outfn); |
| 920 |
|
/* check/set basis hemisphere */ |
| 921 |
|
if (!p->hemis[0]) { |
| 922 |
< |
error(USER, "missing sender sampling type"); |
| 922 |
> |
fputs(progname, stderr); |
| 923 |
> |
fputs(": missing sender sampling type!\n", stderr); |
| 924 |
|
return(-1); |
| 925 |
|
} |
| 926 |
|
if (normalize(p->nrm) == 0) { |
| 927 |
< |
error(USER, "undefined normal for sender sampling"); |
| 927 |
> |
fputs(progname, stderr); |
| 928 |
> |
fputs(": undefined normal for sender sampling\n", stderr); |
| 929 |
|
return(-1); |
| 930 |
|
} |
| 931 |
|
if (normalize(p->vup) == 0) { |
| 936 |
|
} |
| 937 |
|
fcross(p->udir, p->vup, p->nrm); |
| 938 |
|
if (normalize(p->udir) == 0) { |
| 939 |
< |
error(USER, "up vector coincides with sender normal"); |
| 939 |
> |
fputs(progname, stderr); |
| 940 |
> |
fputs(": up vector coincides with sender normal\n", stderr); |
| 941 |
|
return(-1); |
| 942 |
|
} |
| 943 |
|
fcross(p->vdir, p->nrm, p->udir); |
| 944 |
< |
if (p->sign == '-') { /* left-handed coordinate system? */ |
| 944 |
> |
if (p->sign == '-') { /* left-handed coordinate system? */ |
| 945 |
|
p->udir[0] *= -1.; |
| 946 |
|
p->udir[1] *= -1.; |
| 947 |
|
p->udir[2] *= -1.; |