22 |
|
quit(code) /* quit program */ |
23 |
|
int code; |
24 |
|
{ |
25 |
– |
#ifdef MSTATS |
26 |
– |
if (code == 2 && errno == ENOMEM) |
27 |
– |
printmemstats(stderr); |
28 |
– |
#endif |
25 |
|
if (ray_pnprocs > 0) /* close children if any */ |
26 |
< |
ray_pclose(0); |
27 |
< |
devclose(); |
26 |
> |
ray_pclose(0); |
27 |
> |
if (!ray_pnprocs) /* in parent */ |
28 |
> |
devclose(); |
29 |
|
exit(code); |
30 |
|
} |
31 |
|
|
189 |
|
break; |
190 |
|
case 'm': /* move camera (or memstats) */ |
191 |
|
if (badcom("move")) |
195 |
– |
#ifdef MSTATS |
196 |
– |
{ |
197 |
– |
if (badcom("memory")) |
198 |
– |
goto commerr; |
199 |
– |
printmemstats(stderr); |
200 |
– |
break; |
201 |
– |
} |
202 |
– |
#else |
192 |
|
goto commerr; |
204 |
– |
#endif |
193 |
|
getmove(args); |
194 |
|
break; |
195 |
|
case 'r': /* rotate/repaint */ |
249 |
|
error(COMMAND, errmsg); |
250 |
|
break; |
251 |
|
} |
252 |
+ |
if (newparam && ray_pnprocs) /* drop into immediate mode */ |
253 |
+ |
ray_pclose(0); |
254 |
|
#undef badcom |
255 |
|
} |
256 |
|
|
285 |
|
/* sample the image */ |
286 |
|
for (y = 0; /* y < ysiz */ ; y++) { |
287 |
|
for (x = 0; x < xsiz-1; x++) { |
288 |
< |
if (dev->inpready || errno == ENOMEM) |
288 |
> |
if (dev->inpready) |
289 |
|
goto escape; |
290 |
|
/* |
291 |
|
* Test super-pixel to the right. |
299 |
|
if (y >= ysiz-1) |
300 |
|
break; |
301 |
|
for (x = 0; x < xsiz; x++) { |
302 |
< |
if (dev->inpready || errno == ENOMEM) |
302 |
> |
if (dev->inpready) |
303 |
|
goto escape; |
304 |
|
/* |
305 |
|
* Find super-pixel at this position in next row. |
333 |
|
{ |
334 |
|
int growth; |
335 |
|
int mx, my; |
346 |
– |
int i; |
336 |
|
|
337 |
|
if (dev->inpready) /* quit for input */ |
338 |
|
return(0); |