29 |
|
#define sscanvec(s,v) (sscanf(s,"%lf %lf %lf",v,v+1,v+2)==3) |
30 |
|
#endif |
31 |
|
|
32 |
< |
static unsigned long niflush; /* flushes since newimage() */ |
32 |
> |
static RNUMBER niflush; /* flushes since newimage() */ |
33 |
|
|
34 |
|
int |
35 |
|
getrect( /* get a box */ |
197 |
|
} else { /* queuing mode */ |
198 |
|
int rval; |
199 |
|
rayorigin(&thisray, PRIMARY, NULL, NULL); |
200 |
< |
thisray.rno = (unsigned long)p; |
200 |
> |
thisray.rno = (RNUMBER)p; |
201 |
|
rval = ray_pqueue(&thisray); |
202 |
|
if (!rval) |
203 |
|
return(0); |
212 |
|
recolor(p); /* paint it */ |
213 |
|
|
214 |
|
if (dev->flush != NULL) { /* shall we check for input? */ |
215 |
< |
static unsigned long lastflush = 0; |
216 |
< |
unsigned long counter = raynum; |
217 |
< |
int flushintvl; |
215 |
> |
static RNUMBER lastflush = 0; |
216 |
> |
RNUMBER counter = raynum; |
217 |
> |
int flushintvl; |
218 |
|
if (nproc == 1) { |
219 |
|
counter = nrays; |
220 |
|
flushintvl = WFLUSH1; |
224 |
|
flushintvl = nproc*niflush/(ambounce+1); |
225 |
|
else |
226 |
|
flushintvl = nproc*WFLUSH/(ambounce+1); |
227 |
+ |
if (lastflush > counter) |
228 |
+ |
lastflush = 0; /* counter wrapped */ |
229 |
|
|
230 |
|
if (counter - lastflush >= flushintvl) { |
231 |
|
lastflush = counter; |
244 |
|
int rval; |
245 |
|
RAY raydone; |
246 |
|
|
247 |
< |
if (nproc == 1) /* immediate mode? */ |
247 |
> |
if (nproc <= 1) /* immediate mode? */ |
248 |
|
return(0); |
249 |
|
while ((rval = ray_presult(&raydone, 0)) > 0) { |
250 |
|
PNODE *p = (PNODE *)raydone.rno; |
267 |
|
extern int ray_pnprocs; |
268 |
|
int newnp; |
269 |
|
/* change in nproc? */ |
270 |
< |
if (s != NULL && sscanf(s, "%d", &newnp) == 1 && newnp > 0) { |
270 |
> |
if (s != NULL && sscanf(s, "%d", &newnp) == 1 && |
271 |
> |
(newnp > 0) & (newnp != nproc)) { |
272 |
|
if (!newparam) { |
270 |
– |
if (nproc == 1) |
271 |
– |
nproc = 0; /* actually running */ |
273 |
|
if (newnp == 1) |
274 |
|
ray_pclose(0); |
275 |
< |
else if (newnp < nproc) |
276 |
< |
ray_pclose(nproc - newnp); |
275 |
> |
else if (newnp < ray_pnprocs) |
276 |
> |
ray_pclose(ray_pnprocs - newnp); |
277 |
|
else |
278 |
< |
ray_popen(newnp - nproc); |
278 |
> |
ray_popen(newnp - ray_pnprocs); |
279 |
|
} |
280 |
|
nproc = newnp; |
281 |
|
} |