--- ray/src/hd/rhdisp.c 1998/08/19 18:23:56 3.31 +++ ray/src/hd/rhdisp.c 1998/11/11 16:58:51 3.35 @@ -88,14 +88,6 @@ char *argv[]; printview(); if (inp & DFL(DC_LASTVIEW)) new_view(NULL); - if (inp & DFL(DC_RESUME)) { - serv_request(DR_NOOP, 0, NULL); - pause = 0; - } - if (inp & DFL(DC_PAUSE)) - pause = 1; - if (inp & DFL(DC_REDRAW)) - imm_mode = beam_sync(1) > 0; if (inp & DFL(DC_KILL)) { serv_request(DR_KILL, 0, NULL); pause = 0; @@ -106,10 +98,18 @@ char *argv[]; serv_request(DR_RESTART, 0, NULL); pause = 0; } + if (inp & DFL(DC_RESUME)) { + serv_request(DR_NOOP, 0, NULL); + pause = 0; + } + if (inp & DFL(DC_PAUSE)) + pause = 1; + if (inp & DFL(DC_REDRAW)) + imm_mode = beam_sync(1) > 0; if (inp & DFL(DC_QUIT)) serv_request(DR_SHUTDOWN, 0, NULL); } - if (rdy & RDY_SIN) /* user input from sstdin */ + if (rdy & RDY_SIN && !imm_mode) /* user input from sstdin */ switch (usr_input()) { case DC_PAUSE: pause = 1; @@ -289,8 +289,9 @@ again: } copystruct(v, viewhist + ((nhist-1)%VIEWHISTLEN)); goto again; - } - beam_sync(0); /* update server */ + } + /* update server */ + imm_mode = beam_sync(0) > 0; /* record new view */ if (v < viewhist || v >= viewhist+VIEWHISTLEN) { copystruct(viewhist + (nhist%VIEWHISTLEN), v); @@ -421,14 +422,15 @@ serv_result() /* get next server result and process case DS_STARTIMM: case DS_ENDIMM: #ifdef DEBUG - if (imm_mode != (msg.type==DS_STARTIMM)) { + { time_t tnow = time(NULL); - if (imm_mode) timm += tnow - tmodesw; - else tadd += tnow - tmodesw; + if (msg.type==DS_STARTIMM) tadd += tnow - tmodesw; + else timm += tnow - tmodesw; tmodesw = tnow; } #endif - imm_mode = msg.type==DS_STARTIMM; + if (!(imm_mode = msg.type==DS_STARTIMM)) + dev_flush(); goto noargs; case DS_ACKNOW: case DS_SHUTDOWN: @@ -457,6 +459,11 @@ char *p; { MSGHEAD msg; int m; + /* consistency checks */ +#ifdef DEBUG + if (nbytes < 0 || nbytes > 0 & p == NULL) + error(CONSISTENCY, "bad buffer handed to serv_request"); +#endif /* get server's attention for big request */ if (nbytes >= BIGREQSIZ-sizeof(MSGHEAD)) { serv_request(DR_ATTEN, 0, NULL);