7 |
|
|
8 |
|
#include "copyright.h" |
9 |
|
|
10 |
+ |
#include <ctype.h> |
11 |
+ |
|
12 |
+ |
#include "rtprocess.h" |
13 |
|
#include "radogl.h" |
14 |
|
|
15 |
|
#ifndef NLIST2ALLOC |
21 |
|
static int nextlist, nlistleft = 0; |
22 |
|
|
23 |
|
|
24 |
< |
static void |
25 |
< |
initotypes() /* initialize ofun array */ |
24 |
> |
void |
25 |
> |
initotypes(void) /* initialize ofun array */ |
26 |
|
{ |
27 |
|
if (ofun[OBJ_SPHERE].funp == o_sphere) |
28 |
|
return; /* already done */ |
37 |
|
ofun[OBJ_RING].funp = o_ring; |
38 |
|
ofun[OBJ_SOURCE].funp = o_source; |
39 |
|
ofun[OBJ_INSTANCE].funp = o_instance; |
40 |
+ |
ofun[OBJ_MESH].funp = o_unsupported; |
41 |
|
/* assign material types */ |
42 |
|
ofun[MAT_TRANS].funp = |
43 |
|
ofun[MAT_PLASTIC].funp = |
121 |
|
rgl_octlist(fname, cent, radp, nl) /* load scen into display list */ |
122 |
|
char *fname; |
123 |
|
FVECT cent; /* returned octree center (optional) */ |
124 |
< |
FLOAT *radp; /* returned octree size (optional) */ |
124 |
> |
RREAL *radp; /* returned octree size (optional) */ |
125 |
|
int *nl; /* returned number of lists (optional) */ |
126 |
|
{ |
127 |
|
double r; |
151 |
|
rgl_load(inpspec) /* convert scene description into OGL calls */ |
152 |
|
char *inpspec; |
153 |
|
{ |
150 |
– |
FILE *popen(); |
154 |
|
char *fgetline(); |
155 |
|
FILE *infp; |
156 |
|
char buf[1024]; |
184 |
|
} |
185 |
|
if (inpspec[0] == '!') |
186 |
|
pclose(infp); |
187 |
< |
else |
187 |
> |
else if (infp != stdin) |
188 |
|
fclose(infp); |
189 |
|
} |
190 |
|
|
201 |
|
strcpy(sbuf, "EOF"); |
202 |
|
fgetword(sbuf, MAXSTR, fp); |
203 |
|
ob.omod = 0; /* use ob.os for pointer to material */ |
204 |
< |
if (!strcmp(sbuf, VOIDID)) |
204 |
> |
if (!strcmp(sbuf, VOIDID) || !strcmp(sbuf, ALIASMOD)) |
205 |
|
ob.os = NULL; |
206 |
|
else |
207 |
|
ob.os = (char *)getmatp(sbuf); |
208 |
|
/* get type */ |
209 |
|
strcpy(sbuf, "EOF"); |
210 |
|
fgetword(sbuf, MAXSTR, fp); |
211 |
< |
if (!strcmp(sbuf, ALIASID)) |
209 |
< |
ob.otype = -1; |
210 |
< |
else if ((ob.otype = otype(sbuf)) < 0) { |
211 |
> |
if ((ob.otype = otype(sbuf)) < 0) { |
212 |
|
sprintf(errmsg, "(%s): unknown type \"%s\"", name, sbuf); |
213 |
|
error(USER, errmsg); |
214 |
|
} |
217 |
|
fgetword(sbuf, MAXSTR, fp); |
218 |
|
ob.oname = sbuf; |
219 |
|
/* get arguments */ |
220 |
< |
if (ob.otype == -1) { |
220 |
> |
if (ob.otype == MOD_ALIAS) { |
221 |
|
char sbuf2[MAXSTR]; /* get alias */ |
222 |
|
strcpy(sbuf2, "EOF"); |
223 |
|
fgetword(sbuf2, MAXSTR, fp); |