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.21 by gregl, Mon Jan 5 17:40:28 1998 UTC vs.
Revision 3.24 by gwlarson, Thu May 14 13:06:32 1998 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1997 Silicon Graphics, Inc. */
1 > /* Copyright (c) 1998 Silicon Graphics, Inc. */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ SGI";
# Line 93 | Line 93 | char   *argv[];
93                          if (inp & DFL(DC_PAUSE))
94                                  pause = 1;
95                          if (inp & DFL(DC_REDRAW))
96 <                                imm_mode = beam_sync() > 0;
96 >                                imm_mode = beam_sync(1) > 0;
97                          if (inp & DFL(DC_KILL)) {
98                                  serv_request(DR_KILL, 0, NULL);
99                                  pause = 0;
# Line 159 | Line 159 | disp_wait()                    /* wait for more input */
159          n = odev.ifd+1;
160          if (sstdin != NULL) {
161                  FD_SET(fileno(sstdin), &readset);
162 +                FD_SET(fileno(sstdin), &errset);
163                  if (fileno(sstdin) >= n)
164                          n = fileno(sstdin) + 1;
165          }
# Line 173 | Line 174 | disp_wait()                    /* wait for more input */
174                  flgs |= RDY_SRV;
175          if (FD_ISSET(odev.ifd, &readset) || FD_ISSET(odev.ifd, &errset))
176                  flgs |= RDY_DEV;
177 <        if (sstdin != NULL && FD_ISSET(fileno(sstdin), &readset))
177 >        if (sstdin != NULL && (FD_ISSET(fileno(sstdin), &readset) ||
178 >                                FD_ISSET(fileno(sstdin), &errset)))
179                  flgs |= RDY_SIN;
180          return(flgs);
181   }
# Line 245 | Line 247 | register VIEW  *v;
247   {
248          static VIEW     viewhist[VIEWHISTLEN];
249          static unsigned nhist;
250 +        VIEW    *dv;
251 +        int     i, res[2];
252          char    *err;
253                                  /* restore previous view? */
254          if (v == NULL) {
# Line 264 | Line 268 | again:
268                  error(COMMAND, "cannot handle parallel views");
269                  return;
270          }
271 <        if (!dev_view(v))       /* update display driver */
271 >        if (!dev_view(v))       /* notify display driver */
272                  goto again;
273          dev_flush();            /* update screen */
274 <        if (!beam_view(v))      /* update beam list */
275 <                goto again;
274 >        beam_init();            /* compute new beam set */
275 >        for (i = 0; (dv = dev_auxview(i, res)) != NULL; i++)
276 >                if (!beam_view(dv, res[0], res[1])) {
277 >                        if (!nhist) {
278 >                                error(COMMAND, "invalid starting view");
279 >                                return;
280 >                        }
281 >                        copystruct(v, viewhist + ((nhist-1)%VIEWHISTLEN));
282 >                        goto again;
283 >                }
284 >        beam_sync(0);           /* update server */
285                                  /* record new view */
286          if (v < viewhist || v >= viewhist+VIEWHISTLEN) {
287                  copystruct(viewhist + (nhist%VIEWHISTLEN), v);
# Line 281 | Line 294 | int
294   usr_input()                     /* get user input and process it */
295   {
296          VIEW    vparams;
297 <        char    cmd[128];
297 >        char    cmd[256];
298          register char   *args;
299          register int    i;
300  
301 <        if (fgets(cmd, sizeof(cmd), sstdin) == NULL)
302 <                return(DC_QUIT);
301 >        if (fgets(cmd, sizeof(cmd), sstdin) == NULL) {
302 >                fclose(sstdin);
303 >                sstdin = NULL;
304 >                return(0);
305 >        }
306          for (args = cmd; *args && !isspace(*args); args++)
307                  ;
308          while (isspace(*args))
# Line 322 | Line 338 | usr_input()                    /* get user input and process it */
338                  /* handled in main() */
339                  break;
340          case DC_REDRAW:                 /* redraw from server */
341 <                imm_mode = beam_sync() > 0;
341 >                imm_mode = beam_sync(1) > 0;
342 >                dev_clear();
343                  break;
344          case DC_KILL:                   /* kill rtrace process(es) */
345                  serv_request(DR_KILL, 0, NULL);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines