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.23 by greg, Thu Aug 21 16:13:00 2008 UTC vs.
Revision 2.24 by greg, Fri Aug 22 17:39:26 2008 UTC

# Line 25 | Line 25 | static const char      RCSid[] = "$Id$";
25   #define  sscanvec(s,v)  (sscanf(s,"%lf %lf %lf",v,v+1,v+2)==3)
26   #endif
27  
28 < static int  niflush;                    /* flushes since newimage() */
28 > static unsigned long  niflush;          /* flushes since newimage() */
29  
30   int
31   getrect(                                /* get a box */
# Line 155 | Line 155 | paint(                 /* compute and paint a rectangle */
155          extern int  ray_pnprocs;
156          static unsigned long  lastflush = 0;
157          static RAY  thisray;
158 +        int     flushintvl;
159          double  h, v;
160  
161          if (p->xmax - p->xmin <= 0 || p->ymax - p->ymin <= 0) { /* empty */
# Line 188 | Line 189 | paint(                 /* compute and paint a rectangle */
189          (*dev->paintr)(greyscale?greyof(p->v):p->v,
190                          p->xmin, p->ymin, p->xmax, p->ymax);
191  
192 <        if (dev->flush != NULL && raynum - lastflush >= ray_pnprocs *
193 <                        (ambounce > 0 && niflush < WFLUSH ? niflush : WFLUSH)) {
192 >        if (ambounce <= 0)                      /* shall we check for input? */
193 >                flushintvl = ray_pnprocs*WFLUSH;
194 >        else if (niflush < WFLUSH)
195 >                flushintvl = ray_pnprocs*niflush/(ambounce+1);
196 >        else
197 >                flushintvl = ray_pnprocs*WFLUSH/(ambounce+1);
198 >
199 >        if (dev->flush != NULL && raynum - lastflush >= flushintvl) {
200                  lastflush = raynum;
201                  (*dev->flush)();
202                  niflush++;
# Line 199 | Line 206 | paint(                 /* compute and paint a rectangle */
206  
207  
208   int
209 < waitrays(void)                          /* finish up pending rays */
209 > waitrays(void)                                  /* finish up pending rays */
210   {
211          int     nwaited = 0;
212          int     rval;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines