--- ray/src/ot/oconv.c 1992/10/09 10:26:28 2.5 +++ ray/src/ot/oconv.c 1995/06/02 17:47:04 2.11 @@ -22,12 +22,10 @@ static char SCCSid[] = "$SunId$ LBL"; #define OMARGIN (10*FTINY) /* margin around global cube */ -#define MAXOBJFIL 63 /* maximum number of scene files */ +#define MAXOBJFIL 127 /* maximum number of scene files */ char *progname; /* argv[0] */ -char *libpath; /* library search path */ - int nowarn = 0; /* supress warnings? */ int objlim = 5; /* # of objects before split */ @@ -46,20 +44,17 @@ int (*addobjnotify[])() = {NULL}; /* new object notif main(argc, argv) /* convert object files to an octree */ int argc; -char **argv; +char *argv[]; { - extern char *getenv(); FVECT bbmin, bbmax; char *infile = NULL; + int inpfrozen = 0; int outflags = IO_ALL; OBJECT startobj; int i; progname = argv[0] = fixargv0(argv[0]); - if ((libpath = getenv(ULIBVAR)) == NULL) - libpath = DEFPATH; - initotypes(); for (i = 1; i < argc && argv[i][0] == '-'; i++) @@ -100,13 +95,11 @@ breakopt: if (thescene.cusize > FTINY) error(USER, "only one of '-b' or '-i'"); nfiles = readoct(infile, IO_ALL, &thescene, ofname); - if (nfiles == 0 && outflags & IO_FILES) { - error(WARNING, "frozen octree"); - outflags &= ~IO_FILES; - } - } - - printargs(argc, argv, stdout); /* info. header */ + if (nfiles == 0) + inpfrozen++; + } else + newheader("RADIANCE", stdout); /* new binary file header */ + printargs(argc, argv, stdout); fputformat(OCTFMT, stdout); printf("\n"); @@ -123,6 +116,11 @@ breakopt: } ofname[nfiles] = NULL; + + if (inpfrozen && outflags & IO_FILES) { + error(WARNING, "frozen octree"); + outflags &= ~IO_FILES; + } /* find bounding box */ bbmin[0] = bbmin[1] = bbmin[2] = FHUGE; bbmax[0] = bbmax[1] = bbmax[2] = -FHUGE;