ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/xshowtrace.c
(Generate patch)

Comparing ray/src/px/xshowtrace.c (file contents):
Revision 2.4 by greg, Fri Dec 11 18:24:29 1992 UTC vs.
Revision 2.8 by greg, Fri Jun 27 06:53:22 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1991 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  Display an image and watch the rays get traced.
6   *
# Line 12 | Line 9 | static char SCCSid[] = "$SunId$ LBL";
9  
10   #include "standard.h"
11   #include "view.h"
15 #include "resolu.h"
12   #include <X11/Xlib.h>
13  
14   #define MAXDEPTH        32              /* ridiculous ray tree depth */
# Line 24 | Line 20 | static char SCCSid[] = "$SunId$ LBL";
20   #endif
21  
22   char    rtcom[] = "rtrace -h- -otp -fa -x 1";
23 < char    xicom[] = "ximage";
23 > char    xicom[] = "ximage -c 256";
24  
25   VIEW    ourview = STDVIEW;              /* view for picture */
26   RESOLU  ourres;                         /* picture resolution */
# Line 140 | Line 136 | mainloop()                             /* get and process input */
136   freetree(tp)                            /* free a trace tree */
137   struct node     *tp;
138   {
139 <        register struct node    *kid;
139 >        register struct node    *kid, *k2;
140  
141 <        for (kid = tp->daughter; kid != NULL; kid = kid->sister)
141 >        for (kid = tp->daughter; kid != NULL; kid = k2) {
142 >                k2 = kid->sister;
143                  freetree(kid);
144 <        free((char *)tp);
144 >        }
145 >        free((void *)tp);
146   }
147  
148  
# Line 197 | Line 195 | int    ipt[2];
195          Window  rw, cw;
196          unsigned int    pm;
197                                          /* compute pointer location */
198 <        if (gwind == 0 &&
199 <                (gwind = xfindwind(theDisplay, rwind, picture, 4)) == 0) {
200 <                fprintf(stderr, "%s: cannot find display window!\n", progname);
201 <                exit(1);
198 >        if (gwind == 0) {
199 >                register char   *wn;
200 >                for (wn = picture; *wn; wn++);
201 >                while (wn > picture && wn[-1] != '/') wn--;
202 >                if ((gwind = xfindwind(theDisplay, rwind, wn, 4)) == 0) {
203 >                        fprintf(stderr, "%s: cannot find display window!\n",
204 >                                        progname);
205 >                        exit(1);
206 >                }
207          }
208          XQueryPointer(theDisplay, gwind, &rw, &cw, &rx, &ry, &wx, &wy, &pm);
209          xoff = wx - ipt[0];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines