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.23 by gregl, Thu Jan 8 21:19:05 1998 UTC vs.
Revision 3.27 by gwlarson, Mon Jul 13 17:55:51 1998 UTC

# Line 26 | Line 26 | int    imm_mode = 0;           /* bundles are being delivered imme
26  
27   int     do_outside = 0;         /* render from outside sections */
28  
29 + double  eyesepdist = 1;         /* eye separation distance */
30 +
31   char    *progname;              /* global argv[0] */
32  
33   FILE    *sstdin, *sstdout;      /* server's standard input and output */
# Line 93 | Line 95 | char   *argv[];
95                          if (inp & DFL(DC_PAUSE))
96                                  pause = 1;
97                          if (inp & DFL(DC_REDRAW))
98 <                                imm_mode = beam_sync() > 0;
98 >                                imm_mode = beam_sync(1) > 0;
99                          if (inp & DFL(DC_KILL)) {
100                                  serv_request(DR_KILL, 0, NULL);
101                                  pause = 0;
# Line 247 | Line 249 | register VIEW  *v;
249   {
250          static VIEW     viewhist[VIEWHISTLEN];
251          static unsigned nhist;
252 +        VIEW    *dv;
253 +        int     i, res[2];
254          char    *err;
255                                  /* restore previous view? */
256          if (v == NULL) {
# Line 266 | Line 270 | again:
270                  error(COMMAND, "cannot handle parallel views");
271                  return;
272          }
273 <        if (!dev_view(v))       /* update display driver */
273 >        if (!dev_view(v))       /* notify display driver */
274                  goto again;
275          dev_flush();            /* update screen */
276 <        if (!beam_view(v))      /* update beam list */
277 <                goto again;
276 >        beam_init(0);           /* compute new beam set */
277 >        for (i = 0; (dv = dev_auxview(i, res)) != NULL; i++)
278 >                if (!beam_view(dv, res[0], res[1])) {
279 >                        if (!nhist) {
280 >                                error(COMMAND, "invalid starting view");
281 >                                return;
282 >                        }
283 >                        copystruct(v, viewhist + ((nhist-1)%VIEWHISTLEN));
284 >                        goto again;
285 >                }
286 >        beam_sync(0);           /* update server */
287                                  /* record new view */
288          if (v < viewhist || v >= viewhist+VIEWHISTLEN) {
289                  copystruct(viewhist + (nhist%VIEWHISTLEN), v);
# Line 290 | Line 303 | usr_input()                    /* get user input and process it */
303          if (fgets(cmd, sizeof(cmd), sstdin) == NULL) {
304                  fclose(sstdin);
305                  sstdin = NULL;
306 <                return(0);
306 >                return(-1);
307          }
308 +        if (!*cmd)
309 +                return(DC_RESUME);
310          for (args = cmd; *args && !isspace(*args); args++)
311                  ;
312          while (isspace(*args))
313                  *args++ = '\0';
299        if (!*cmd)
300                return(DC_RESUME);
314          if (*args && args[i=strlen(args)-1] == '\n')
315                  args[i] = '\0';
316          for (i = 0; i < DC_NCMDS; i++)
317                  if (!strcmp(cmd, cmdlist[i]))
318                          break;
319          if (i >= DC_NCMDS) {
320 <                sprintf(errmsg, "unknown command: %s", cmd);
308 <                error(COMMAND, errmsg);
320 >                dev_auxcom(cmd, args);
321                  return(-1);
322          }
323          switch (i) {
# Line 327 | Line 339 | usr_input()                    /* get user input and process it */
339                  /* handled in main() */
340                  break;
341          case DC_REDRAW:                 /* redraw from server */
342 <                imm_mode = beam_sync() > 0;
342 >                imm_mode = beam_sync(1) > 0;
343                  dev_clear();
344                  break;
345          case DC_KILL:                   /* kill rtrace process(es) */
# Line 394 | Line 406 | serv_result()                  /* get next server result and process
406                  break;
407          case DS_OUTSECT:
408                  do_outside = 1;
409 +                break;
410 +        case DS_EYESEP:
411 +                if (msg.nbytes <= 1 || (eyesepdist = atof(buf)) <= FTINY)
412 +                        error(INTERNAL, "bad eye separation from server");
413                  break;
414          case DS_STARTIMM:
415          case DS_ENDIMM:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines