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.31 by greg, Fri Sep 5 19:45:42 2008 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)-'@')
20  
21  
22   void
23 + quit(code)                      /* quit program */
24 + int  code;
25 + {
26 +        if (ray_pnprocs > 0)    /* close children if any */
27 +                ray_pclose(0);
28 +        if (!ray_pnprocs)       /* in parent */
29 +                devclose();
30 +        exit(code);
31 + }
32 +
33 +
34 + void
35   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 177 | Line 190 | again:
190                  break;
191          case 'm':                               /* move camera (or memstats) */
192                  if (badcom("move"))
180 #ifdef  MSTATS
181                {
182                        if (badcom("memory"))
183                                goto commerr;
184                        printmemstats(stderr);
185                        break;
186                }
187 #else
193                          goto commerr;
189 #endif
194                  getmove(args);
195                  break;
196          case 'r':                               /* rotate/repaint */
# Line 210 | 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 246 | 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 280 | 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 294 | 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 328 | Line 339 | refine(                                /* refine a node */
339   {
340          int  growth;
341          int  mx, my;
331        int  i;
342  
343          if (dev->inpready)                      /* quit for input */
344                  return(0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines