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

Comparing ray/src/util/findglare.c (file contents):
Revision 1.22 by greg, Mon Apr 22 14:56:28 1991 UTC vs.
Revision 2.5 by greg, Wed Feb 3 17:55:34 1993 UTC

# Line 12 | Line 12 | static char SCCSid[] = "$SunId$ LBL";
12  
13   #include "glare.h"
14  
15 < #define FEQ(a,b)        ((a)-(b)<=FTINY&&(a)-(b)<=FTINY)
15 > #define FEQ(a,b)        ((a)-(b)<=FTINY&&(b)-(a)<=FTINY)
16   #define VEQ(v1,v2)      (FEQ((v1)[0],(v2)[0])&&FEQ((v1)[1],(v2)[1]) \
17                                  &&FEQ((v1)[2],(v2)[2]))
18  
19 < char    *rtargv[32] = {"rtrace", "-h", "-ov", "-fff"};
19 > char    *rtargv[32] = {"rtrace", "-h-", "-ov", "-fff"};
20   int     rtargc = 4;
21  
22   VIEW    ourview = STDVIEW;              /* our view */
# Line 75 | Line 75 | char   *argv[];
75                          }
76                          if (argv[i][2] != 'f')
77                                  goto userr;
78 <                        rval = viewfile(argv[++i], &ourview, 0, 0);
78 >                        rval = viewfile(argv[++i], &ourview, NULL);
79                          if (rval < 0) {
80                                  fprintf(stderr,
81                                  "%s: cannot open view file \"%s\"\n",
# Line 105 | Line 105 | char   *argv[];
105                          combine = !combine;
106                          break;
107                  case 'd':
108 +                        if (argv[i][2] == 'v') {
109 +                                rtargv[rtargc++] = argv[i];
110 +                                break;
111 +                        }
112 +                        /* FALL THROUGH */
113                  case 'l':
114 +                case 's':
115 +                case 'P':
116                          rtargv[rtargc++] = argv[i];
117                          rtargv[rtargc++] = argv[++i];
118                          break;
119 +                case 'w':
120 +                        rtargv[rtargc++] = argv[i];
121 +                        break;
122                  case 'a':
123                          rtargv[rtargc++] = argv[i];
124                          if (argv[i][2] == 'v') {
# Line 130 | Line 140 | char   *argv[];
140          }
141                                                  /* get view */
142          if (picture != NULL) {
143 <                rval = viewfile(picture, &pictview, 0, 0);
143 >                rval = viewfile(picture, &pictview, NULL);
144                  if (rval < 0) {
145                          fprintf(stderr, "%s: cannot open picture file \"%s\"\n",
146                                          progname, picture);
# Line 203 | Line 213 | userr:
213   }
214  
215  
216 + int
217 + angcmp(ap1, ap2)                /* compare two angles */
218 + ANGLE   *ap1, *ap2;
219 + {
220 +        register int    a1, a2;
221 +
222 +        a1 = *ap1;
223 +        a2 = *ap2;
224 +        if (a1 == a2) {
225 +                fprintf(stderr, "%s: duplicate glare angle (%d)\n",
226 +                                progname, a1);
227 +                exit(1);
228 +        }
229 +        return(a1-a2);
230 + }
231 +
232 +
233   init()                          /* initialize global variables */
234   {
235          double  d;
# Line 214 | Line 241 | init()                         /* initialize global variables */
241                                                  /* set direction vectors */
242          for (i = 0; glarang[i] != AEND; i++)
243                  ;
244 <        if (i > 0 && (glarang[0] <= 0 || glarang[i-1] >= 180)) {
245 <                fprintf(stderr, "%s: glare angles must be between 1 and 179\n",
244 >        qsort(glarang, i, sizeof(ANGLE), angcmp);
245 >        if (i > 0 && (glarang[0] <= 0 || glarang[i-1] > 180)) {
246 >                fprintf(stderr, "%s: glare angles must be between 1 and 180\n",
247                                  progname);
248                  exit(1);
249          }
# Line 287 | Line 315 | cleanup()                              /* close files, wait for children */
315          if (octree != NULL)
316                  done_rtrace();
317          if (npixinvw < 100*npixmiss)
318 <                fprintf(stderr, "%s: warning -- missing %ld%% of samples\n",
319 <                                progname, 100L*npixmiss/npixinvw);
318 >                fprintf(stderr, "%s: warning -- missing %d%% of samples\n",
319 >                                progname, (int)(100L*npixmiss/npixinvw));
320   }
321  
322  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines