1 |
< |
/* Copyright (c) 1986 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1991 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
37 |
|
CUBE *scene; |
38 |
|
char *ofn[]; |
39 |
|
{ |
40 |
< |
char sbuf[128]; |
40 |
> |
extern int fputs(); |
41 |
> |
char sbuf[512]; |
42 |
|
int nf; |
43 |
|
OBJECT fnobjects; |
44 |
|
register int i; |
55 |
|
} |
56 |
|
} |
57 |
|
/* get header */ |
58 |
< |
if (load & IO_INFO) |
59 |
< |
copyheader(infp, stdout); |
59 |
< |
else |
60 |
< |
getheader(infp, NULL); |
58 |
> |
if (checkheader(infp, OCTFMT, load&IO_INFO ? stdout : NULL) < 0) |
59 |
> |
octerror(USER, "not an octree"); |
60 |
|
/* check format */ |
61 |
|
if (getint(2) != OCTMAGIC) |
62 |
< |
octerror(USER, "invalid octree format"); |
62 |
> |
octerror(USER, "incompatible octree format"); |
63 |
|
/* get boundaries */ |
64 |
|
if (load & IO_BOUNDS) { |
65 |
|
for (i = 0; i < 3; i++) |
96 |
|
} |
97 |
|
while (getobj() != OVOID) |
98 |
|
; |
99 |
+ |
} else if (load & IO_SCENE) { /* consistency checks */ |
100 |
+ |
/* check object count */ |
101 |
+ |
if (nobjects != objorig+fnobjects) |
102 |
+ |
octerror(USER, "bad object count; octree stale?"); |
103 |
+ |
/* check for non-surfaces */ |
104 |
+ |
if (nonsurfinset(objorig, fnobjects)) |
105 |
+ |
octerror(USER, "non-surface in set; octree stale?"); |
106 |
|
} |
107 |
|
} |
108 |
|
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 |
– |
} |
109 |
|
return(nf); |
110 |
|
} |
111 |
|
|
170 |
|
double d; |
171 |
|
|
172 |
|
d = (double)getint(4)/0x7fffffff; |
173 |
< |
return(ldexp(d, getint(1))); |
173 |
> |
return(ldexp(d, (int)getint(1))); |
174 |
|
} |
175 |
|
|
176 |
|
|