1 |
– |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ SGI"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Routines for reading instances and converting to OpenGL. |
6 |
|
*/ |
7 |
|
|
8 |
+ |
#include "copyright.h" |
9 |
+ |
|
10 |
|
#include "radogl.h" |
11 |
|
#include "octree.h" |
12 |
|
|
19 |
|
char octfile[256]; /* octree file path */ |
20 |
|
} OCTINST; /* octree to instantiate */ |
21 |
|
|
23 |
– |
OBJECT nobjects; /* number of objects loaded so far */ |
24 |
– |
|
25 |
– |
extern int free(); |
26 |
– |
|
22 |
|
static double ogetflt(); |
23 |
|
static long ogetint(); |
24 |
|
static char *ogetstr(); |
25 |
< |
static int loadobj(), octerror(), skiptree(); |
25 |
> |
static int loadobj(); |
26 |
> |
static void skiptree(); |
27 |
> |
static void octerror(); |
28 |
|
static OCTINST *getoct(); |
29 |
|
|
30 |
|
static char *infn; /* input file name */ |
32 |
|
static int objsize; /* size of stored OBJECT's */ |
33 |
|
static short otypmap[NUMOTYPE+8]; /* object type map */ |
34 |
|
|
35 |
< |
static long imhash(mod) char *mod; {return((long)mod);} |
35 |
> |
static unsigned long imhash(mod) char *mod; {return((unsigned long)mod);} |
36 |
|
static LUTAB imtab = {imhash,NULL,NULL,NULL,0,NULL,0}; |
37 |
|
|
38 |
|
static LUTAB ottab = LU_SINIT(free,free); |
39 |
|
|
40 |
|
|
41 |
+ |
int |
42 |
|
o_instance(o) /* convert instance to list call */ |
43 |
|
register OBJREC *o; |
44 |
|
{ |
67 |
|
} |
68 |
|
ot = getoct(o->oargs.sarg[0]); /* get octree reference */ |
69 |
|
if (ot->localmatl &= o->os != NULL) /* set material */ |
70 |
< |
setmaterial(o->os, ot->cent, 0); |
70 |
> |
setmaterial((MATREC *)o->os, ot->cent, 0); |
71 |
|
/* call the assigned list */ |
72 |
|
glCallList(ot->listid); |
73 |
|
|
195 |
|
} |
196 |
|
|
197 |
|
|
198 |
+ |
int |
199 |
|
loadoct(fname) /* read in objects from octree */ |
200 |
|
char *fname; |
201 |
|
{ |
285 |
|
} |
286 |
|
|
287 |
|
|
288 |
< |
static |
288 |
> |
static void |
289 |
|
skiptree() /* skip octree on input */ |
290 |
|
{ |
291 |
|
register int i; |
310 |
|
} |
311 |
|
|
312 |
|
|
313 |
< |
static |
313 |
> |
static int |
314 |
|
loadobj() /* get next object */ |
315 |
|
{ |
316 |
|
static OBJREC ob; |
383 |
|
} |
384 |
|
|
385 |
|
|
386 |
< |
static |
386 |
> |
static void |
387 |
|
octerror(etyp, msg) /* octree error */ |
388 |
|
int etyp; |
389 |
|
char *msg; |