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 1.8 by greg, Fri Jan 12 11:30:59 1990 UTC vs.
Revision 1.10 by greg, Tue Jun 26 09:00:07 1990 UTC

# Line 76 | Line 76 | setambient(afile)                      /* initialize calculation */
76   char  *afile;
77   {
78          long  ftell();
79        OBJECT  obj;
79          AMBVAL  amb;
80  
81          maxarad = thescene.cusize / 2.0;                /* maximum radius */
# Line 86 | Line 85 | char  *afile;
85                                          /* open ambient file */
86          if (afile != NULL)
87                  if ((ambfp = fopen(afile, "r+")) != NULL) {
88 <                        while (fread(&amb, sizeof(AMBVAL), 1, ambfp) == 1)
88 >                        while (fread((char *)&amb,sizeof(AMBVAL),1,ambfp) == 1)
89                                  avinsert(&amb, &atrunk, thescene.cuorg,
90                                                  thescene.cusize);
91                                                          /* align */
# Line 392 | Line 391 | register RAY  *r;
391                  dnew.k = b2/(dnew.n*dnew.n);
392                                                  /* reinsert */
393                  for (k = 0; k < ne-1 && dnew.k < div[k+1].k; k++)
394 <                        bcopy(&div[k+1], &div[k], sizeof(AMBSAMP));
395 <                bcopy(&dnew, &div[k], sizeof(AMBSAMP));
394 >                        copystruct(&div[k], &div[k+1]);
395 >                copystruct(&div[k], &dnew);
396  
397                  if (ne >= i) {          /* extract darkest division */
398                          ne--;
# Line 438 | Line 437 | AMBVAL  *av;
437   #endif
438          if (ambfp == NULL)
439                  return;
440 <        if (fwrite(av, sizeof(AMBVAL), 1, ambfp) != 1)
440 >        if (fwrite((char *)av, sizeof(AMBVAL), 1, ambfp) != 1)
441                  goto writerr;
442   #ifdef  AMBFLUSH
443          if (++nunflshed >= AMBFLUSH) {
# Line 467 | Line 466 | double  s;
466  
467          if ((av = newambval()) == NULL)
468                  goto memerr;
469 <        bcopy(aval, av, sizeof(AMBVAL));
469 >        copystruct(av, aval);
470          VCOPY(ck0, c0);
471          while (s*(OCTSCALE/2) > av->rad*ambacc) {
472                  if (at->kid == NULL)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines