--- ray/src/common/rglinst.c 1998/07/15 17:52:16 3.3 +++ ray/src/common/rglinst.c 2003/05/13 17:58:32 3.8 @@ -1,13 +1,12 @@ -/* Copyright (c) 1998 Silicon Graphics, Inc. */ - #ifndef lint -static char SCCSid[] = "$SunId$ SGI"; +static const char RCSid[] = "$Id: rglinst.c,v 3.8 2003/05/13 17:58:32 greg Exp $"; #endif - /* * Routines for reading instances and converting to OpenGL. */ +#include "copyright.h" + #include "radogl.h" #include "octree.h" @@ -20,14 +19,12 @@ typedef struct { char octfile[256]; /* octree file path */ } OCTINST; /* octree to instantiate */ -OBJECT nobjects; /* number of objects loaded so far */ - -extern int free(); - static double ogetflt(); static long ogetint(); static char *ogetstr(); -static int loadobj(), octerror(), skiptree(); +static int loadobj(); +static void skiptree(); +static void octerror(); static OCTINST *getoct(); static char *infn; /* input file name */ @@ -35,12 +32,13 @@ static FILE *infp; /* input file stream */ static int objsize; /* size of stored OBJECT's */ static short otypmap[NUMOTYPE+8]; /* object type map */ -static long imhash(mod) char *mod; {return((long)mod);} +static unsigned long imhash(mod) char *mod; {return((unsigned long)mod);} static LUTAB imtab = {imhash,NULL,NULL,NULL,0,NULL,0}; static LUTAB ottab = LU_SINIT(free,free); +int o_instance(o) /* convert instance to list call */ register OBJREC *o; { @@ -69,7 +67,7 @@ register OBJREC *o; } ot = getoct(o->oargs.sarg[0]); /* get octree reference */ if (ot->localmatl &= o->os != NULL) /* set material */ - setmaterial(o->os, ot->cent, 0); + setmaterial((MATREC *)o->os, ot->cent, 0); /* call the assigned list */ glCallList(ot->listid); @@ -79,6 +77,7 @@ register OBJREC *o; glPopAttrib(); } rgl_checkerr("creating instance"); + return(0); } @@ -124,7 +123,6 @@ static OCTINST * getoct(name) /* get/assign octree list id */ char *name; { - extern char *getpath(), *getlibpath(); char *path; register LUENT *lp; register OCTINST *op; @@ -138,7 +136,7 @@ char *name; strcpy(lp->key, name); } if ((op = (OCTINST *)lp->data) == NULL) { - path = getpath(name, getlibpath(), R_OK); + path = getpath(name, getrlibpath(), R_OK); if (path == NULL) { sprintf(errmsg, "cannot find octree \"%s\"", name); error(USER, errmsg); @@ -197,6 +195,7 @@ FVECT cent; } +int loadoct(fname) /* read in objects from octree */ char *fname; { @@ -286,7 +285,7 @@ ogetflt() /* get a floating point number */ } -static +static void skiptree() /* skip octree on input */ { register int i; @@ -311,7 +310,7 @@ skiptree() /* skip octree on input */ } -static +static int loadobj() /* get next object */ { static OBJREC ob; @@ -384,7 +383,7 @@ memerr: } -static +static void octerror(etyp, msg) /* octree error */ int etyp; char *msg;