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

Comparing ray/src/hd/holofile.c (file contents):
Revision 3.33 by gwlarson, Sat Jan 9 09:16:14 1999 UTC vs.
Revision 3.36 by gwlarson, Mon Feb 1 09:56:18 1999 UTC

# Line 13 | Line 13 | static char SCCSid[] = "$SunId$ SGI";
13   #include "holo.h"
14  
15   #ifndef CACHESIZE
16 < #define CACHESIZE       16      /* default cache size (Mbytes, 0==inf) */
16 > #ifdef BIGMEM
17 > #define CACHESIZE       32      /* default cache size (Mbytes, 0==inf) */
18 > #else
19 > #define CACHESIZE       12
20   #endif
21 + #endif
22   #ifndef FREEBEAMS
23   #define FREEBEAMS       1500    /* maximum beams to free at a time */
24   #endif
# Line 554 | Line 558 | int    i;
558                  }
559          biglob(hp)->nrd -= bi->nrd;             /* tell fragment it's free */
560          bi->nrd = 0;
561 <        bi->fo = 0;
561 >        bi->fo = 0L;
562          return(1);
563   }
564  
# Line 644 | Line 648 | register int   i;
648                  hp->bi[i].fo = nfo;
649          } else
650                  hp->bi[i].fo = 0L;
651 <        biglob(hp)->nrd += hp->bi[i].nrd = nrays;
651 >        biglob(hp)->nrd += nrays - hp->bi[i].nrd;
652 >        hp->bi[i].nrd = nrays;
653          markdirty(hp, i);               /* section directory now out of date */
654          return(1);
655   }
# Line 666 | Line 671 | register int   i;
671          if (hdfragl[hp->fd].writerr)    /* check for file error */
672                  return(0);
673          if (i == 0) {                   /* clear entire holodeck */
674 +                if (blglob(hp)->nrm == 0)
675 +                        return(0);              /* already clear */
676                  nchanged = 0;
677                  for (i = nbeams(hp); i > 0; i--)
678                          if (hp->bl[i] != NULL)
679                                  nchanged += hdfreebeam(hp, i);
680 +                DCHECK(blglob(hp)->nrm != 0,
681 +                                CONSISTENCY, "bad beam count in hdfreebeam");
682                  return(nchanged);
683          }
684          DCHECK(i < 1 | i > nbeams(hp),
# Line 701 | Line 710 | register int   i;
710                  return(nchanged);
711          }
712          if (i == 0) {                   /* clobber entire holodeck */
713 +                if (biglob(hp)->nrd == 0 & blglob(hp)->nrm == 0)
714 +                        return(0);              /* already empty */
715                  nchanged = 0;
716 +                nchanged = 0;
717                  for (i = nbeams(hp); i > 0; i--)
718                          if (hp->bi[i].nrd > 0 || hp->bl[i] != NULL)
719                                  nchanged += hdkillbeam(hp, i);
# Line 719 | Line 731 | register int   i;
731          if (hp->bi[i].nrd) {
732                  if (hdfragflags&FF_KILL)
733                          hdfreefrag(hp, i);
734 +                biglob(hp)->nrd -= hp->bi[i].nrd;
735                  hp->bi[i].nrd = 0;      /* make sure it's gone */
736                  hp->bi[i].fo = 0L;
737          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines