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 |
|
|
77 |
|
glPopAttrib(); |
78 |
|
} |
79 |
|
rgl_checkerr("creating instance"); |
80 |
+ |
return(0); |
81 |
|
} |
82 |
|
|
83 |
|
|
196 |
|
} |
197 |
|
|
198 |
|
|
199 |
+ |
int |
200 |
|
loadoct(fname) /* read in objects from octree */ |
201 |
|
char *fname; |
202 |
|
{ |
286 |
|
} |
287 |
|
|
288 |
|
|
289 |
< |
static |
289 |
> |
static void |
290 |
|
skiptree() /* skip octree on input */ |
291 |
|
{ |
292 |
|
register int i; |
311 |
|
} |
312 |
|
|
313 |
|
|
314 |
< |
static |
314 |
> |
static int |
315 |
|
loadobj() /* get next object */ |
316 |
|
{ |
317 |
|
static OBJREC ob; |
384 |
|
} |
385 |
|
|
386 |
|
|
387 |
< |
static |
387 |
> |
static void |
388 |
|
octerror(etyp, msg) /* octree error */ |
389 |
|
int etyp; |
390 |
|
char *msg; |