--- ray/src/px/xshowtrace.c 1992/12/11 18:24:29 2.4 +++ ray/src/px/xshowtrace.c 2003/06/27 06:53:22 2.8 @@ -1,9 +1,6 @@ -/* Copyright (c) 1991 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: xshowtrace.c,v 2.8 2003/06/27 06:53:22 greg Exp $"; #endif - /* * Display an image and watch the rays get traced. * @@ -12,7 +9,6 @@ static char SCCSid[] = "$SunId$ LBL"; #include "standard.h" #include "view.h" -#include "resolu.h" #include #define MAXDEPTH 32 /* ridiculous ray tree depth */ @@ -24,7 +20,7 @@ static char SCCSid[] = "$SunId$ LBL"; #endif char rtcom[] = "rtrace -h- -otp -fa -x 1"; -char xicom[] = "ximage"; +char xicom[] = "ximage -c 256"; VIEW ourview = STDVIEW; /* view for picture */ RESOLU ourres; /* picture resolution */ @@ -140,11 +136,13 @@ mainloop() /* get and process input */ freetree(tp) /* free a trace tree */ struct node *tp; { - register struct node *kid; + register struct node *kid, *k2; - for (kid = tp->daughter; kid != NULL; kid = kid->sister) + for (kid = tp->daughter; kid != NULL; kid = k2) { + k2 = kid->sister; freetree(kid); - free((char *)tp); + } + free((void *)tp); } @@ -197,10 +195,15 @@ int ipt[2]; Window rw, cw; unsigned int pm; /* compute pointer location */ - if (gwind == 0 && - (gwind = xfindwind(theDisplay, rwind, picture, 4)) == 0) { - fprintf(stderr, "%s: cannot find display window!\n", progname); - exit(1); + if (gwind == 0) { + register char *wn; + for (wn = picture; *wn; wn++); + while (wn > picture && wn[-1] != '/') wn--; + if ((gwind = xfindwind(theDisplay, rwind, wn, 4)) == 0) { + fprintf(stderr, "%s: cannot find display window!\n", + progname); + exit(1); + } } XQueryPointer(theDisplay, gwind, &rw, &cw, &rx, &ry, &wx, &wy, &pm); xoff = wx - ipt[0];