--- ray/src/rt/rview.c 1992/09/21 12:08:00 2.8 +++ ray/src/rt/rview.c 1994/09/14 18:35:21 2.13 @@ -35,7 +35,7 @@ double shadthresh = .1; /* shadow threshold */ double shadcert = .25; /* shadow certainty */ int directrelay = 0; /* number of source relays */ int vspretest = 128; /* virtual source pretest density */ -int directinvis = 0; /* sources invisible? */ +int directvis = 1; /* sources visible? */ double srcsizerat = 0.; /* maximum ratio source size/dist. */ double specthresh = .3; /* specular sampling threshold */ @@ -58,6 +58,8 @@ char *devname = dev_default; /* output device name * struct driver *dev = NULL; /* driver functions */ +char rifname[128]; /* rad input file name */ + VIEW oldview; /* previous view parameters */ PNODE ptrunk; /* the base of our image */ @@ -74,6 +76,10 @@ static char *reserve_mem = NULL; /* pre-allocated res quit(code) /* quit program */ int code; { +#ifdef MSTATS + if (code == 2 && errno == ENOMEM) + printmemstats(stderr); +#endif devclose(); exit(code); } @@ -185,9 +191,13 @@ again: else *++args = '\0'; switch (inpbuf[0]) { - case 'f': /* new frame */ - if (badcom("frame")) - goto commerr; + case 'f': /* new frame (or free mem.) */ + if (badcom("frame")) { + if (badcom("free")) + goto commerr; + free_objmem(); + break; + } getframe(args); break; case 'v': /* view */ @@ -200,14 +210,29 @@ again: goto commerr; lastview(args); break; + case 'V': /* save view */ + if (badcom("V")) + goto commerr; + saveview(args); + break; + case 'L': /* load view */ + if (badcom("L")) + goto commerr; + loadview(args); + break; case 'e': /* exposure */ if (badcom("exposure")) goto commerr; getexposure(args); break; case 's': /* set a parameter */ - if (badcom("set")) + if (badcom("set")) { +#ifdef SIGTSTP + if (!badcom("stop")) + goto dostop; +#endif goto commerr; + } setparam(args); break; case 'n': /* new picture */ @@ -225,7 +250,7 @@ again: goto commerr; getaim(args); break; - case 'm': /* move camera */ + case 'm': /* move camera (or memstats) */ if (badcom("move")) #ifdef MSTATS { @@ -241,16 +266,23 @@ again: break; case 'r': /* rotate/repaint */ if (badcom("rotate")) { - if (badcom("repaint")) - goto commerr; + if (badcom("repaint")) { + if (badcom("redraw")) + goto commerr; + redraw(); + break; + } getrepaint(args); break; } getrotate(args); break; case 'p': /* pivot view */ - if (badcom("pivot")) - goto commerr; + if (badcom("pivot")) { + if (badcom("pause")) + goto commerr; + goto again; + } getpivot(args); break; case CTRL('R'): /* redraw */ @@ -268,7 +300,8 @@ again: case CTRL('C'): /* interrupt */ goto again; #ifdef SIGTSTP - case CTRL('Z'): /* stop */ + case CTRL('Z'):; /* stop */ +dostop: devclose(); kill(0, SIGTSTP); /* pc stops here */ @@ -307,8 +340,8 @@ rsample() /* sample the image */ * difference, we subsample the super-pixels. The testing process * includes initialization of the next row. */ - xsiz = (((pframe.r-pframe.l)<