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

Comparing ray/src/util/xglaresrc.c (file contents):
Revision 2.7 by greg, Mon Nov 10 16:52:24 2003 UTC vs.
Revision 2.10 by greg, Wed Jan 24 04:39:52 2018 UTC

# Line 8 | Line 8 | static const char      RCSid[] = "$Id$";
8   */
9  
10   #include "standard.h"
11 < #include "view.h"
12 < #include "paths.h"
11 >
12 > #include <unistd.h>
13   #include <signal.h>
14   #include <X11/Xlib.h>
15   #include <X11/Xutil.h>
16  
17 + #include "view.h"
18 +
19   #define XIM             "ximage"
20  
21   #define NSEG            30              /* number of segments per circle */
# Line 35 | Line 37 | Display        *theDisplay = NULL;             /* connection to server *
37   GC      vecGC, strGC;
38   Window  gwind;
39  
40 + static void init(char *pname, char *wname);
41 + static void circle_sources(FILE *fp);
42 + static void circle(FVECT dir, double dom);
43 + static void value(FVECT dir, double v);
44  
45 < main(argc, argv)
46 < int     argc;
47 < char    *argv[];
45 >
46 > int
47 > main(
48 >        int     argc,
49 >        char    *argv[]
50 > )
51   {
52          char    *windowname = NULL;
53          FILE    *fp;
# Line 77 | Line 86 | char   *argv[];
86   }
87  
88  
89 < init(pname, wname)              /* get view and find window */
90 < char    *pname, *wname;
89 > static void
90 > init(           /* get view and find window */
91 >        char    *pname,
92 >        char    *wname
93 > )
94   {
95          extern Window   xfindwind();
96          XWindowAttributes       wa;
# Line 117 | Line 129 | char   *pname, *wname;
129                          exit(2);
130                  }
131                                          /* start ximage */
132 <                if (vfork() == 0) {
132 >                if (fork() == 0) {
133                          execlp(XIM, XIM, "-c", "256", pname, 0);
134                          perror(XIM);
135                          fprintf(stderr, "%s: cannot start %s\n",
# Line 177 | Line 189 | char   *pname, *wname;
189   }
190  
191  
192 < circle_sources(fp)              /* circle sources listed in fp */
193 < FILE    *fp;
192 > static void
193 > circle_sources(         /* circle sources listed in fp */
194 >        FILE    *fp
195 > )
196   {
197          char    linbuf[256];
198          int     reading = 0;
# Line 205 | Line 219 | FILE   *fp;
219   }
220  
221  
222 < circle(dir, dom)                /* indicate a solid angle on image */
223 < FVECT   dir;
224 < double  dom;
222 > static void
223 > circle(         /* indicate a solid angle on image */
224 >        FVECT   dir,
225 >        double  dom
226 > )
227   {
228          FVECT   start, cur;
229          XPoint  pt[NSEG+1];
# Line 224 | Line 240 | double dom;
240                  cur[0] += ourview.vp[0];
241                  cur[1] += ourview.vp[1];
242                  cur[2] += ourview.vp[2];
243 <                viewloc(pp, &ourview, cur);
228 <                if (pp[2] <= 0.0)
243 >                if (viewloc(pp, &ourview, cur) <= 0)
244                          goto fail;
245                  loc2pix(ip, &pres, pp[0], pp[1]);
246                  pt[i].x = ip[0];
# Line 239 | Line 254 | fail:
254   }
255  
256  
257 < value(dir, v)                   /* print value on image */
258 < FVECT   dir;
259 < double  v;
257 > static void
258 > value(                  /* print value on image */
259 >        FVECT   dir,
260 >        double  v
261 > )
262   {
263          FVECT   pos;
264          FVECT   pp;
# Line 251 | Line 268 | double v;
268          pos[0] = ourview.vp[0] + dir[0];
269          pos[1] = ourview.vp[1] + dir[1];
270          pos[2] = ourview.vp[2] + dir[2];
271 <        viewloc(pp, &ourview, pos);
255 <        if (pp[2] <= 0.0)
271 >        if (viewloc(pp, &ourview, pos) <= 0)
272                  return;
273          loc2pix(ip, &pres, pp[0], pp[1]);
274          sprintf(buf, "%.0f", v);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines