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

Comparing ray/src/rt/rtrace.c (file contents):
Revision 1.13 by greg, Wed May 1 11:16:58 1991 UTC vs.
Revision 1.19 by greg, Mon Jul 22 13:09:58 1991 UTC

# Line 30 | Line 30 | static char SCCSid[] = "$SunId$ LBL";
30  
31   #include  "otypes.h"
32  
33 + int  dimlist[MAXDIM];                   /* sampling dimensions */
34 + int  ndims = 0;                         /* number of sampling dimensions */
35 + int  samplendx = 0;                     /* index for this sample */
36 +
37   int  imm_irrad = 0;                     /* compute immediate irradiance? */
38  
39   int  inform = 'a';                      /* input format */
# Line 42 | Line 46 | int  vresolu = 0;                      /* vertical resolution */
46   double  dstrsrc = 0.0;                  /* square source distribution */
47   double  shadthresh = .05;               /* shadow threshold */
48   double  shadcert = .5;                  /* shadow certainty */
49 + int  directrelay = 0;                   /* number of source relays */
50 + int  vspretest = 512;                   /* virtual source pretest density */
51 + int  directinvis = 0;                   /* sources invisible? */
52  
53   int  maxdepth = 6;                      /* maximum recursion depth */
54   double  minweight = 4e-3;               /* minimum ray weight */
# Line 106 | Line 113 | char  *fname;
113                          fflush(stdout);
114                          continue;
115                  }
116 +                samplendx++;
117                                                          /* compute and print */
118                  if (imm_irrad)
119                          irrad(orig, direc);
# Line 227 | Line 235 | register FVECT  vec;
235   int  fmt;
236   FILE  *fp;
237   {
238 +        extern char  *fgetword();
239 +        extern double  atof();
240          static float  vf[3];
241 +        char  buf[32];
242 +        register int  i;
243  
244          switch (fmt) {
245          case 'a':                                       /* ascii */
246 <                if (fscanf(fp, "%lf %lf %lf", vec, vec+1, vec+2) != 3)
247 <                        return(-1);
246 >                for (i = 0; i < 3; i++) {
247 >                        if (fgetword(buf, sizeof(buf), fp) == NULL ||
248 >                                        !isflt(buf))
249 >                                return(-1);
250 >                        vec[i] = atof(buf);
251 >                }
252                  break;
253          case 'f':                                       /* binary float */
254                  if (fread((char *)vf, sizeof(float), 3, fp) != 3)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines