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.41 by greg, Wed May 25 04:44:26 2005 UTC vs.
Revision 2.45 by greg, Fri Jun 10 16:49:42 2005 UTC

# Line 74 | Line 74 | double  specjitter = 1.;               /* specular sampling jitter
74  
75   int  backvis = 1;                       /* back face visibility */
76  
77 < int  maxdepth = 8;                      /* maximum recursion depth */
77 > int  maxdepth = -10;                    /* maximum recursion depth */
78   double  minweight = 2e-3;               /* minimum ray weight */
79  
80   char  *ambfile = NULL;                  /* ambient file name */
# 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, oputdash;
100 >                oputn, oputN, oputs, oputw, oputW, oputm, oputM, oputtilde;
101  
102   static void setoutput(char *vs);
103   static void tranotify(OBJECT obj);
# Line 148 | Line 148 | rtrace(                                /* trace rays from file */
148          char  *fname
149   )
150   {
151 <        long  vcount = hresolu>1 ? hresolu*vresolu : vresolu;
151 >        unsigned long  vcount = (hresolu > 1) ? (unsigned long)hresolu*vresolu
152 >                                              : vresolu;
153          long  nextflush = hresolu;
154          FILE  *fp;
155          double  d;
# Line 160 | Line 161 | rtrace(                                /* trace rays from file */
161                  sprintf(errmsg, "cannot open input file \"%s\"", fname);
162                  error(SYSTEM, errmsg);
163          }
163 #ifdef _WIN32
164          if (inform != 'a')
165                  SET_FILE_BINARY(fp);
166 #endif
166                                          /* set up output */
167          setoutput(outvals);
168          switch (outform) {
# Line 189 | Line 188 | rtrace(                                /* trace rays from file */
188                  d = normalize(direc);
189                  if (d == 0.0) {                         /* zero ==> flush */
190                          bogusray();
191 <                        if (--nextflush <= 0 || vcount <= 0) {
191 >                        if (--nextflush <= 0 || !vcount) {
192                                  fflush(stdout);
193                                  nextflush = hresolu;
194                          }
# Line 201 | Line 200 | rtrace(                                /* trace rays from file */
200                          else
201                                  rad(orig, direc, lim_dist ? d : 0.0);
202                                                          /* flush if time */
203 <                        if (--nextflush == 0) {
203 >                        if (!--nextflush) {
204                                  fflush(stdout);
205                                  nextflush = hresolu;
206                          }
207                  }
208                  if (ferror(stdout))
209                          error(SYSTEM, "write error");
210 <                if (--vcount == 0)                      /* check for end */
210 >                if (vcount && !--vcount)                /* check for end */
211                          break;
212          }
213          fflush(stdout);
214 <        if (vcount > 0)
215 <                error(USER, "read error");
214 >        if (vcount)
215 >                error(USER, "unexpected EOF on input");
216          if (fname != NULL)
217                  fclose(fp);
218   }
# Line 240 | Line 239 | setoutput(                             /* set up output tables */
239          while (*vs)
240                  switch (*vs++) {
241                  case 'T':                               /* trace sources */
242 +                        if (!*vs) break;
243                          trace_sources();
244                          /* fall through */
245                  case 't':                               /* trace */
246 +                        if (!*vs) break;
247                          *table = NULL;
248                          table = every_out;
249                          trace = ourtrace;
# Line 296 | Line 297 | setoutput(                             /* set up output tables */
297                  case 'M':                               /* material */
298                          *table++ = oputM;
299                          break;
300 <                case '-':                               /* dash */
301 <                        *table++ = oputdash;
300 >                case '~':                               /* tilde */
301 >                        *table++ = oputtilde;
302                          break;
303                  }
304          *table = NULL;
# Line 677 | Line 678 | oputM(                         /* print material */
678  
679  
680   static void
681 < oputdash(                       /* output dash (spacer) */
681 > oputtilde(                      /* output tilde (spacer) */
682          RAY  *r
683   )
684   {
685 <        putchar('-');
685 <        putchar('\t');
685 >        fputs("~\t", stdout);
686   }
687  
688  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines