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.5 by greg, Fri Dec 11 18:28:43 1992 UTC vs.
Revision 2.9 by schorsch, Mon Nov 10 12:28:56 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   *
7   *      9/21/90 Greg Ward
8   */
9  
10 + #include <X11/Xlib.h>
11 +
12   #include "standard.h"
13 + #include "paths.h"
14   #include "view.h"
15 #include "resolu.h"
16 #include <X11/Xlib.h>
15  
16   #define MAXDEPTH        32              /* ridiculous ray tree depth */
17  
# Line 53 | Line 51 | int    argc;
51   char    *argv[];
52   {
53          int     i;
54 <        char    combuf[256];
54 >        char    combuf[PATH_MAX];
55  
56          progname = argv[0];
57          for (i = 1; i < argc-2; i++)
# Line 82 | Line 80 | char   *argv[];
80                  exit(1);
81          }
82                                          /* build input command */
83 <        sprintf(combuf, "%s %s | %s", xicom, picture, rtcom);
83 >        sprintf(combuf, "%s \"%s\" | %s", xicom, picture, rtcom);
84          for ( ; i < argc-1; i++) {
85                  strcat(combuf, " ");
86                  strcat(combuf, argv[i]);
# Line 140 | Line 138 | mainloop()                             /* get and process input */
138   freetree(tp)                            /* free a trace tree */
139   struct node     *tp;
140   {
141 <        register struct node    *kid;
141 >        register struct node    *kid, *k2;
142  
143 <        for (kid = tp->daughter; kid != NULL; kid = kid->sister)
143 >        for (kid = tp->daughter; kid != NULL; kid = k2) {
144 >                k2 = kid->sister;
145                  freetree(kid);
146 <        free((char *)tp);
146 >        }
147 >        free((void *)tp);
148   }
149  
150  
# Line 197 | Line 197 | int    ipt[2];
197          Window  rw, cw;
198          unsigned int    pm;
199                                          /* compute pointer location */
200 <        if (gwind == 0 &&
201 <                (gwind = xfindwind(theDisplay, rwind, picture, 4)) == 0) {
202 <                fprintf(stderr, "%s: cannot find display window!\n", progname);
203 <                exit(1);
200 >        if (gwind == 0) {
201 >                register char   *wn;
202 >                for (wn = picture; *wn; wn++);
203 >                while (wn > picture && wn[-1] != '/') wn--;
204 >                if ((gwind = xfindwind(theDisplay, rwind, wn, 4)) == 0) {
205 >                        fprintf(stderr, "%s: cannot find display window!\n",
206 >                                        progname);
207 >                        exit(1);
208 >                }
209          }
210          XQueryPointer(theDisplay, gwind, &rw, &cw, &rx, &ry, &wx, &wy, &pm);
211          xoff = wx - ipt[0];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines