11 |
|
#include "radogl.h" |
12 |
|
#include "octree.h" |
13 |
|
|
14 |
+ |
#define MAXLEVEL 16 /* maximum instance hierarchy level */ |
15 |
+ |
|
16 |
|
typedef struct { |
17 |
|
int listid; /* our list id */ |
18 |
|
short localmatl; /* uses local material only */ |
35 |
|
static int objsize; /* size of stored OBJECT's */ |
36 |
|
static short otypmap[NUMOTYPE+8]; /* object type map */ |
37 |
|
|
38 |
< |
static long imhash(mod) char *mod; {return((long)mod);} |
38 |
> |
static unsigned long imhash(mod) char *mod; {return((unsigned long)mod);} |
39 |
|
static LUTAB imtab = {imhash,NULL,NULL,NULL,0,NULL,0}; |
40 |
|
|
41 |
|
static LUTAB ottab = LU_SINIT(free,free); |
74 |
|
glCallList(ot->listid); |
75 |
|
|
76 |
|
if (o->oargs.nsargs > 1) { /* end transform */ |
77 |
+ |
glMatrixMode(GL_MODELVIEW); |
78 |
|
glPopMatrix(); |
79 |
|
glPopAttrib(); |
80 |
|
} |
104 |
|
int |
105 |
|
loadoctrees() /* load octrees we've saved up */ |
106 |
|
{ |
107 |
+ |
int levelsleft = MAXLEVEL; |
108 |
|
int nocts = 0; |
109 |
|
LUTAB looptab; |
110 |
|
/* loop through new octree references */ |
111 |
|
while (ottab.tsiz) { |
112 |
+ |
if (!levelsleft--) |
113 |
+ |
error(USER, "too many octree levels -- instance loop?"); |
114 |
|
copystruct(&looptab, &ottab); |
115 |
|
ottab.tsiz = 0; |
116 |
|
nocts += lu_doall(&looptab, buildoctlist); |