--- ray/src/rt/rview.c 2009/12/12 19:01:00 2.32 +++ ray/src/rt/rview.c 2012/03/20 03:37:08 2.36 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rview.c,v 2.32 2009/12/12 19:01:00 greg Exp $"; +static const char RCSid[] = "$Id: rview.c,v 2.36 2012/03/20 03:37:08 greg Exp $"; #endif /* * rview.c - routines and variables for interactive view generation. @@ -22,13 +22,10 @@ void quit(code) /* quit program */ int code; { -#ifdef MSTATS - if (code == 2 && errno == ENOMEM) - printmemstats(stderr); -#endif if (ray_pnprocs > 0) /* close children if any */ - ray_pclose(0); - devclose(); + ray_pclose(0); + if (!ray_pnprocs) /* in parent */ + devclose(); exit(code); } @@ -192,16 +189,7 @@ again: break; case 'm': /* move camera (or memstats) */ if (badcom("move")) -#ifdef MSTATS - { - if (badcom("memory")) - goto commerr; - printmemstats(stderr); - break; - } -#else goto commerr; -#endif getmove(args); break; case 'r': /* rotate/repaint */ @@ -261,6 +249,8 @@ commerr: error(COMMAND, errmsg); break; } + if (newparam && ray_pnprocs) /* drop into immediate mode */ + ray_pclose(0); #undef badcom } @@ -295,7 +285,7 @@ rsample(void) /* sample the image */ /* sample the image */ for (y = 0; /* y < ysiz */ ; y++) { for (x = 0; x < xsiz-1; x++) { - if (dev->inpready || errno == ENOMEM) + if (dev->inpready) goto escape; /* * Test super-pixel to the right. @@ -309,7 +299,7 @@ rsample(void) /* sample the image */ if (y >= ysiz-1) break; for (x = 0; x < xsiz; x++) { - if (dev->inpready || errno == ENOMEM) + if (dev->inpready) goto escape; /* * Find super-pixel at this position in next row. @@ -343,7 +333,6 @@ refine( /* refine a node */ { int growth; int mx, my; - int i; if (dev->inpready) /* quit for input */ return(0);