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.2 by greg, Tue Apr 21 17:24:51 1992 UTC vs.
Revision 2.7 by greg, Sat Feb 22 02:07:28 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 92 | Line 88 | char   *argv[];
88                  exit(1);
89                                          /* loop on input */
90          mainloop();
91 <
91 >                                        /* close pipe and exit */
92 >        pclose(pin);
93          exit(0);
94   }
95  
# Line 143 | Line 140 | struct node    *tp;
140  
141          for (kid = tp->daughter; kid != NULL; kid = kid->sister)
142                  freetree(kid);
143 <        free((char *)tp);
143 >        free((void *)tp);
144   }
145  
146  
# Line 188 | Line 185 | int    xoff, yoff;
185   setvec(ipt)                     /* set up vector drawing for pick */
186   int     ipt[2];
187   {
188 +        extern Window   xfindwind();
189          XWindowAttributes       wa;
190          XColor  xc;
191          XGCValues       gcv;
# Line 195 | Line 193 | int    ipt[2];
193          Window  rw, cw;
194          unsigned int    pm;
195                                          /* compute pointer location */
196 <        if (gwind == 0 &&
197 <                (gwind = xfindwind(theDisplay, rwind, picture, 2)) == 0) {
198 <                fprintf(stderr, "%s: cannot find display window!\n", progname);
199 <                exit(1);
196 >        if (gwind == 0) {
197 >                register char   *wn;
198 >                for (wn = picture; *wn; wn++);
199 >                while (wn > picture && wn[-1] != '/') wn--;
200 >                if ((gwind = xfindwind(theDisplay, rwind, wn, 4)) == 0) {
201 >                        fprintf(stderr, "%s: cannot find display window!\n",
202 >                                        progname);
203 >                        exit(1);
204 >                }
205          }
206          XQueryPointer(theDisplay, gwind, &rw, &cw, &rx, &ry, &wx, &wy, &pm);
207          xoff = wx - ipt[0];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines