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

Comparing ray/src/rt/ambient.c (file contents):
Revision 2.4 by greg, Fri Apr 10 16:14:34 1992 UTC vs.
Revision 2.5 by greg, Mon Jul 13 16:17:49 1992 UTC

# Line 75 | Line 75 | char  *afile;
75                                                  /* open ambient file */
76          if (afile != NULL)
77                  if ((ambfp = fopen(afile, "r+")) != NULL) {
78 <                        while (fread((char *)&amb,sizeof(AMBVAL),1,ambfp) == 1)
78 >                        while (readambval(&amb, ambfp))
79                                  avinsert(&amb, &atrunk, thescene.cuorg,
80                                                  thescene.cusize);
81                                                          /* align */
82 <                        fseek(ambfp, -(ftell(ambfp)%sizeof(AMBVAL)), 1);
82 >                        fseek(ambfp, -(ftell(ambfp)%AMBVALSIZ), 1);
83                  } else if ((ambfp = fopen(afile, "w")) == NULL) {
84                          sprintf(errmsg, "cannot open ambient file \"%s\"",
85                                          afile);
# Line 305 | Line 305 | AMBVAL  *av;
305   #endif
306          if (ambfp == NULL)
307                  return;
308 <        if (fwrite((char *)av, sizeof(AMBVAL), 1, ambfp) != 1)
308 >        if (writambval(av, ambfp) < 0)
309                  goto writerr;
310   #ifdef  AMBFLUSH
311          if (++nunflshed >= AMBFLUSH) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines