| 18 |
|
|
| 19 |
|
#include "otypes.h" |
| 20 |
|
|
| 21 |
< |
double atof(); |
| 22 |
< |
double getflt(); |
| 23 |
< |
long getint(); |
| 24 |
< |
char *getstr(); |
| 25 |
< |
OCTREE getfullnode(), gettree(); |
| 21 |
> |
extern double atof(); |
| 22 |
> |
static double getflt(); |
| 23 |
> |
static long getint(); |
| 24 |
> |
static char *getstr(); |
| 25 |
> |
static OCTREE getfullnode(), gettree(); |
| 26 |
|
|
| 27 |
|
static char *infn; /* input file name */ |
| 28 |
|
static FILE *infp; /* input file stream */ |
| 39 |
|
{ |
| 40 |
|
char sbuf[128]; |
| 41 |
|
int nf; |
| 42 |
+ |
OBJECT fnobjects; |
| 43 |
|
register int i; |
| 44 |
|
|
| 45 |
|
if (fname == NULL) { |
| 81 |
|
} |
| 82 |
|
if (load & IO_FILES) |
| 83 |
|
ofn[nf] = NULL; |
| 84 |
+ |
/* get number of objects */ |
| 85 |
+ |
fnobjects = getint(sizeof(OBJECT)); |
| 86 |
|
|
| 87 |
|
if (load & IO_TREE) { |
| 88 |
|
/* get the octree */ |
| 100 |
|
} |
| 101 |
|
} |
| 102 |
|
fclose(infp); |
| 103 |
+ |
/* consistency checks */ |
| 104 |
+ |
if (load & IO_SCENE) { |
| 105 |
+ |
/* check object count */ |
| 106 |
+ |
if (nobjects != objorig+fnobjects) |
| 107 |
+ |
octerror(USER, "bad object count; octree stale?"); |
| 108 |
+ |
/* check for non-surfaces */ |
| 109 |
+ |
if (nonsurfinset(objorig, fnobjects)) |
| 110 |
+ |
octerror(USER, "non-surface in set; octree stale?"); |
| 111 |
+ |
} |
| 112 |
|
return(nf); |
| 113 |
|
} |
| 114 |
|
|
| 173 |
|
double d; |
| 174 |
|
|
| 175 |
|
d = (double)getint(4)/0x7fffffff; |
| 176 |
< |
return(ldexp(d, getint(1))); |
| 176 |
> |
return(ldexp(d, (int)getint(1))); |
| 177 |
|
} |
| 178 |
|
|
| 179 |
|
|