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.1 by greg, Tue Nov 12 17:19:13 1991 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 203 | Line 203 | userr:
203   }
204  
205  
206 + int
207 + angcmp(ap1, ap2)                /* compare two angles */
208 + ANGLE   *ap1, *ap2;
209 + {
210 +        register int    a1, a2;
211 +
212 +        a1 = *ap1;
213 +        a2 = *ap2;
214 +        if (a1 == a2) {
215 +                fprintf(stderr, "%s: duplicate glare angle (%d)\n",
216 +                                progname, a1);
217 +                exit(1);
218 +        }
219 +        return(a1-a2);
220 + }
221 +
222 +
223   init()                          /* initialize global variables */
224   {
225          double  d;
# Line 214 | Line 231 | init()                         /* initialize global variables */
231                                                  /* set direction vectors */
232          for (i = 0; glarang[i] != AEND; i++)
233                  ;
234 <        if (i > 0 && (glarang[0] <= 0 || glarang[i-1] >= 180)) {
235 <                fprintf(stderr, "%s: glare angles must be between 1 and 179\n",
234 >        qsort(glarang, i, sizeof(ANGLE), angcmp);
235 >        if (i > 0 && (glarang[0] <= 0 || glarang[i-1] > 180)) {
236 >                fprintf(stderr, "%s: glare angles must be between 1 and 180\n",
237                                  progname);
238                  exit(1);
239          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines