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.9 by greg, Thu Nov 19 20:25:55 1992 UTC vs.
Revision 2.14 by greg, Wed Dec 21 09:52:07 1994 UTC

# Line 41 | Line 41 | double srcsizerat = 0.;                /* maximum ratio source size/
41   double  specthresh = .3;                /* specular sampling threshold */
42   double  specjitter = 1.;                /* specular sampling jitter */
43  
44 + int  backvis = 1;                       /* back face visibility */
45 +
46   int  maxdepth = 4;                      /* maximum recursion depth */
47   double  minweight = 1e-2;               /* minimum ray weight */
48  
# Line 58 | Line 60 | char  *devname = dev_default;          /* output device name *
60  
61   struct driver  *dev = NULL;             /* driver functions */
62  
63 + char  rifname[128];                     /* rad input file name */
64 +
65   VIEW  oldview;                          /* previous view parameters */
66  
67   PNODE  ptrunk;                          /* the base of our image */
# Line 74 | Line 78 | static char  *reserve_mem = NULL;      /* pre-allocated res
78   quit(code)                      /* quit program */
79   int  code;
80   {
81 + #ifdef MSTATS
82 +        if (code == 2 && errno == ENOMEM)
83 +                printmemstats(stderr);
84 + #endif
85          devclose();
86          exit(code);
87   }
# Line 185 | Line 193 | again:
193          else *++args = '\0';
194          
195          switch (inpbuf[0]) {
196 <        case 'f':                               /* new frame */
197 <                if (badcom("frame"))
198 <                        goto commerr;
196 >        case 'f':                               /* new frame (or free mem.) */
197 >                if (badcom("frame")) {
198 >                        if (badcom("free"))
199 >                                goto commerr;
200 >                        free_objmem();
201 >                        break;
202 >                }
203                  getframe(args);
204                  break;
205          case 'v':                               /* view */
# Line 200 | Line 212 | again:
212                          goto commerr;
213                  lastview(args);
214                  break;
215 +        case 'V':                               /* save view */
216 +                if (badcom("V"))
217 +                        goto commerr;
218 +                saveview(args);
219 +                break;
220 +        case 'L':                               /* load view */
221 +                if (badcom("L"))
222 +                        goto commerr;
223 +                loadview(args);
224 +                break;
225          case 'e':                               /* exposure */
226                  if (badcom("exposure"))
227                          goto commerr;
228                  getexposure(args);
229                  break;
230          case 's':                               /* set a parameter */
231 <                if (badcom("set"))
231 >                if (badcom("set")) {
232 > #ifdef  SIGTSTP
233 >                        if (!badcom("stop"))
234 >                                goto dostop;
235 > #endif
236                          goto commerr;
237 +                }
238                  setparam(args);
239                  break;
240          case 'n':                               /* new picture */
# Line 225 | Line 252 | again:
252                          goto commerr;
253                  getaim(args);
254                  break;
255 <        case 'm':                               /* move camera */
255 >        case 'm':                               /* move camera (or memstats) */
256                  if (badcom("move"))
257   #ifdef  MSTATS
258                  {
# Line 241 | Line 268 | again:
268                  break;
269          case 'r':                               /* rotate/repaint */
270                  if (badcom("rotate")) {
271 <                        if (badcom("repaint"))
272 <                                goto commerr;
271 >                        if (badcom("repaint")) {
272 >                                if (badcom("redraw"))
273 >                                        goto commerr;
274 >                                redraw();
275 >                                break;
276 >                        }
277                          getrepaint(args);
278                          break;
279                  }
280                  getrotate(args);
281                  break;
282          case 'p':                               /* pivot view */
283 <                if (badcom("pivot"))
284 <                        goto commerr;
283 >                if (badcom("pivot")) {
284 >                        if (badcom("pause"))
285 >                                goto commerr;
286 >                        goto again;
287 >                }
288                  getpivot(args);
289                  break;
290          case CTRL('R'):                         /* redraw */
# Line 268 | Line 302 | again:
302          case CTRL('C'):                         /* interrupt */
303                  goto again;
304   #ifdef  SIGTSTP
305 <        case CTRL('Z'):                         /* stop */
305 >        case CTRL('Z'):;                        /* stop */
306 > dostop:
307                  devclose();
308                  kill(0, SIGTSTP);
309                  /* pc stops here */
# Line 307 | Line 342 | rsample()                      /* sample the image */
342           * difference, we subsample the super-pixels.  The testing process
343           * includes initialization of the next row.
344           */
345 <        xsiz = (((pframe.r-pframe.l)<<pdepth)+hresolu-1) / hresolu;
346 <        ysiz = (((pframe.u-pframe.d)<<pdepth)+vresolu-1) / vresolu;
345 >        xsiz = (((long)(pframe.r-pframe.l)<<pdepth)+hresolu-1) / hresolu;
346 >        ysiz = (((long)(pframe.u-pframe.d)<<pdepth)+vresolu-1) / vresolu;
347          rl = (RECT *)malloc(xsiz*sizeof(RECT));
348          if (rl == NULL)
349                  return;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines