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.32 by greg, Sat Dec 12 19:01:00 2009 UTC vs.
Revision 2.38 by greg, Sat Jun 7 05:09:46 2025 UTC

# Line 13 | Line 13 | static const char      RCSid[] = "$Id$";
13   #include  <ctype.h>
14  
15   #include  "ray.h"
16 + #include  "paths.h"
17   #include  "rpaint.h"
18  
19   #define  CTRL(c)        ((c)-'@')
# Line 22 | Line 23 | void
23   quit(code)                      /* quit program */
24   int  code;
25   {
25 #ifdef MSTATS
26        if (code == 2 && errno == ENOMEM)
27                printmemstats(stderr);
28 #endif
26          if (ray_pnprocs > 0)    /* close children if any */
27 <                ray_pclose(0);          
28 <        devclose();
27 >                ray_pclose(0);
28 >        if (!ray_pnprocs)       /* in parent */
29 >                devclose();
30          exit(code);
31   }
32  
# Line 38 | Line 36 | devopen(                               /* open device driver */
36          char  *dname
37   )
38   {
39 <        extern char  *progname, *octname;
39 >        extern char  *octname;
40          char  *id;
41          int  i;
42  
# Line 192 | Line 190 | again:
190                  break;
191          case 'm':                               /* move camera (or memstats) */
192                  if (badcom("move"))
195 #ifdef  MSTATS
196                {
197                        if (badcom("memory"))
198                                goto commerr;
199                        printmemstats(stderr);
200                        break;
201                }
202 #else
193                          goto commerr;
204 #endif
194                  getmove(args);
195                  break;
196          case 'r':                               /* rotate/repaint */
# Line 225 | Line 214 | again:
214                  }
215                  getpivot(args);
216                  break;
217 +        case 'o':                               /* origin view */
218 +                if (badcom("origin"))
219 +                        goto commerr;
220 +                getorigin(args);
221 +                break;
222          case CTRL('R'):                         /* redraw */
223                  redraw();
224                  break;
# Line 261 | Line 255 | commerr:
255                  error(COMMAND, errmsg);
256                  break;
257          }
258 +        if (newparam && ray_pnprocs)            /* drop into immediate mode */
259 +                ray_pclose(0);
260   #undef  badcom
261   }
262  
# Line 295 | Line 291 | rsample(void)                  /* sample the image */
291                                                  /* sample the image */
292          for (y = 0; /* y < ysiz */ ; y++) {
293                  for (x = 0; x < xsiz-1; x++) {
294 <                        if (dev->inpready || errno == ENOMEM)
294 >                        if (dev->inpready)
295                                  goto escape;
296                          /*
297                           * Test super-pixel to the right.
# Line 309 | Line 305 | rsample(void)                  /* sample the image */
305                  if (y >= ysiz-1)
306                          break;
307                  for (x = 0; x < xsiz; x++) {
308 <                        if (dev->inpready || errno == ENOMEM)
308 >                        if (dev->inpready)
309                                  goto escape;
310                          /*
311                           * Find super-pixel at this position in next row.
# Line 343 | Line 339 | refine(                                /* refine a node */
339   {
340          int  growth;
341          int  mx, my;
346        int  i;
342  
343          if (dev->inpready)                      /* quit for input */
344                  return(0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines