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

Comparing ray/src/hd/rhdisp.c (file contents):
Revision 3.29 by gwlarson, Tue Aug 11 07:51:19 1998 UTC vs.
Revision 3.32 by gwlarson, Wed Aug 26 13:06:09 1998 UTC

# Line 88 | Line 88 | char   *argv[];
88                                  printview();
89                          if (inp & DFL(DC_LASTVIEW))
90                                  new_view(NULL);
91                        if (inp & DFL(DC_RESUME)) {
92                                serv_request(DR_NOOP, 0, NULL);
93                                pause = 0;
94                        }
95                        if (inp & DFL(DC_PAUSE))
96                                pause = 1;
97                        if (inp & DFL(DC_REDRAW))
98                                imm_mode = beam_sync(1) > 0;
91                          if (inp & DFL(DC_KILL)) {
92                                  serv_request(DR_KILL, 0, NULL);
93                                  pause = 0;
# Line 106 | Line 98 | char   *argv[];
98                                  serv_request(DR_RESTART, 0, NULL);
99                                  pause = 0;
100                          }
101 +                        if (inp & DFL(DC_RESUME)) {
102 +                                serv_request(DR_NOOP, 0, NULL);
103 +                                pause = 0;
104 +                        }
105 +                        if (inp & DFL(DC_PAUSE))
106 +                                pause = 1;
107 +                        if (inp & DFL(DC_REDRAW))
108 +                                imm_mode = beam_sync(1) > 0;
109                          if (inp & DFL(DC_QUIT))
110                                  serv_request(DR_SHUTDOWN, 0, NULL);
111                  }
# Line 146 | Line 146 | disp_wait()                    /* wait for more input */
146          int     n;
147          register int    i;
148                                  /* see if we can avoid select call */
149 +        flgs = 0;               /* flag what's ready already */
150          if (imm_mode || stdin->_cnt > 0)
151 <                return(RDY_SRV);
151 >                flgs |= RDY_SRV;
152          if (sstdin != NULL && sstdin->_cnt > 0)
153 <                return(RDY_SIN);
154 <        if (dev_flush())
153 >                flgs |= RDY_SIN;
154 >        if (odev.inpready)
155 >                flgs |= RDY_DEV;
156 >        if (flgs)               /* got something? */
157 >                return(flgs);
158 >        if (dev_flush())        /* else flush output & check keyboard+mouse */
159                  return(RDY_DEV);
160 <                                /* make the call */
160 >                                /* if nothing, we need to call select */
161          FD_ZERO(&readset); FD_ZERO(&errset);
162          FD_SET(0, &readset);
163          FD_SET(0, &errset);
# Line 171 | Line 176 | disp_wait()                    /* wait for more input */
176                          return(0);
177                  error(SYSTEM, "select call failure in disp_wait");
178          }
174        flgs = 0;               /* flag what's ready */
179          if (FD_ISSET(0, &readset) || FD_ISSET(0, &errset))
180                  flgs |= RDY_SRV;
181          if (FD_ISSET(odev.ifd, &readset) || FD_ISSET(odev.ifd, &errset))
# Line 308 | Line 312 | usr_input()                    /* get user input and process it */
312                  sstdin = NULL;
313                  return(-1);
314          }
315 <        if (!*cmd)
315 >        if (*cmd == '\n')
316                  return(DC_RESUME);
317          for (args = cmd; *args && !isspace(*args); args++)
318                  ;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines