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.43 by greg, Thu Jun 2 04:47:27 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 160 | Line 160 | rtrace(                                /* trace rays from file */
160                  sprintf(errmsg, "cannot open input file \"%s\"", fname);
161                  error(SYSTEM, errmsg);
162          }
163 #ifdef _WIN32
163          if (inform != 'a')
164                  SET_FILE_BINARY(fp);
166 #endif
165                                          /* set up output */
166          setoutput(outvals);
167          switch (outform) {
# Line 213 | Line 211 | rtrace(                                /* trace rays from file */
211          }
212          fflush(stdout);
213          if (vcount > 0)
214 <                error(USER, "read error");
214 >                error(USER, "unexpected EOF on input");
215          if (fname != NULL)
216                  fclose(fp);
217   }
# Line 240 | Line 238 | setoutput(                             /* set up output tables */
238          while (*vs)
239                  switch (*vs++) {
240                  case 'T':                               /* trace sources */
241 +                        if (!*vs) break;
242                          trace_sources();
243                          /* fall through */
244                  case 't':                               /* trace */
245 +                        if (!*vs) break;
246                          *table = NULL;
247                          table = every_out;
248                          trace = ourtrace;
# Line 288 | Line 288 | setoutput(                             /* set up output tables */
288                          *table++ = oputW;
289                          if (ambounce > 0 && (ambacc > FTINY || ambssamp > 0))
290                                  error(WARNING,
291 <                                        "-otW accuracy requires -aa 0 -as 0");
291 >                                        "-otW accuracy depends on -aa 0 -as 0");
292                          break;
293                  case 'm':                               /* modifier */
294                          *table++ = oputm;
# Line 296 | Line 296 | setoutput(                             /* set up output tables */
296                  case 'M':                               /* material */
297                          *table++ = oputM;
298                          break;
299 +                case '~':                               /* tilde */
300 +                        *table++ = oputtilde;
301 +                        break;
302                  }
303          *table = NULL;
304   }
# Line 463 | Line 466 | ourtrace(                              /* print ray values */
466          tabin(r);
467          for (tp = every_out; *tp != NULL; tp++)
468                  (**tp)(r);
469 <        putchar('\n');
469 >        if (outform == 'a')
470 >                putchar('\n');
471   }
472  
473  
# Line 506 | Line 510 | oputv(                         /* print value */
510          RAY  *r
511   )
512   {
509        COLR  cout;
510        
513          if (outform == 'c') {
514 +                COLR  cout;
515                  setcolr(cout,   colval(r->rcol,RED),
516                                  colval(r->rcol,GRN),
517                                  colval(r->rcol,BLU));
# Line 631 | Line 634 | oputW(                         /* print contribution */
634   )
635   {
636          COLOR   contr;
634        COLR    cout;
637  
638          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        }
639          (*putreal)(colval(contr,RED));
640          (*putreal)(colval(contr,GRN));
641          (*putreal)(colval(contr,BLU));
# Line 678 | Line 673 | oputM(                         /* print material */
673          } else
674                  putchar('*');
675          putchar('\t');
676 + }
677 +
678 +
679 + static void
680 + oputtilde(                      /* output tilde (spacer) */
681 +        RAY  *r
682 + )
683 + {
684 +        fputs("~\t", stdout);
685   }
686  
687  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines