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

Comparing ray/src/util/glrad.c (file contents):
Revision 3.25 by greg, Mon Apr 25 20:06:22 2016 UTC vs.
Revision 3.27 by greg, Fri Feb 28 05:18:49 2020 UTC

# Line 27 | Line 27 | static const char      RCSid[] = "$Id$";
27   #define MAXSCENE        127             /* maximum number of scene files */
28   #endif
29  
30 < #define ZOOMPCT         9               /* percent to zoom at a time */
30 > #define ZOOMPCT         9               /* percent to zoom for +/- */
31 > #define WZOOMPCT        3               /* percent to zoom for mouse wheel */
32  
33   #define MOVPCT          4               /* percent distance to move /frame */
34   #define MOVDIR(b)       ((b)==Button1 ? 1 : (b)==Button2 ? 0 : -1)
# Line 75 | Line 76 | char   *scene[MAXSCENE+1];             /* material and scene file l
76   int     nscenef = 0;                    /* number of scene files */
77   char    *octree;                        /* octree name (NULL if unnec.) */
78  
79 < SUBPROC rtpd;                   /* rtrace process descriptors */
79 > SUBPROC rtpd = SP_INACTIVE;             /* rtrace process descriptors */
80  
81   int     silent = 0;                     /* run rad silently? */
82   int     backvis = 1;                    /* back faces visible? */
# Line 210 | Line 211 | quit(                          /* exit gracefully */
211          if (ourdisplay != NULL)
212                  dev_close();
213          /* if (rtpd.pid > 0) { */
214 <        if (rtpd.running) {
214 >        if (rtpd.flags & PF_RUNNING) {
215                  if (close_process(&rtpd) > 0)
216                          wputs("bad exit status from rtrace\n");
217                  /* rtpd.pid = 0; */
# Line 584 | Line 585 | dev_input(             /* get next input event */
585          case KeyPress:
586                  return(getkey(levptr(XKeyPressedEvent)));
587          case ButtonPress:
588 <                getmove(levptr(XButtonPressedEvent));
588 >                switch (levptr(XButtonPressedEvent)->button) {
589 >                case Button4:                   /* wheel up */
590 >                        zoomview(100+WZOOMPCT, levptr(XButtonPressedEvent)->x,
591 >                                        vres-1-levptr(XButtonPressedEvent)->y);
592 >                        break;
593 >                case Button5:                   /* wheel down */
594 >                        zoomview(100-WZOOMPCT, levptr(XButtonPressedEvent)->x,
595 >                                        vres-1-levptr(XButtonPressedEvent)->y);
596 >                        break;
597 >                default:
598 >                        getmove(levptr(XButtonPressedEvent));
599 >                        break;
600 >                }
601                  break;
602          }
603          return(1);
# Line 728 | Line 741 | getintersect(          /* intersect ray with scene geometry */
741          float   fbuf[6];
742                                  /* check to see if rtrace is running */
743          /* if (rtpd.pid <= 0) */
744 <        if (!rtpd.running)
744 >        if (!(rtpd.flags & PF_RUNNING))
745                  return(0);
746                                  /* assign origin */
747          fbuf[0] = org[0]; fbuf[1] = org[1]; fbuf[2] = org[2];
# Line 827 | Line 840 | getkey(                                /* get input key */
840          case 'V':                       /* append view to rad file */
841                  appendview(NULL, &thisview);
842                  break;
843 +        case 'Q':
844          case 'q':                       /* quit the program */
845                  return(0);
846          default:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines