#include "qbsp.h"
#include "../botlib/aasfile.h"
#include "aas_create.h"
Include dependency graph for aas_prunenodes.c:

Go to the source code of this file.
Functions | |
| void | AAS_PruneNodes (void) |
| tmp_node_t * | AAS_PruneNodes_r (tmp_node_t *tmpnode) |
Variables | |
| int | c_numprunes |
|
|
Definition at line 84 of file aas_prunenodes.c. References AAS_PruneNodes_r(), c_numprunes, Log_Print(), Log_Write(), tmp_aas_s::nodes, and tmpaasworld. Referenced by AAS_Create(). 00085 {
00086 Log_Write("AAS_PruneNodes\r\n");
00087 AAS_PruneNodes_r(tmpaasworld.nodes);
00088 Log_Print("%6d nodes pruned\r\n", c_numprunes);
00089 } //end of the function AAS_PruneNodes
|
Here is the call graph for this function:

|
|
Definition at line 35 of file aas_prunenodes.c. References AAS_FreeTmpNode(), c_numprunes, tmp_node_s::children, tmp_area_s::mergedarea, tmp_node_s::planenum, tmp_area_t, tmp_node_t, and tmp_node_s::tmparea. Referenced by AAS_PruneNodes(). 00036 {
00037 tmp_area_t *tmparea1, *tmparea2;
00038
00039 //if it is a solid leaf
00040 if (!tmpnode) return NULL;
00041 //
00042 if (tmpnode->tmparea) return tmpnode;
00043 //process the children first
00044 tmpnode->children[0] = AAS_PruneNodes_r(tmpnode->children[0]);
00045 tmpnode->children[1] = AAS_PruneNodes_r(tmpnode->children[1]);
00046 //if both children are areas
00047 if (tmpnode->children[0] && tmpnode->children[1] &&
00048 tmpnode->children[0]->tmparea && tmpnode->children[1]->tmparea)
00049 {
00050 tmparea1 = tmpnode->children[0]->tmparea;
00051 while(tmparea1->mergedarea) tmparea1 = tmparea1->mergedarea;
00052
00053 tmparea2 = tmpnode->children[1]->tmparea;
00054 while(tmparea2->mergedarea) tmparea2 = tmparea2->mergedarea;
00055
00056 if (tmparea1 == tmparea2)
00057 {
00058 c_numprunes++;
00059 tmpnode->tmparea = tmparea1;
00060 tmpnode->planenum = 0;
00061 AAS_FreeTmpNode(tmpnode->children[0]);
00062 AAS_FreeTmpNode(tmpnode->children[1]);
00063 tmpnode->children[0] = NULL;
00064 tmpnode->children[1] = NULL;
00065 return tmpnode;
00066 } //end if
00067 } //end if
00068 //if both solid leafs
00069 if (!tmpnode->children[0] && !tmpnode->children[1])
00070 {
00071 c_numprunes++;
00072 AAS_FreeTmpNode(tmpnode);
00073 return NULL;
00074 } //end if
00075 //
00076 return tmpnode;
00077 } //end of the function AAS_PruneNodes_r
|
Here is the call graph for this function:

|
|
Definition at line 27 of file aas_prunenodes.c. Referenced by AAS_PruneNodes(), and AAS_PruneNodes_r(). |
1.3.9.1