97 |
|
|
98 |
|
typedef void oputf_t(RAY *r); |
99 |
|
static oputf_t oputo, oputd, oputv, oputl, oputL, oputc, oputp, |
100 |
< |
oputn, oputN, oputs, oputw, oputW, oputm, oputM; |
100 |
> |
oputn, oputN, oputs, oputw, oputW, oputm, oputM, oputtilde; |
101 |
|
|
102 |
|
static void setoutput(char *vs); |
103 |
|
static void tranotify(OBJECT obj); |
213 |
|
} |
214 |
|
fflush(stdout); |
215 |
|
if (vcount > 0) |
216 |
< |
error(USER, "read error"); |
216 |
> |
error(USER, "unexpected EOF on input"); |
217 |
|
if (fname != NULL) |
218 |
|
fclose(fp); |
219 |
|
} |
240 |
|
while (*vs) |
241 |
|
switch (*vs++) { |
242 |
|
case 'T': /* trace sources */ |
243 |
+ |
if (!*vs) break; |
244 |
|
trace_sources(); |
245 |
|
/* fall through */ |
246 |
|
case 't': /* trace */ |
247 |
+ |
if (!*vs) break; |
248 |
|
*table = NULL; |
249 |
|
table = every_out; |
250 |
|
trace = ourtrace; |
290 |
|
*table++ = oputW; |
291 |
|
if (ambounce > 0 && (ambacc > FTINY || ambssamp > 0)) |
292 |
|
error(WARNING, |
293 |
< |
"-otW accuracy requires -aa 0 -as 0"); |
293 |
> |
"-otW accuracy depends on -aa 0 -as 0"); |
294 |
|
break; |
295 |
|
case 'm': /* modifier */ |
296 |
|
*table++ = oputm; |
298 |
|
case 'M': /* material */ |
299 |
|
*table++ = oputM; |
300 |
|
break; |
301 |
+ |
case '~': /* tilde */ |
302 |
+ |
*table++ = oputtilde; |
303 |
+ |
break; |
304 |
|
} |
305 |
|
*table = NULL; |
306 |
|
} |
468 |
|
tabin(r); |
469 |
|
for (tp = every_out; *tp != NULL; tp++) |
470 |
|
(**tp)(r); |
471 |
< |
putchar('\n'); |
471 |
> |
if (outform == 'a') |
472 |
> |
putchar('\n'); |
473 |
|
} |
474 |
|
|
475 |
|
|
512 |
|
RAY *r |
513 |
|
) |
514 |
|
{ |
509 |
– |
COLR cout; |
510 |
– |
|
515 |
|
if (outform == 'c') { |
516 |
+ |
COLR cout; |
517 |
|
setcolr(cout, colval(r->rcol,RED), |
518 |
|
colval(r->rcol,GRN), |
519 |
|
colval(r->rcol,BLU)); |
636 |
|
) |
637 |
|
{ |
638 |
|
COLOR contr; |
634 |
– |
COLR cout; |
639 |
|
|
640 |
|
raycontrib(contr, r, PRIMARY); |
637 |
– |
if (outform == 'c') { |
638 |
– |
setcolr(cout, colval(contr,RED), |
639 |
– |
colval(contr,GRN), |
640 |
– |
colval(contr,BLU)); |
641 |
– |
fwrite((char *)cout, sizeof(cout), 1, stdout); |
642 |
– |
return; |
643 |
– |
} |
641 |
|
(*putreal)(colval(contr,RED)); |
642 |
|
(*putreal)(colval(contr,GRN)); |
643 |
|
(*putreal)(colval(contr,BLU)); |
675 |
|
} else |
676 |
|
putchar('*'); |
677 |
|
putchar('\t'); |
678 |
+ |
} |
679 |
+ |
|
680 |
+ |
|
681 |
+ |
static void |
682 |
+ |
oputtilde( /* output tilde (spacer) */ |
683 |
+ |
RAY *r |
684 |
+ |
) |
685 |
+ |
{ |
686 |
+ |
fputs("~\t", stdout); |
687 |
|
} |
688 |
|
|
689 |
|
|