--- ray/src/rt/raypwin.c 2008/02/13 01:06:10 2.4 +++ ray/src/rt/raypwin.c 2008/04/17 18:48:09 2.5 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: raypwin.c,v 2.4 2008/02/13 01:06:10 greg Exp $"; +static const char RCSid[] = "$Id: raypwin.c,v 2.5 2008/04/17 18:48:09 greg Exp $"; #endif /* * raypwin.c - interface for parallel rendering using Radiance (Windows ver) @@ -55,6 +55,11 @@ ray_pqueue( /* queue a ray for computation */ { if (r == NULL) return(0); + if (ray_pnidle <= 0) { + RAY new_ray = *r; + *r = queued_ray; + queued_ray = new_ray; + } samplendx++; rayvalue(r); return(1); @@ -70,9 +75,9 @@ ray_presult( /* check for a completed ray */ if (r == NULL) return(0); if (ray_pnidle <= 0) { + *r = queued_ray; samplendx++; rayvalue(r); - *r = queued_ray; ray_pnidle = 1; return(1); }