9 |
|
#include "octree.h" |
10 |
|
#include "object.h" |
11 |
|
#include "mesh.h" |
12 |
+ |
#include "resolu.h" |
13 |
|
|
14 |
|
static char *meshfn; /* input file name */ |
15 |
|
static FILE *meshfp; /* mesh file pointer */ |
74 |
|
register int i; |
75 |
|
|
76 |
|
switch (getc(meshfp)) { |
77 |
< |
case OT_EMPTY: |
78 |
< |
return(EMPTY); |
79 |
< |
case OT_FULL: |
80 |
< |
return(getfullnode()); |
81 |
< |
case OT_TREE: |
82 |
< |
if ((ot = octalloc()) == EMPTY) |
83 |
< |
mesherror(SYSTEM, "out of tree space in readmesh"); |
84 |
< |
for (i = 0; i < 8; i++) |
85 |
< |
octkid(ot, i) = gettree(); |
86 |
< |
return(ot); |
87 |
< |
case EOF: |
88 |
< |
mesherror(USER, "truncated mesh octree"); |
89 |
< |
default: |
90 |
< |
mesherror(USER, "damaged mesh octree"); |
77 |
> |
case OT_EMPTY: |
78 |
> |
return(EMPTY); |
79 |
> |
case OT_FULL: |
80 |
> |
return(getfullnode()); |
81 |
> |
case OT_TREE: |
82 |
> |
if ((ot = octalloc()) == EMPTY) |
83 |
> |
mesherror(SYSTEM, "out of tree space in readmesh"); |
84 |
> |
for (i = 0; i < 8; i++) |
85 |
> |
octkid(ot, i) = gettree(); |
86 |
> |
return(ot); |
87 |
> |
case EOF: |
88 |
> |
mesherror(USER, "truncated mesh octree"); |
89 |
> |
default: |
90 |
> |
mesherror(USER, "damaged mesh octree"); |
91 |
|
} |
92 |
+ |
return NULL; /* pro forma return */ |
93 |
|
} |
94 |
|
|
95 |
|
|
246 |
|
sprintf(errmsg, "cannot open mesh file \"%s\"", path); |
247 |
|
error(SYSTEM, errmsg); |
248 |
|
} |
249 |
< |
#ifdef MSDOS |
248 |
< |
setmode(fileno(meshfp), O_BINARY); |
249 |
< |
#endif |
249 |
> |
SET_FILE_BINARY(meshfp); |
250 |
|
/* read header */ |
251 |
|
checkheader(meshfp, MESHFMT, flags&IO_INFO ? stdout : (FILE *)NULL); |
252 |
|
/* read format number */ |