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.9 by schorsch, Fri Mar 26 23:34:24 2004 UTC vs.
Revision 2.13 by greg, Tue Jun 3 21:31:51 2025 UTC

# Line 27 | Line 27 | float  col[3] = {1.,0.,0.};            /* color */
27   VIEW    ourview = STDVIEW;              /* view for picture */
28   RESOLU  pres;                           /* picture resolution */
29  
30 char    *progname;                      /* program name */
31
30   Display *theDisplay = NULL;             /* connection to server */
31  
32   #define rwind           RootWindow(theDisplay,ourScreen)
# Line 52 | Line 50 | main(
50          char    *windowname = NULL;
51          FILE    *fp;
52  
53 <        progname = *argv++; argc--;
53 >        fixargv0(*argv++); argc--;
54          while (argc > 0 && argv[0][0] == '-') {
55                  switch (argv[0][1]) {
56                  case 'n':
# Line 205 | Line 203 | circle_sources(                /* circle sources listed in fp */
203                                  XFlush(theDisplay);
204                                  return;
205                          }
206 <                        if (sscanf(linbuf, "%lf %lf %lf %lf %lf",
207 <                                        &dir[0], &dir[1], &dir[2],
208 <                                        &dom, &lum) != 5)
206 >                        if (sscanf(linbuf, FVFORMAT,
207 >                                        &dir[0], &dir[1], &dir[2]) != 3 ||
208 >                                        sscanf(sskip2(linbuf, 3), "%lf %lf",
209 >                                                &dom, &lum) != 2)
210                                  break;
211                          circle(dir, dom);
212                          value(dir, lum);
# Line 240 | Line 239 | circle(                /* indicate a solid angle on image */
239                  cur[0] += ourview.vp[0];
240                  cur[1] += ourview.vp[1];
241                  cur[2] += ourview.vp[2];
242 <                viewloc(pp, &ourview, cur);
244 <                if (pp[2] <= 0.0)
242 >                if (viewloc(pp, &ourview, cur) != VL_GOOD)
243                          goto fail;
244                  loc2pix(ip, &pres, pp[0], pp[1]);
245                  pt[i].x = ip[0];
# Line 269 | Line 267 | value(                 /* print value on image */
267          pos[0] = ourview.vp[0] + dir[0];
268          pos[1] = ourview.vp[1] + dir[1];
269          pos[2] = ourview.vp[2] + dir[2];
270 <        viewloc(pp, &ourview, pos);
273 <        if (pp[2] <= 0.0)
270 >        if (viewloc(pp, &ourview, pos) != VL_GOOD)
271                  return;
272          loc2pix(ip, &pres, pp[0], pp[1]);
273          sprintf(buf, "%.0f", v);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines