--- ray/src/rt/rpict.c 2003/07/03 18:03:58 2.59 +++ ray/src/rt/rpict.c 2004/03/28 16:31:14 2.68 @@ -7,7 +7,9 @@ static const char RCSid[] = "$Id"; #include "copyright.h" +#include "platform.h" #include "ray.h" +#include "paths.h" #include @@ -24,10 +26,10 @@ static const char RCSid[] = "$Id"; #include #include -#include "platform.h" #include "view.h" #include "random.h" #include "paths.h" +#include "rtmisc.h" /* myhostname() */ #define RFTEMPLATE "rfXXXXXX" @@ -81,16 +83,16 @@ double specjitter = 1.; /* specular sampling jitter * int backvis = 1; /* back face visibility */ -int maxdepth = 6; /* maximum recursion depth */ -double minweight = 5e-3; /* minimum ray weight */ +int maxdepth = 7; /* maximum recursion depth */ +double minweight = 4e-3; /* minimum ray weight */ char *ambfile = NULL; /* ambient file name */ COLOR ambval = BLKCOLOR; /* ambient value */ int ambvwt = 0; /* initial weight for ambient value */ double ambacc = 0.2; /* ambient accuracy */ -int ambres = 32; /* ambient resolution */ -int ambdiv = 128; /* ambient divisions */ -int ambssamp = 0; /* ambient super-samples */ +int ambres = 64; /* ambient resolution */ +int ambdiv = 512; /* ambient divisions */ +int ambssamp = 128; /* ambient super-samples */ int ambounce = 0; /* ambient bounces */ char *amblist[128]; /* ambient include/exclude list */ int ambincl = -1; /* include == 1, exclude == 0 */ @@ -149,7 +151,6 @@ int code; void report() /* report progress */ { - extern char *myhostname(); double u, s; #ifdef BSD struct rusage rubuf; @@ -243,7 +244,7 @@ char *pout, *zout, *prvr; setview(&ourview); prvr = fbuf; /* mark for renaming */ } - if (pout != NULL & prvr != NULL) { + if ((pout != NULL) & (prvr != NULL)) { sprintf(fbuf, pout, seq); if (!strcmp(prvr, fbuf)) { /* rename */ strcpy(fbuf2, fbuf); @@ -253,7 +254,7 @@ char *pout, *zout, *prvr; cp--; strcpy(cp, RFTEMPLATE); prvr = mktemp(fbuf2); - if (rename(fbuf, prvr) < 0) + if (rename(fbuf, prvr) < 0) { if (errno == ENOENT) { /* ghost file */ sprintf(errmsg, "new output file \"%s\"", @@ -266,6 +267,7 @@ char *pout, *zout, *prvr; fbuf, prvr); error(SYSTEM, errmsg); } + } } } npicts = 0; /* render sequence */ @@ -294,9 +296,8 @@ char *pout, *zout, *prvr; dupheader(); } hres = hresolu; vres = vresolu; pa = pixaspect; - if (prvr != NULL) - if (viewfile(prvr, &ourview, &rs) <= 0 - || rs.rt != PIXSTANDARD) { + if (prvr != NULL) { + if (viewfile(prvr, &ourview, &rs) <= 0) { sprintf(errmsg, "cannot recover view parameters from \"%s\"", prvr); error(WARNING, errmsg); @@ -305,6 +306,7 @@ char *pout, *zout, *prvr; hres = scanlen(&rs); vres = numscans(&rs); } + } if ((cp = setview(&ourview)) != NULL) error(USER, cp); normaspect(viewaspect(&ourview), &pa, &hres, &vres); @@ -322,7 +324,7 @@ char *pout, *zout, *prvr; putchar('\n'); if (pa < .99 || pa > 1.01) fputaspect(pa, stdout); - fputnow(); + fputnow(stdout); fputformat(COLRFMT, stdout); putchar('\n'); if (zout != NULL) @@ -344,7 +346,7 @@ FILE *fp; { char linebuf[256]; - copystruct(&lastview, &ourview); + lastview = ourview; while (fgets(linebuf, sizeof(linebuf), fp) != NULL) if (isview(linebuf) && sscanview(&ourview, linebuf) > 0) return(0); @@ -411,7 +413,7 @@ char *zfile, *oldfile; if (i >= vres) goto alldone; if (zfd != -1 && i > 0 && - lseek(zfd, (off_t)i*hres*sizeof(float), 0) < 0) + lseek(zfd, (off_t)i*hres*sizeof(float), SEEK_SET) < 0) error(SYSTEM, "z-file seek error in render"); pctdone = 100.0*i/vres; if (ralrm > 0) /* report init stats */