--- ray/src/hd/rholo.c 1997/11/20 11:39:24 3.12 +++ ray/src/hd/rholo.c 1997/12/01 16:34:21 3.14 @@ -9,6 +9,7 @@ static char SCCSid[] = "$SunId$ SGI"; */ #include "rholo.h" +#include "random.h" #include "paths.h" #include #include @@ -61,6 +62,7 @@ char *argv[]; int force = 0; /* mark start time */ starttime = time(NULL); + initurand(10240); /* initialize urand */ progname = argv[0]; /* get arguments */ for (i = 1; i < argc && argv[i][0] == '-'; i++) switch (argv[i][1]) { @@ -369,6 +371,10 @@ register HDGRID *gp; vval(OBSTRUCTIONS) = "T"; vdef(OBSTRUCTIONS)++; } + if (!vdef(VDIST)) { + vval(VDIST) = "F"; + vdef(VDIST)++; + } if (!vdef(OCCUPANCY)) { vval(OCCUPANCY) = "U"; vdef(OCCUPANCY)++; @@ -463,7 +469,7 @@ loadholo() /* start loading a holodeck from fname */ done_packets(pl) /* handle finished packets */ PACKET *pl; { - static int nunflushed = 0; + static int n2flush = 0; register PACKET *p; while (pl != NULL) { @@ -474,8 +480,8 @@ PACKET *pl; p->nr*sizeof(RAYVAL)); if (outdev != NULL) /* display it */ disp_packet((PACKHEAD *)p); - else - nunflushed += p->nr; + if (hdcachesize <= 0) /* manual flushing */ + n2flush += p->nr; nraysdone += p->nr; npacksdone++; } @@ -483,9 +489,9 @@ PACKET *pl; p->next = freepacks; freepacks = p; } - if (nunflushed >= 256*RPACKSIZ) { + if (n2flush > 512*RPACKSIZ*ncprocs) { hdflush(NULL); /* flush holodeck buffers */ - nunflushed = 0; + n2flush = 0; } }