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 2.18 by greg, Wed Nov 15 18:02:52 2023 UTC vs.
Revision 2.19 by greg, Mon Dec 18 20:19:48 2023 UTC

# Line 80 | Line 80 | writamb(                       /* write binary ambient values to stdout */
80                          return;
81                  if (!dataonly)
82                          fscanf(fp, "%*s");
83 <                if (fscanf(fp, FVFORMAT, &norm[0], &norm[1], &norm[2]) != 3)
83 >                if (fscanf(fp, FVFORMAT, &norm[0], &norm[1], &norm[2]) != 3 ||
84 >                                normalize(norm) == 0)
85                          return;
86                  av.ndir = encodedir(norm);
87                  if (!dataonly)
88                          fscanf(fp, "%*s");
89 <                if (fscanf(fp, FVFORMAT, &norm[0], &norm[1], &norm[2]) != 3)
89 >                if (fscanf(fp, FVFORMAT, &norm[0], &norm[1], &norm[2]) != 3 ||
90 >                                normalize(norm) == 0)
91                          return;
92                  av.udir = encodedir(norm);
93                  if (!dataonly)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines