--- ray/src/common/rglfile.c 2003/02/25 02:47:22 3.5 +++ ray/src/common/rglfile.c 2004/03/28 20:33:12 3.11 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rglfile.c,v 3.5 2003/02/25 02:47:22 greg Exp $"; +static const char RCSid[] = "$Id: rglfile.c,v 3.11 2004/03/28 20:33:12 schorsch Exp $"; #endif /* * Load Radiance object(s) and create OpenGL display lists @@ -7,6 +7,9 @@ static const char RCSid[] = "$Id: rglfile.c,v 3.5 2003 #include "copyright.h" +#include + +#include "rtprocess.h" #include "radogl.h" #ifndef NLIST2ALLOC @@ -18,8 +21,8 @@ FUN ofun[NUMOTYPE] = INIT_OTYPE; static int nextlist, nlistleft = 0; -static void -initotypes() /* initialize ofun array */ +void +initotypes(void) /* initialize ofun array */ { if (ofun[OBJ_SPHERE].funp == o_sphere) return; /* already done */ @@ -34,6 +37,7 @@ initotypes() /* initialize ofun array */ ofun[OBJ_RING].funp = o_ring; ofun[OBJ_SOURCE].funp = o_source; ofun[OBJ_INSTANCE].funp = o_instance; + ofun[OBJ_MESH].funp = o_unsupported; /* assign material types */ ofun[MAT_TRANS].funp = ofun[MAT_PLASTIC].funp = @@ -117,7 +121,7 @@ int rgl_octlist(fname, cent, radp, nl) /* load scen into display list */ char *fname; FVECT cent; /* returned octree center (optional) */ -FLOAT *radp; /* returned octree size (optional) */ +RREAL *radp; /* returned octree size (optional) */ int *nl; /* returned number of lists (optional) */ { double r; @@ -147,7 +151,6 @@ void rgl_load(inpspec) /* convert scene description into OGL calls */ char *inpspec; { - FILE *popen(); char *fgetline(); FILE *infp; char buf[1024]; @@ -198,16 +201,14 @@ FILE *fp; strcpy(sbuf, "EOF"); fgetword(sbuf, MAXSTR, fp); ob.omod = 0; /* use ob.os for pointer to material */ - if (!strcmp(sbuf, VOIDID)) + if (!strcmp(sbuf, VOIDID) || !strcmp(sbuf, ALIASMOD)) ob.os = NULL; else ob.os = (char *)getmatp(sbuf); /* get type */ strcpy(sbuf, "EOF"); fgetword(sbuf, MAXSTR, fp); - if (!strcmp(sbuf, ALIASID)) - ob.otype = -1; - else if ((ob.otype = otype(sbuf)) < 0) { + if ((ob.otype = otype(sbuf)) < 0) { sprintf(errmsg, "(%s): unknown type \"%s\"", name, sbuf); error(USER, errmsg); } @@ -216,7 +217,7 @@ FILE *fp; fgetword(sbuf, MAXSTR, fp); ob.oname = sbuf; /* get arguments */ - if (ob.otype == -1) { + if (ob.otype == MOD_ALIAS) { char sbuf2[MAXSTR]; /* get alias */ strcpy(sbuf2, "EOF"); fgetword(sbuf2, MAXSTR, fp);