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.34 by greg, Sat Oct 9 22:38:35 2010 UTC vs.
Revision 2.35 by greg, Sat Oct 16 15:08:14 2010 UTC

# Line 266 | Line 266 | newimage(                                      /* start a new image */
266   )
267   {
268          extern int      ray_pnprocs;
269 <        int             newnp;
270 <                                                /* change in nproc? */
271 <        if (s != NULL && sscanf(s, "%d", &newnp) == 1 &&
272 <                        (newnp > 0) & (newnp != nproc)) {
273 <                if (!newparam) {
274 <                        if (newnp == 1)
275 <                                ray_pclose(0);
276 <                        else if (newnp < ray_pnprocs)
277 <                                ray_pclose(ray_pnprocs - newnp);
278 <                        else
279 <                                ray_popen(newnp - ray_pnprocs);
280 <                }
281 <                nproc = newnp;
282 <        }
269 >        int             newnp = 0;
270 >                                                /* # rendering procs arg? */
271 >        if (s != NULL)
272 >                sscanf(s, "%d", &newnp);
273                                                  /* free old image */
274          freepkids(&ptrunk);
275                                                  /* compute resolution */
# Line 296 | Line 286 | newimage(                                      /* start a new image */
286          if (newparam) {                         /* (re)start rendering procs */
287                  if (ray_pnprocs > 0)
288                          ray_pclose(0);
289 +                if (newnp > 0)
290 +                        nproc = newnp;
291                  if (nproc > 1)
292                          ray_popen(nproc);
293                  newparam = 0;
294 +        } else if ((newnp > 0) & (newnp != nproc)) {
295 +                if (newnp == 1)                 /* change # rendering procs */
296 +                        ray_pclose(0);
297 +                else if (newnp < ray_pnprocs)
298 +                        ray_pclose(ray_pnprocs - newnp);
299 +                else
300 +                        ray_popen(newnp - ray_pnprocs);
301 +                nproc = newnp;
302          }
303          niflush = 0;                            /* get first value */
304          paint(&ptrunk);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines