--- ray/src/util/rad.c 1998/10/19 16:21:41 2.58 +++ ray/src/util/rad.c 2003/06/05 19:29:35 2.63 @@ -1,9 +1,6 @@ -/* Copyright (c) 1998 Silicon Graphics, Inc. */ - #ifndef lint -static char SCCSid[] = "$SunId$ SGI"; +static const char RCSid[] = "$Id: rad.c,v 2.63 2003/06/05 19:29:35 schorsch Exp $"; #endif - /* * Executive program for oconv, rpict and pfilt */ @@ -13,7 +10,6 @@ static char SCCSid[] = "$SunId$ SGI"; #include "paths.h" #include "vars.h" #include -#include /* variables (alphabetical by name) */ #define AMBFILE 0 /* ambient file name */ @@ -81,7 +77,7 @@ char overfile[] = "overture.unf"; char overfile[] = "/dev/null"; #endif -extern time_t fdate(), time(); +extern time_t time(); time_t scenedate; /* date of latest scene or object file */ time_t octreedate; /* date of octree */ @@ -213,16 +209,13 @@ register char *fnames; { char thisfile[MAXPATH]; time_t thisdate, lastdate = 0; - register char *cp; if (fnames == NULL) return(0); - while (*fnames) { - while (isspace(*fnames)) fnames++; - cp = thisfile; - while (*fnames && !isspace(*fnames)) - *cp++ = *fnames++; - *cp = '\0'; + while ((fnames = nextword(thisfile, MAXPATH, fnames)) != NULL) { + if (thisfile[0] == '!' || + (thisfile[0] == '\\' && thisfile[1] == '!')) + continue; if (!(thisdate = fdate(thisfile))) syserr(thisfile); if (thisdate > lastdate) @@ -267,6 +260,10 @@ checkfiles() /* check for existence and modified tim syserr(progname); sprintf(vval(OCTREE), "%s.oct", radname); vdef(OCTREE)++; + } else if (vval(OCTREE)[0] == '!') { + fprintf(stderr, "%s: illegal '%s' specification\n", + progname, vnam(OCTREE)); + quit(1); } octreedate = fdate(vval(OCTREE)); if (vdef(ILLUM)) { /* illum requires secondary octrees */ @@ -824,7 +821,7 @@ char *ro; syserr(vval(OPTFILE)); sprintf(ro, " @%s", vval(OPTFILE)); } -#ifdef MSDOS +#ifdef _WIN32 else if (n > 50) { setenv("ROPT", ro+1); strcpy(ro, " $ROPT"); @@ -843,7 +840,7 @@ register char *po; } switch (vscale(QUALITY)) { case MEDIUM: - po = addarg(po, "-r 1"); + po = addarg(po, "-r .6"); break; case HIGH: po = addarg(po, "-m .25"); @@ -980,7 +977,7 @@ register char *vs; if (cp == viewopts) /* append any additional options */ vs++; /* skip prefixed space if unneeded */ strcpy(cp, vs); -#ifdef MSDOS +#ifdef _WIN32 if (strlen(viewopts) > 40) { setenv("VIEW", viewopts); return("$VIEW"); @@ -1034,25 +1031,25 @@ char *vn; /* returned view name */ printview(vopts) /* print out selected view */ register char *vopts; { - extern char *strstr(), *atos(), *getenv(); VIEW vwr; char buf[128]; register char *cp; again: if (vopts == NULL) return(-1); -#ifdef MSDOS +#ifdef _WIN32 if (vopts[0] == '$') { vopts = getenv(vopts+1); goto again; } #endif copystruct(&vwr, &stdview); - cp = vopts; /* get -vf files first */ + sscanview(&vwr, cp=vopts); /* set initial options */ while ((cp = strstr(cp, "-vf ")) != NULL && - *atos(buf, sizeof(buf), cp += 4)) - viewfile(buf, &vwr, NULL); - sscanview(&vwr, vopts); /* get the rest */ + *atos(buf, sizeof(buf), cp += 4)) { + viewfile(buf, &vwr, NULL); /* load -vf file */ + sscanview(&vwr, cp); /* reset tail */ + } fputs(VIEWSTR, stdout); fprintview(&vwr, stdout); /* print full spec. */ fputc('\n', stdout); @@ -1248,7 +1245,7 @@ rmfile(fn) /* remove a file */ char *fn; { if (!silent) -#ifdef MSDOS +#ifdef _WIN32 printf("\tdel %s\n", fn); #else printf("\trm -f %s\n", fn); @@ -1263,7 +1260,7 @@ mvfile(fold, fnew) /* move a file */ char *fold, *fnew; { if (!silent) -#ifdef MSDOS +#ifdef _WIN32 printf("\trename %s %s\n", fold, fnew); #else printf("\tmv %s %s\n", fold, fnew); @@ -1274,7 +1271,7 @@ char *fold, *fnew; } -#ifdef MSDOS +#ifdef _WIN32 setenv(vname, value) /* set an environment variable */ char *vname, *value; { @@ -1311,6 +1308,7 @@ char *s; } +void quit(ec) /* exit program */ int ec; {