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

Comparing ray/src/hd/rholo.c (file contents):
Revision 3.4 by gregl, Mon Nov 3 18:33:12 1997 UTC vs.
Revision 3.5 by gregl, Wed Nov 5 17:29:17 1997 UTC

# Line 138 | Line 138 | initrholo()                    /* get our holodeck running */
138          else
139                  endtime = starttime + vflt(TIME)*3600.;
140                                                  /* set up memory cache */
141 <        hdcachesize = 1024.*1024.*vflt(CACHE);
141 >        if (outdev == NULL)
142 >                hdcachesize = 0;        /* manual flushing */
143 >        else if (vdef(CACHE))
144 >                hdcachesize = 1024.*1024.*vflt(CACHE);
145                                                  /* open report file */
146          if (vdef(REPORT)) {
147                  register char   *s = sskip2(vval(REPORT), 1);
# Line 295 | Line 298 | register HDGRID        *gp;
298                  vval(DISKSPACE) = "100";
299                  vdef(DISKSPACE)++;
300          }
298        if (!vdef(CACHE)) {
299                sprintf(errmsg,
300                        "no %s setting, assuming 10 Mbytes available",
301                                vnam(CACHE));
302                error(WARNING, errmsg);
303                vval(CACHE) = "10";
304                vdef(CACHE)++;
305        }
301          if (!vdef(OBSTRUCTIONS)) {
302                  vval(OBSTRUCTIONS) = "T";
303                  vdef(OBSTRUCTIONS)++;
# Line 394 | Line 389 | loadholo()                     /* start loading a holodeck from fname */
389   done_packets(pl)                /* handle finished packets */
390   PACKET  *pl;
391   {
392 +        static int      nunflushed = 0;
393          register PACKET *p;
394  
395          while (pl != NULL) {
# Line 404 | Line 400 | PACKET *pl;
400                                  p->nr*sizeof(RAYVAL));
401                          if (outdev != NULL)     /* display it */
402                                  disp_packet(p);
403 +                        else
404 +                                nunflushed += p->nr;
405                  }
406                  nraysdone += p->nr;
407                  npacksdone++;
408                  p->nr = 0;                      /* push onto free list */
409                  p->next = freepacks;
410                  freepacks = p;
411 +        }
412 +        if (nunflushed >= 256*RPACKSIZ) {
413 +                hdflush(NULL);                  /* flush holodeck buffers */
414 +                nunflushed = 0;
415          }
416   }
417  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines