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

Comparing ray/src/rt/rv3.c (file contents):
Revision 2.36 by greg, Tue Mar 20 02:56:08 2012 UTC vs.
Revision 2.37 by greg, Tue Mar 20 03:37:08 2012 UTC

# Line 29 | Line 29 | static const char      RCSid[] = "$Id$";
29   #define  sscanvec(s,v)  (sscanf(s,"%lf %lf %lf",v,v+1,v+2)==3)
30   #endif
31  
32 + extern int      ray_pnprocs;
33 +
34   static RNUMBER  niflush;                /* flushes since newimage() */
35  
36   int
# Line 192 | Line 194 | paint(                 /* compute and paint a rectangle */
194          if ((thisray.rmax = viewray(thisray.rorg, thisray.rdir, &ourview,
195                          h/hresolu, v/vresolu)) < -FTINY) {
196                  setcolor(thisray.rcol, 0.0, 0.0, 0.0);
197 <        } else if (nproc == 1 || newparam) {    /* immediate mode */
197 >        } else if (!ray_pnprocs) {              /* immediate mode */
198                  ray_trace(&thisray);
199          } else {                                /* queuing mode */
200                  int     rval;
# Line 216 | Line 218 | paint(                 /* compute and paint a rectangle */
218                  static RNUMBER  lastflush = 0;
219                  RNUMBER         counter = raynum;
220                  int             flushintvl;
221 <                if (nproc == 1) {
221 >                if (!ray_pnprocs) {
222                          counter = nrays;
223                          flushintvl = WFLUSH1;
224                  } else if (ambounce == 0)
225 <                        flushintvl = nproc*WFLUSH;
225 >                        flushintvl = ray_pnprocs*WFLUSH;
226                  else if (niflush < WFLUSH)
227 <                        flushintvl = nproc*niflush/(ambounce+1);
227 >                        flushintvl = ray_pnprocs*niflush/(ambounce+1);
228                  else
229 <                        flushintvl = nproc*WFLUSH/(ambounce+1);
229 >                        flushintvl = ray_pnprocs*WFLUSH/(ambounce+1);
230                  if (lastflush > counter)
231                          lastflush = 0;          /* counter wrapped */
232  
# Line 245 | Line 247 | waitrays(void)                                 /* finish up pending rays */
247          int     rval;
248          RAY     raydone;
249  
250 <        if (nproc <= 1)                         /* immediate mode? */
250 >        if (!ray_pnprocs)                       /* immediate mode? */
251                  return(0);
252          while ((rval = ray_presult(&raydone, 0)) > 0) {
253                  PNODE  *p = (PNODE *)raydone.rno;
# Line 265 | Line 267 | newimage(                                      /* start a new image */
267          char *s
268   )
269   {
268        extern int      ray_pnprocs;
270          int             newnp = 0;
271                                                  /* # rendering procs arg? */
272          if (s != NULL)
# Line 284 | Line 285 | newimage(                                      /* start a new image */
285          (*dev->clear)(hresolu, vresolu);
286  
287          if (newparam) {                         /* (re)start rendering procs */
288 <                if (ray_pnprocs > 0)
289 <                        ray_pclose(0);
288 >                if (ray_pnprocs)
289 >                        ray_pclose(0);          /* should already be closed */
290                  if (newnp > 0)
291                          nproc = newnp;
292                  if (nproc > 1)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines