--- ray/src/rt/rv2.c 1989/06/08 17:04:40 1.8 +++ ray/src/rt/rv2.c 1989/07/27 22:58:26 1.10 @@ -65,6 +65,8 @@ char *s; if (pframe.d < 0) pframe.d = 0; if (pframe.r > ourview.hresolu) pframe.r = ourview.hresolu; if (pframe.u > ourview.vresolu) pframe.u = ourview.vresolu; + if (pframe.l > pframe.r) pframe.l = pframe.r; + if (pframe.d > pframe.u) pframe.d = pframe.u; pdepth = 0; } @@ -74,12 +76,12 @@ char *s; { FILE *fp; char buf[128]; - char *fname, *getpath(); + char *fname; int change = 0; VIEW nv; if (sscanf(s, "%s", buf) == 1) { /* write parameters to a file */ - if ((fname = getpath(buf, NULL)) == NULL || + if ((fname = getpath(buf, NULL, 0)) == NULL || (fp = fopen(fname, "a")) == NULL) { sprintf(errmsg, "cannot open \"%s\"", buf); error(COMMAND, errmsg); @@ -156,13 +158,13 @@ lastview(s) /* return to a previous view */ char *s; { char buf[128]; - char *fname, *getpath(); + char *fname; int success; VIEW nv; if (sscanf(s, "%s", buf) == 1) { /* get parameters from a file */ bcopy(&stdview, &nv, sizeof(VIEW)); - if ((fname = getpath(buf, NULL)) == NULL || + if ((fname = getpath(buf, NULL, 0)) == NULL || (success = viewfile(fname, &nv)) == -1) { sprintf(errmsg, "cannot open \"%s\"", buf); error(COMMAND, errmsg); @@ -392,6 +394,7 @@ register char *s; extern int maxdepth; extern double dstrsrc; extern double shadthresh; + extern double shadcert; extern COLOR ambval; extern double ambacc; extern double minarad; @@ -404,7 +407,7 @@ register char *s; char buf[128]; if (s[0] == '\0') { - (*dev->comout)("aa ab ad ar as av dj dt lr lw sp st: "); + (*dev->comout)("aa ab ad ar as av dc dj dt lr lw sp st: "); (*dev->comin)(buf); s = buf; } @@ -450,6 +453,17 @@ register char *s; } dstrsrc = d0; break; + case 'c': /* certainty */ + if (sscanf(s+2, "%lf", &d0) != 1) { + sprintf(buf, "direct certainty (%.6g): ", + shadcert); + (*dev->comout)(buf); + (*dev->comin)(buf); + if (sscanf(buf, "%lf", &d0) != 1) + break; + } + shadcert = d0; + break; case 't': /* threshold */ if (sscanf(s+2, "%lf", &d0) != 1) { sprintf(buf, "direct threshold (%.6g): ", @@ -641,7 +655,7 @@ writepict(s) /* write the picture to a file */ char *s; { static char buf[128]; - char *fname, *getpath(); + char *fname; FILE *fp; COLR *scanline; int y; @@ -650,7 +664,7 @@ char *s; error(COMMAND, "no file"); return; } - if ((fname = getpath(buf, NULL)) == NULL || + if ((fname = getpath(buf, NULL, 0)) == NULL || (fp = fopen(fname, "w")) == NULL) { sprintf(errmsg, "cannot open \"%s\"", buf); error(COMMAND, errmsg);