--- ray/src/rt/rv3.c 2008/09/16 21:14:11 2.30 +++ ray/src/rt/rv3.c 2009/12/12 00:03:42 2.32 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rv3.c,v 2.30 2008/09/16 21:14:11 greg Exp $"; +static const char RCSid[] = "$Id: rv3.c,v 2.32 2009/12/12 00:03:42 greg Exp $"; #endif /* * rv3.c - miscellaneous routines for rview. @@ -29,7 +29,7 @@ static const char RCSid[] = "$Id: rv3.c,v 2.30 2008/09 #define sscanvec(s,v) (sscanf(s,"%lf %lf %lf",v,v+1,v+2)==3) #endif -static unsigned long niflush; /* flushes since newimage() */ +static RNUMBER niflush; /* flushes since newimage() */ int getrect( /* get a box */ @@ -197,7 +197,7 @@ paint( /* compute and paint a rectangle */ } else { /* queuing mode */ int rval; rayorigin(&thisray, PRIMARY, NULL, NULL); - thisray.rno = (unsigned long)p; + thisray.rno = (RNUMBER)p; rval = ray_pqueue(&thisray); if (!rval) return(0); @@ -212,9 +212,9 @@ paint( /* compute and paint a rectangle */ recolor(p); /* paint it */ if (dev->flush != NULL) { /* shall we check for input? */ - static unsigned long lastflush = 0; - unsigned long counter = raynum; - int flushintvl; + static RNUMBER lastflush = 0; + RNUMBER counter = raynum; + int flushintvl; if (nproc == 1) { counter = nrays; flushintvl = WFLUSH1; @@ -224,6 +224,8 @@ paint( /* compute and paint a rectangle */ flushintvl = nproc*niflush/(ambounce+1); else flushintvl = nproc*WFLUSH/(ambounce+1); + if (lastflush > counter) + lastflush = 0; /* counter wrapped */ if (counter - lastflush >= flushintvl) { lastflush = counter;