| 22 |
|
|
| 23 |
|
#define OMARGIN (10*FTINY) /* margin around global cube */ |
| 24 |
|
|
| 25 |
< |
#define MAXOBJFIL 63 /* maximum number of scene files */ |
| 25 |
> |
#define MAXOBJFIL 127 /* maximum number of scene files */ |
| 26 |
|
|
| 27 |
|
char *progname; /* argv[0] */ |
| 28 |
|
|
| 29 |
– |
char *libpath; /* library search path */ |
| 30 |
– |
|
| 29 |
|
int nowarn = 0; /* supress warnings? */ |
| 30 |
|
|
| 31 |
|
int objlim = 5; /* # of objects before split */ |
| 44 |
|
|
| 45 |
|
main(argc, argv) /* convert object files to an octree */ |
| 46 |
|
int argc; |
| 47 |
< |
char **argv; |
| 47 |
> |
char *argv[]; |
| 48 |
|
{ |
| 51 |
– |
extern char *getenv(); |
| 49 |
|
FVECT bbmin, bbmax; |
| 50 |
|
char *infile = NULL; |
| 51 |
+ |
int inpfrozen = 0; |
| 52 |
|
int outflags = IO_ALL; |
| 53 |
|
OBJECT startobj; |
| 54 |
|
int i; |
| 55 |
|
|
| 56 |
|
progname = argv[0] = fixargv0(argv[0]); |
| 57 |
|
|
| 60 |
– |
if ((libpath = getenv(ULIBVAR)) == NULL) |
| 61 |
– |
libpath = DEFPATH; |
| 62 |
– |
|
| 58 |
|
initotypes(); |
| 59 |
|
|
| 60 |
|
for (i = 1; i < argc && argv[i][0] == '-'; i++) |
| 95 |
|
if (thescene.cusize > FTINY) |
| 96 |
|
error(USER, "only one of '-b' or '-i'"); |
| 97 |
|
nfiles = readoct(infile, IO_ALL, &thescene, ofname); |
| 98 |
< |
if (nfiles == 0 && outflags & IO_FILES) { |
| 99 |
< |
error(WARNING, "frozen octree"); |
| 100 |
< |
outflags &= ~IO_FILES; |
| 101 |
< |
} |
| 102 |
< |
} |
| 108 |
< |
|
| 109 |
< |
printargs(argc, argv, stdout); /* info. header */ |
| 98 |
> |
if (nfiles == 0) |
| 99 |
> |
inpfrozen++; |
| 100 |
> |
} else |
| 101 |
> |
newheader("RADIANCE", stdout); /* new binary file header */ |
| 102 |
> |
printargs(argc, argv, stdout); |
| 103 |
|
fputformat(OCTFMT, stdout); |
| 104 |
|
printf("\n"); |
| 105 |
|
|
| 116 |
|
} |
| 117 |
|
|
| 118 |
|
ofname[nfiles] = NULL; |
| 119 |
+ |
|
| 120 |
+ |
if (inpfrozen && outflags & IO_FILES) { |
| 121 |
+ |
error(WARNING, "frozen octree"); |
| 122 |
+ |
outflags &= ~IO_FILES; |
| 123 |
+ |
} |
| 124 |
|
/* find bounding box */ |
| 125 |
|
bbmin[0] = bbmin[1] = bbmin[2] = FHUGE; |
| 126 |
|
bbmax[0] = bbmax[1] = bbmax[2] = -FHUGE; |