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.60 by greg, Mon Dec 14 03:15:45 2009 UTC vs.
Revision 2.64 by greg, Sun Sep 26 15:49:39 2010 UTC

# Line 115 | Line 115 | rtrace(                                /* trace rays from file */
115   {
116          unsigned long  vcount = (hresolu > 1) ? (unsigned long)hresolu*vresolu
117                                                : vresolu;
118 <        long  nextflush = hresolu;
118 >        long  nextflush = (vresolu > 0) & (hresolu > 1) ? 0 : hresolu;
119          FILE  *fp;
120          double  d;
121          FVECT  orig, direc;
# Line 160 | Line 160 | rtrace(                                /* trace rays from file */
160  
161                  d = normalize(direc);
162                  if (d == 0.0) {                         /* zero ==> flush */
163                        if (nproc > 1 && ray_fifo_flush() < 0)
164                                error(USER, "lost children");
165                        bogusray();
163                          if (--nextflush <= 0 || !vcount) {
164 +                                if (nproc > 1 && ray_fifo_flush() < 0)
165 +                                        error(USER, "lost children");
166 +                                bogusray();
167                                  fflush(stdout);
168 <                                nextflush = hresolu;
169 <                        }
168 >                                nextflush = (vresolu > 0) & (hresolu > 1) ? 0 :
169 >                                                                hresolu;
170 >                        } else
171 >                                bogusray();
172                  } else {                                /* compute and print */
173                          rtcompute(orig, direc, lim_dist ? d : 0.0);
174                                                          /* flush if time */
# Line 320 | Line 322 | rayirrad(                      /* compute irradiance rather than radiance
322          RAY *r
323   )
324   {
325 +        void    (*old_revf)(RAY *) = r->revf;
326 +
327          r->rot = 1e-5;                  /* pretend we hit surface */
328          VSUM(r->rop, r->rorg, r->rdir, r->rot);
329          r->ron[0] = -r->rdir[0];
# Line 327 | Line 331 | rayirrad(                      /* compute irradiance rather than radiance
331          r->ron[2] = -r->rdir[2];
332          r->rod = 1.0;
333                                          /* compute result */
334 +        r->revf = raytrace;
335          (*ofun[Lamb.otype].funp)(&Lamb, r);
336 +        r->revf = old_revf;
337   }
338  
339  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines