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.73 by greg, Tue Nov 13 19:58:33 2018 UTC vs.
Revision 2.77 by greg, Sat May 4 13:48:06 2019 UTC

# Line 162 | Line 162 | rtrace(                                /* trace rays from file */
162  
163                  d = normalize(direc);
164                  if (d == 0.0) {                         /* zero ==> flush */
165 <                        if (--nextflush <= 0 || !vcount) {
166 <                                if (nproc > 1 && ray_fifo_flush() < 0)
165 >                        if ((--nextflush <= 0) | !vcount) {
166 >                                if (ray_pnprocs > 1 && ray_fifo_flush() < 0)
167                                          error(USER, "child(ren) died");
168                                  bogusray();
169                                  fflush(stdout);
# Line 175 | Line 175 | rtrace(                                /* trace rays from file */
175                          rtcompute(orig, direc, lim_dist ? d : 0.0);
176                                                          /* flush if time */
177                          if (!--nextflush) {
178 <                                if (nproc > 1 && ray_fifo_flush() < 0)
178 >                                if (ray_pnprocs > 1 && ray_fifo_flush() < 0)
179                                          error(USER, "child(ren) died");
180                                  fflush(stdout);
181                                  nextflush = hresolu;
# Line 186 | Line 186 | rtrace(                                /* trace rays from file */
186                  if (vcount && !--vcount)                /* check for end */
187                          break;
188          }
189 <        if (nproc > 1) {                                /* clean up children */
189 >        if (ray_pnprocs > 1) {                          /* clean up children */
190                  if (ray_fifo_flush() < 0)
191                          error(USER, "unable to complete processing");
192                  ray_pclose(0);
# Line 314 | Line 314 | setoutput(                             /* set up output tables */
314   static void
315   bogusray(void)                  /* print out empty record */
316   {
317 <        thisray.rorg[0] = thisray.rorg[1] = thisray.rorg[2] =
318 <        thisray.rdir[0] = thisray.rdir[1] = thisray.rdir[2] = 0.0;
319 <        thisray.rmax = 0.0;
317 >        memset(&thisray, 0, sizeof(thisray));
318          rayorigin(&thisray, PRIMARY, NULL, NULL);
319          printvals(&thisray);
320   }
# Line 343 | Line 341 | rayirrad(                      /* compute irradiance rather than radiance
341   )
342   {
343          void    (*old_revf)(RAY *) = r->revf;
344 <
345 <        r->rot = 1e-5;                  /* pretend we hit surface */
344 >                                        /* pretend we hit surface */
345 >        r->rxt = r->rot = 1e-5;
346          VSUM(r->rop, r->rorg, r->rdir, r->rot);
347          r->ron[0] = -r->rdir[0];
348          r->ron[1] = -r->rdir[1];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines