12 |
|
#include "octree.h" |
13 |
|
#include "object.h" |
14 |
|
#include "otypes.h" |
15 |
– |
#include "paths.h" |
15 |
|
#include "resolu.h" |
16 |
|
#include "oconv.h" |
17 |
|
|
18 |
|
#define OMARGIN (10*FTINY) /* margin around global cube */ |
19 |
|
|
20 |
< |
#define MAXOBJFIL 127 /* maximum number of scene files */ |
20 |
> |
#define MAXOBJFIL 255 /* maximum number of scene files */ |
21 |
|
|
23 |
– |
char *progname; /* argv[0] */ |
24 |
– |
|
22 |
|
int nowarn = 0; /* supress warnings? */ |
23 |
|
|
24 |
|
int objlim = 6; /* # of objects before split */ |
25 |
|
|
26 |
|
int resolu = 16384; /* octree resolution limit */ |
27 |
|
|
28 |
< |
CUBE thescene = {EMPTY, {0.0, 0.0, 0.0}, 0.0}; /* our scene */ |
28 |
> |
CUBE thescene = {{0.0, 0.0, 0.0}, 0.0, EMPTY}; /* our scene */ |
29 |
|
|
30 |
|
char *ofname[MAXOBJFIL+1]; /* object file names */ |
31 |
|
int nfiles = 0; /* number of object files */ |
51 |
|
OBJECT startobj; |
52 |
|
int i; |
53 |
|
|
54 |
< |
progname = argv[0] = fixargv0(argv[0]); |
54 |
> |
fixargv0(argv[0]); /* sets global progname */ |
55 |
|
|
56 |
|
ot_initotypes(); |
57 |
|
|
175 |
|
|
176 |
|
void |
177 |
|
wputs( /* warning message */ |
178 |
< |
char *s |
178 |
> |
const char *s |
179 |
|
) |
180 |
|
{ |
181 |
|
if (!nowarn) |
185 |
|
|
186 |
|
void |
187 |
|
eputs( /* put string to stderr */ |
188 |
< |
register char *s |
188 |
> |
const char *s |
189 |
|
) |
190 |
|
{ |
191 |
|
static int inln = 0; |
214 |
|
|
215 |
|
static void |
216 |
|
addobject( /* add an object to a cube */ |
217 |
< |
register CUBE *cu, |
217 |
> |
CUBE *cu, |
218 |
|
OBJECT obj |
219 |
|
) |
220 |
|
{ |
254 |
|
|
255 |
|
static void |
256 |
|
add2full( /* add object to full node */ |
257 |
< |
register CUBE *cu, |
257 |
> |
CUBE *cu, |
258 |
|
OBJECT obj, |
259 |
|
int inc |
260 |
|
) |
263 |
|
OBJECT oset[MAXSET+1]; |
264 |
|
CUBE cukid; |
265 |
|
unsigned char inflg[(MAXSET+7)/8], volflg[(MAXSET+7)/8]; |
266 |
< |
register int i, j; |
266 |
> |
int i, j; |
267 |
|
|
268 |
|
objset(oset, cu->cutree); |
269 |
|
cukid.cusize = cu->cusize * 0.5; |
270 |
|
|
271 |
< |
if (inc==O_IN || oset[0] < objlim || cukid.cusize < mincusize) { |
271 |
> |
if (inc==O_IN || oset[0] < objlim || cukid.cusize < |
272 |
> |
(oset[0] < MAXSET ? mincusize : mincusize/256.0)) { |
273 |
|
/* add to set */ |
274 |
|
if (oset[0] >= MAXSET) { |
275 |
|
sprintf(errmsg, "set overflow in addobject (%s)", |