1000 |
|
case ST_SOURCE: |
1001 |
|
if (snew->nfargs != 4) |
1002 |
|
goto badcount; |
1003 |
< |
VCOPY(snew->snrm, snew->farg); |
1003 |
> |
for (n = 3; n--; ) /* need to reverse "normal" */ |
1004 |
> |
snew->snrm[n] = -snew->farg[n]; |
1005 |
|
if (normalize(snew->snrm) == 0) |
1006 |
|
goto badnorm; |
1007 |
|
snew->area = sin((PI/180./2.)*snew->farg[3]); |
1064 |
|
return(1); |
1065 |
|
} |
1066 |
|
/* else skip arguments */ |
1067 |
< |
if (!fscanf(fp, "%d", &n)) return; |
1067 |
> |
if (!fscanf(fp, "%d", &n)) return(0); |
1068 |
|
while (n-- > 0) fscanf(fp, "%*s"); |
1069 |
|
if (!fscanf(fp, "%d", &n)) return; |
1070 |
|
while (n-- > 0) fscanf(fp, "%*d"); |
1100 |
|
return(0); |
1101 |
|
} |
1102 |
|
/* else skip arguments */ |
1103 |
< |
if (!fscanf(fp, "%d", &n)) return; |
1103 |
> |
if (!fscanf(fp, "%d", &n)) return(0); |
1104 |
|
while (n-- > 0) fscanf(fp, "%*s"); |
1105 |
|
if (!fscanf(fp, "%d", &n)) return; |
1106 |
|
while (n-- > 0) fscanf(fp, "%*d"); |
1172 |
|
{ |
1173 |
|
char fmtopt[6] = "-faa"; /* default output is ASCII */ |
1174 |
|
char *xrs=NULL, *yrs=NULL, *ldopt=NULL; |
1175 |
+ |
int wantIrradiance = 0; |
1176 |
|
char *sendfn; |
1177 |
|
char sampcntbuf[32], nsbinbuf[32]; |
1178 |
|
FILE *rcfp; |
1220 |
|
goto userr; |
1221 |
|
na = 0; /* we re-add this later */ |
1222 |
|
continue; |
1223 |
+ |
case 'I': /* only for pass-through mode */ |
1224 |
+ |
wantIrradiance = 1; |
1225 |
+ |
na = 0; |
1226 |
+ |
continue; |
1227 |
|
case 'V': /* options without arguments */ |
1228 |
|
case 'w': |
1229 |
|
case 'u': |
1275 |
|
if (sendfn[0] == '-') { /* user wants pass-through mode? */ |
1276 |
|
if (sendfn[1]) goto userr; |
1277 |
|
sendfn = NULL; |
1278 |
+ |
if (wantIrradiance) { |
1279 |
+ |
CHECKARGC(1); |
1280 |
+ |
rcarg[nrcargs++] = "-I"; |
1281 |
+ |
} |
1282 |
|
if (xrs) { |
1283 |
|
CHECKARGC(2); |
1284 |
|
rcarg[nrcargs++] = "-x"; |
1294 |
|
rcarg[nrcargs++] = ldopt; |
1295 |
|
} |
1296 |
|
if (sampcnt <= 0) sampcnt = 1; |
1297 |
< |
} else { /* else FVECT determines input format */ |
1297 |
> |
} else { /* else in sampling mode */ |
1298 |
> |
if (wantIrradiance) { |
1299 |
> |
fputs(progname, stderr); |
1300 |
> |
fputs(": -I supported for pass-through only\n", stderr); |
1301 |
> |
return(1); |
1302 |
> |
} |
1303 |
|
fmtopt[2] = (sizeof(RREAL)==sizeof(double)) ? 'd' : 'f'; |
1304 |
|
if (sampcnt <= 0) sampcnt = 10000; |
1305 |
|
} |