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 */ |
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); |