25 |
|
#define sscanvec(s,v) (sscanf(s,"%lf %lf %lf",v,v+1,v+2)==3) |
26 |
|
#endif |
27 |
|
|
28 |
+ |
static unsigned long niflush; /* flushes since newimage() */ |
29 |
|
|
30 |
|
int |
31 |
|
getrect( /* get a box */ |
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 */ |
186 |
|
copycolor(p->v, thisray.rcol); |
187 |
|
scalecolor(p->v, exposure); |
188 |
|
|
189 |
< |
(*dev->paintr)(greyscale?greyof(p->v):p->v, p->xmin, p->ymin, p->xmax, p->ymax); |
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 >= WFLUSH*ray_pnprocs) { |
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++; |
203 |
|
} |
204 |
|
return(1); |
205 |
|
} |
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; |
260 |
|
ray_popen(nproc); |
261 |
|
newparam = 0; |
262 |
|
} |
263 |
< |
/* get first value */ |
263 |
> |
niflush = 0; /* get first value */ |
264 |
|
paint(&ptrunk); |
265 |
|
} |
266 |
|
|