| 15 |
|
#include "octree.h" |
| 16 |
|
|
| 17 |
|
OCTREE *octblock[MAXOBLK]; /* our octree */ |
| 18 |
< |
static OCTREE ofreelist = EMPTY; /* free octree nodes */ |
| 18 |
> |
static OCTREE ofreelist = EMPTY; /* freed octree nodes */ |
| 19 |
|
static OCTREE treetop = 0; /* next free node */ |
| 20 |
|
|
| 21 |
|
|
| 69 |
|
for (i = 1; i < 8; i++) |
| 70 |
|
if ((octkid(ot, i) = combine(octkid(ot, i))) != ores) |
| 71 |
|
ores = ot; |
| 72 |
< |
if (!istree(ores)) /* all were identical leaves */ |
| 73 |
< |
octfree(ot); |
| 72 |
> |
if (!istree(ores)) { /* all were identical leaves */ |
| 73 |
> |
octkid(ot, 0) = ofreelist; |
| 74 |
> |
ofreelist = ot; |
| 75 |
> |
} |
| 76 |
|
return(ores); |
| 77 |
|
} |
| 78 |
|
|