ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/rview.c
(Generate patch)

Comparing ray/src/rt/rview.c (file contents):
Revision 2.8 by greg, Mon Sep 21 12:08:00 1992 UTC vs.
Revision 2.13 by greg, Wed Sep 14 18:35:21 1994 UTC

# Line 35 | Line 35 | double shadthresh = .1;                /* shadow threshold */
35   double  shadcert = .25;                 /* shadow certainty */
36   int  directrelay = 0;                   /* number of source relays */
37   int  vspretest = 128;                   /* virtual source pretest density */
38 < int  directinvis = 0;                   /* sources invisible? */
38 > int  directvis = 1;                     /* sources visible? */
39   double  srcsizerat = 0.;                /* maximum ratio source size/dist. */
40  
41   double  specthresh = .3;                /* specular sampling threshold */
# Line 58 | Line 58 | char  *devname = dev_default;          /* output device name *
58  
59   struct driver  *dev = NULL;             /* driver functions */
60  
61 + char  rifname[128];                     /* rad input file name */
62 +
63   VIEW  oldview;                          /* previous view parameters */
64  
65   PNODE  ptrunk;                          /* the base of our image */
# Line 74 | Line 76 | static char  *reserve_mem = NULL;      /* pre-allocated res
76   quit(code)                      /* quit program */
77   int  code;
78   {
79 + #ifdef MSTATS
80 +        if (code == 2 && errno == ENOMEM)
81 +                printmemstats(stderr);
82 + #endif
83          devclose();
84          exit(code);
85   }
# Line 185 | Line 191 | again:
191          else *++args = '\0';
192          
193          switch (inpbuf[0]) {
194 <        case 'f':                               /* new frame */
195 <                if (badcom("frame"))
196 <                        goto commerr;
194 >        case 'f':                               /* new frame (or free mem.) */
195 >                if (badcom("frame")) {
196 >                        if (badcom("free"))
197 >                                goto commerr;
198 >                        free_objmem();
199 >                        break;
200 >                }
201                  getframe(args);
202                  break;
203          case 'v':                               /* view */
# Line 200 | Line 210 | again:
210                          goto commerr;
211                  lastview(args);
212                  break;
213 +        case 'V':                               /* save view */
214 +                if (badcom("V"))
215 +                        goto commerr;
216 +                saveview(args);
217 +                break;
218 +        case 'L':                               /* load view */
219 +                if (badcom("L"))
220 +                        goto commerr;
221 +                loadview(args);
222 +                break;
223          case 'e':                               /* exposure */
224                  if (badcom("exposure"))
225                          goto commerr;
226                  getexposure(args);
227                  break;
228          case 's':                               /* set a parameter */
229 <                if (badcom("set"))
229 >                if (badcom("set")) {
230 > #ifdef  SIGTSTP
231 >                        if (!badcom("stop"))
232 >                                goto dostop;
233 > #endif
234                          goto commerr;
235 +                }
236                  setparam(args);
237                  break;
238          case 'n':                               /* new picture */
# Line 225 | Line 250 | again:
250                          goto commerr;
251                  getaim(args);
252                  break;
253 <        case 'm':                               /* move camera */
253 >        case 'm':                               /* move camera (or memstats) */
254                  if (badcom("move"))
255   #ifdef  MSTATS
256                  {
# Line 241 | Line 266 | again:
266                  break;
267          case 'r':                               /* rotate/repaint */
268                  if (badcom("rotate")) {
269 <                        if (badcom("repaint"))
270 <                                goto commerr;
269 >                        if (badcom("repaint")) {
270 >                                if (badcom("redraw"))
271 >                                        goto commerr;
272 >                                redraw();
273 >                                break;
274 >                        }
275                          getrepaint(args);
276                          break;
277                  }
278                  getrotate(args);
279                  break;
280          case 'p':                               /* pivot view */
281 <                if (badcom("pivot"))
282 <                        goto commerr;
281 >                if (badcom("pivot")) {
282 >                        if (badcom("pause"))
283 >                                goto commerr;
284 >                        goto again;
285 >                }
286                  getpivot(args);
287                  break;
288          case CTRL('R'):                         /* redraw */
# Line 268 | Line 300 | again:
300          case CTRL('C'):                         /* interrupt */
301                  goto again;
302   #ifdef  SIGTSTP
303 <        case CTRL('Z'):                         /* stop */
303 >        case CTRL('Z'):;                        /* stop */
304 > dostop:
305                  devclose();
306                  kill(0, SIGTSTP);
307                  /* pc stops here */
# Line 307 | Line 340 | rsample()                      /* sample the image */
340           * difference, we subsample the super-pixels.  The testing process
341           * includes initialization of the next row.
342           */
343 <        xsiz = (((pframe.r-pframe.l)<<pdepth)+hresolu-1) / hresolu;
344 <        ysiz = (((pframe.u-pframe.d)<<pdepth)+vresolu-1) / vresolu;
343 >        xsiz = (((long)(pframe.r-pframe.l)<<pdepth)+hresolu-1) / hresolu;
344 >        ysiz = (((long)(pframe.u-pframe.d)<<pdepth)+vresolu-1) / vresolu;
345          rl = (RECT *)malloc(xsiz*sizeof(RECT));
346          if (rl == NULL)
347                  return;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines