ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/rtrace.c
(Generate patch)

Comparing ray/src/rt/rtrace.c (file contents):
Revision 2.40 by greg, Tue Apr 19 01:15:06 2005 UTC vs.
Revision 2.42 by greg, Thu May 26 06:55:22 2005 UTC

# Line 97 | Line 97 | static putf_t puta, putd, putf;
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);
# Line 213 | Line 213 | rtrace(                                /* trace rays from file */
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   }
# Line 240 | Line 240 | setoutput(                             /* set up output tables */
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;
# Line 288 | Line 290 | setoutput(                             /* set up output tables */
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;
# Line 296 | Line 298 | setoutput(                             /* set up output tables */
298                  case 'M':                               /* material */
299                          *table++ = oputM;
300                          break;
301 +                case '~':                               /* tilde */
302 +                        *table++ = oputtilde;
303 +                        break;
304                  }
305          *table = NULL;
306   }
# Line 463 | Line 468 | ourtrace(                              /* print ray values */
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  
# Line 506 | Line 512 | oputv(                         /* print value */
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));
# Line 631 | Line 636 | oputW(                         /* print contribution */
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));
# Line 678 | Line 675 | oputM(                         /* print material */
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines