--- ray/src/hd/rhd_x11.c 1997/11/21 10:17:14 3.3 +++ ray/src/hd/rhd_x11.c 1997/11/21 16:10:17 3.6 @@ -100,7 +100,7 @@ char *id; XSizeHints oursizhints; /* set quadtree globals */ qtDepthEps = 0.02; - qtMinNodesiz = 1; + qtMinNodesiz = 2; /* open display server */ ourdisplay = XOpenDisplay(NULL); if (ourdisplay == NULL) @@ -212,6 +212,7 @@ int dev_input() /* get X11 input */ { inpresflags = 0; + do getevent(); @@ -384,16 +385,15 @@ int dx, dy, move; { VIEW nv; double d; - register int i; + register int i, li; /* start with old view */ copystruct(&nv, &odev.v); /* change view direction */ if (move) { - register RLEAF *lp; - if ((lp = qtFindLeaf(dx, dy)) == NULL) + if ((li = qtFindLeaf(dx, dy)) < 0) return(0); /* not on window */ for (i = 0; i < 3; i++) - nv.vdir[i] = lp->wp[i] - nv.vp[i]; + nv.vdir[i] = qtL.wp[li][i] - nv.vp[i]; } else { if (viewray(nv.vp, nv.vdir, &odev.v, (dx+.5)/odev.hres, (dy+.5)/odev.vres) < -FTINY) @@ -432,6 +432,7 @@ XButtonPressedEvent *ebut; unsigned int statemask; qtMinNodesiz = 16; /* for quicker update */ + qtCompost(50); do { if (!XQueryPointer(ourdisplay, gwind, &rootw, &childw, @@ -440,6 +441,8 @@ XButtonPressedEvent *ebut; if (!moveview(wx, odev.vres-1-wy, MOVDIR(whichbutton))) sleep(1); + else + qtUpdate(); } while (!XCheckMaskEvent(ourdisplay, ButtonReleaseMask, levptr(XEvent))); @@ -472,17 +475,20 @@ register XKeyPressedEvent *ekey; case 'H': /* turn off height motion lock */ headlocked = 0; return; - case CTRL('Z'): + case CTRL('S'): case 'p': /* pause computation */ inpresflags |= DEV_WAIT; return; + case CTRL('Q'): case '\n': - case '\r': /* release */ + case '\r': /* resume computation */ + inpresflags |= DEV_RESUME; return; case CTRL('R'): /* redraw */ + qtCompost(100); /* unload the old tree */ if (ncolors > 0) new_ctab(ncolors); - qtRedraw(0, 0, odev.hres, odev.vres); + inpresflags |= DEV_REDRAW; /* resend values from server */ return; case CTRL('D'): case 'Q':