| 24 |
|
|
| 25 |
|
int imm_mode = 0; /* bundles are being delivered immediately */ |
| 26 |
|
|
| 27 |
+ |
int do_outside = 0; /* render from outside sections */ |
| 28 |
+ |
|
| 29 |
|
char *progname; /* global argv[0] */ |
| 30 |
|
|
| 31 |
|
FILE *sstdin, *sstdout; /* server's standard input and output */ |
| 58 |
|
/* enter main loop */ |
| 59 |
|
do { |
| 60 |
|
rdy = disp_wait(); |
| 61 |
+ |
if (rdy & RDY_SRV) { /* process server result */ |
| 62 |
+ |
res = serv_result(); |
| 63 |
+ |
if (pause && res != DS_SHUTDOWN) { |
| 64 |
+ |
serv_request(DR_ATTEN, 0, NULL); |
| 65 |
+ |
while ((res = serv_result()) != DS_ACKNOW && |
| 66 |
+ |
res != DS_SHUTDOWN) |
| 67 |
+ |
; |
| 68 |
+ |
} |
| 69 |
+ |
} |
| 70 |
|
if (rdy & RDY_DEV) { /* user input from driver */ |
| 71 |
|
inp = dev_input(); |
| 72 |
|
if (inp & DFL(DC_SETVIEW)) |
| 109 |
|
pause = 0; |
| 110 |
|
break; |
| 111 |
|
} |
| 101 |
– |
if (rdy & RDY_SRV) { /* process server result */ |
| 102 |
– |
res = serv_result(); |
| 103 |
– |
if (pause && res != DS_SHUTDOWN) { |
| 104 |
– |
serv_request(DR_ATTEN, 0, NULL); |
| 105 |
– |
while ((res = serv_result()) != DS_ACKNOW && |
| 106 |
– |
res != DS_SHUTDOWN) |
| 107 |
– |
; |
| 108 |
– |
} |
| 109 |
– |
} |
| 112 |
|
} while (res != DS_SHUTDOWN); |
| 113 |
|
/* all done */ |
| 114 |
|
quit(0); |
| 162 |
|
HDGRID *hdg; |
| 163 |
|
{ |
| 164 |
|
VIEW nv; |
| 165 |
+ |
double d; |
| 166 |
|
register int hd; |
| 167 |
|
|
| 168 |
|
for (hd = 0; hd < HDMAX && hdlist[hd] != NULL; hd++) |
| 183 |
|
VSUM(nv.vp, nv.vp, hdlist[0]->xv[2], 0.5); |
| 184 |
|
fcross(nv.vdir, hdlist[0]->xv[1], hdlist[0]->xv[2]); |
| 185 |
|
VCOPY(nv.vup, hdlist[0]->xv[2]); |
| 186 |
+ |
if (do_outside) { |
| 187 |
+ |
normalize(nv.vdir); |
| 188 |
+ |
d = VLEN(hdlist[0]->xv[1]); |
| 189 |
+ |
d += VLEN(hdlist[0]->xv[2]); |
| 190 |
+ |
VSUM(nv.vp, nv.vp, nv.vdir, -d); |
| 191 |
+ |
} |
| 192 |
|
new_view(&nv); |
| 193 |
|
} |
| 194 |
|
|
| 229 |
|
while (nhist < VIEWHISTLEN && viewhist[nhist].type) |
| 230 |
|
nhist++; |
| 231 |
|
v = viewhist + ((nhist-1)%VIEWHISTLEN); |
| 232 |
< |
} else if ((err = setview(v)) != NULL) { |
| 232 |
> |
} else |
| 233 |
> |
again: |
| 234 |
> |
if ((err = setview(v)) != NULL) { |
| 235 |
|
error(COMMAND, err); |
| 236 |
|
return; |
| 237 |
|
} |
| 227 |
– |
again: |
| 238 |
|
if (v->type == VT_PAR) { |
| 239 |
|
error(COMMAND, "cannot handle parallel views"); |
| 240 |
|
return; |
| 361 |
|
error(INTERNAL, "bad holodeck record from server"); |
| 362 |
|
add_holo((HDGRID *)buf); |
| 363 |
|
break; |
| 364 |
+ |
case DS_OUTSECT: |
| 365 |
+ |
do_outside = 1; |
| 366 |
+ |
break; |
| 367 |
|
case DS_STARTIMM: |
| 368 |
|
case DS_ENDIMM: |
| 369 |
|
imm_mode = msg.type==DS_STARTIMM; |
| 357 |
– |
if (msg.type == DS_ENDIMM) |
| 358 |
– |
dev_flush(); /* update display NOW */ |
| 370 |
|
/* fall through */ |
| 371 |
|
case DS_ACKNOW: |
| 372 |
|
case DS_SHUTDOWN: |