--- ray/src/hd/rhdisp.c 1998/01/08 21:19:05 3.23 +++ ray/src/hd/rhdisp.c 1998/05/22 08:30:40 3.25 @@ -26,6 +26,8 @@ int imm_mode = 0; /* bundles are being delivered imme int do_outside = 0; /* render from outside sections */ +double eyesepdist = 1; /* eye separation distance */ + char *progname; /* global argv[0] */ FILE *sstdin, *sstdout; /* server's standard input and output */ @@ -93,7 +95,7 @@ char *argv[]; if (inp & DFL(DC_PAUSE)) pause = 1; if (inp & DFL(DC_REDRAW)) - imm_mode = beam_sync() > 0; + imm_mode = beam_sync(1) > 0; if (inp & DFL(DC_KILL)) { serv_request(DR_KILL, 0, NULL); pause = 0; @@ -247,6 +249,8 @@ register VIEW *v; { static VIEW viewhist[VIEWHISTLEN]; static unsigned nhist; + VIEW *dv; + int i, res[2]; char *err; /* restore previous view? */ if (v == NULL) { @@ -266,11 +270,20 @@ again: error(COMMAND, "cannot handle parallel views"); return; } - if (!dev_view(v)) /* update display driver */ + if (!dev_view(v)) /* notify display driver */ goto again; dev_flush(); /* update screen */ - if (!beam_view(v)) /* update beam list */ - goto again; + beam_init(); /* compute new beam set */ + for (i = 0; (dv = dev_auxview(i, res)) != NULL; i++) + if (!beam_view(dv, res[0], res[1])) { + if (!nhist) { + error(COMMAND, "invalid starting view"); + return; + } + copystruct(v, viewhist + ((nhist-1)%VIEWHISTLEN)); + goto again; + } + beam_sync(0); /* update server */ /* record new view */ if (v < viewhist || v >= viewhist+VIEWHISTLEN) { copystruct(viewhist + (nhist%VIEWHISTLEN), v); @@ -327,7 +340,7 @@ usr_input() /* get user input and process it */ /* handled in main() */ break; case DC_REDRAW: /* redraw from server */ - imm_mode = beam_sync() > 0; + imm_mode = beam_sync(1) > 0; dev_clear(); break; case DC_KILL: /* kill rtrace process(es) */ @@ -394,6 +407,10 @@ serv_result() /* get next server result and process break; case DS_OUTSECT: do_outside = 1; + break; + case DS_EYESEP: + if (msg.nbytes <= 1 || (eyesepdist = atof(buf)) <= FTINY) + error(INTERNAL, "bad eye separation from server"); break; case DS_STARTIMM: case DS_ENDIMM: