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

Comparing ray/src/rt/lookamb.c (file contents):
Revision 1.1 by greg, Thu Feb 2 10:41:25 1989 UTC vs.
Revision 1.3 by greg, Thu Jun 6 10:09:50 1991 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1986 Regents of the University of California */
1 > /* Copyright (c) 1991 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 15 | Line 15 | static char SCCSid[] = "$SunId$ LBL";
15   #include  "color.h"
16  
17  
18 typedef double  FVECT[3];
19
18   typedef struct ambval {
19 <        FVECT  pos;             /* position in space */
20 <        FVECT  dir;             /* normal direction */
19 >        float  pos[3];          /* position in space */
20 >        float  dir[3];          /* normal direction */
21          int  lvl;               /* recursion level of parent ray */
22          float  weight;          /* weight of parent ray */
23          COLOR  val;             /* computed ambient value */
# Line 75 | Line 73 | char  *argv[];
73   lookamb(fp)                     /* get ambient values from a file */
74   FILE  *fp;
75   {
76 <        while (fread(&av, sizeof(AMBVAL), 1, fp) == 1) {
76 >        while (fread((char *)&av, sizeof(AMBVAL), 1, fp) == 1) {
77                  if (dataonly) {
78                          printf("%f\t%f\t%f\t", av.pos[0], av.pos[1], av.pos[2]);
79                          printf("%f\t%f\t%f\t", av.dir[0], av.dir[1], av.dir[2]);
# Line 105 | Line 103 | FILE  *fp;
103          for ( ; ; ) {
104                  if (!dataonly)
105                          fscanf(fp, "%*s");
106 <                if (fscanf(fp, "%lf %lf %lf",
106 >                if (fscanf(fp, "%f %f %f",
107                                  &av.pos[0], &av.pos[1], &av.pos[2]) != 3)
108                          return;
109                  if (!dataonly)
110                          fscanf(fp, "%*s");
111 <                if (fscanf(fp, "%lf %lf %lf",
111 >                if (fscanf(fp, "%f %f %f",
112                                  &av.dir[0], &av.dir[1], &av.dir[2]) != 3)
113                          return;
114                  if (!dataonly)
# Line 123 | Line 121 | FILE  *fp;
121                  if (fscanf(fp, "%f %f %f",
122                                  &av.val[RED], &av.val[GRN], &av.val[BLU]) != 3)
123                          return;
124 <                fwrite(&av, sizeof(AMBVAL), 1, stdout);
124 >                fwrite((char *)&av, sizeof(AMBVAL), 1, stdout);
125                  if (ferror(stdout))
126                          exit(1);
127          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines