MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / EBNode_VerifyGraph

Function EBNode_VerifyGraph

editor/ebnode.cpp:150–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148#define BNODE_VERY_CLOSE_DIST 5.0f
149
150bool EBNode_VerifyGraph() {
151 bool f_verified = true;
152 int i;
153 int j;
154 int k;
155
156 if (!BNode_allocated) {
157 mprintf(0, "EBNode Verify: No BNodes for this level\n");
158 return false;
159 }
160
161 MakeBOA();
162
163 for (i = Highest_room_index + 1; i <= Highest_room_index + BOA_num_terrain_regions; i++) {
164 bn_list *nlist;
165 nlist = BNode_GetBNListPtr(i);
166 int cur_region = i - Highest_room_index - 1;
167
168 for (j = nlist->num_nodes - 1; j >= 0; j--) {
169 int cell = GetTerrainRoomFromPos(&nlist->nodes[j].pos);
170 if (cur_region != TERRAIN_REGION(cell)) {
171 for (k = 0; k < nlist->nodes[j].num_edges; k++) {
172 if (BOA_INDEX(nlist->nodes[j].edges[k].end_room) >= 0 &&
173 BOA_INDEX(nlist->nodes[j].edges[k].end_room) <= Highest_room_index) {
174 int r = nlist->nodes[j].edges[k].end_room;
175 int p = nlist->nodes[j].edges[k].end_index;
176
177 int x;
178 for (x = 0; x < Rooms[r].num_portals; x++) {
179 if (Rooms[r].portals[x].bnode_index == p) {
180 int cr = Rooms[r].portals[x].croom;
181 int cp = Rooms[r].portals[x].cportal;
182
183 Rooms[cr].portals[cp].bnode_index = -1;
184 }
185 }
186 }
187 }
188
189 EBNode_RemoveNode(i, j);
190 }
191 }
192 }
193
194 for (i = 0; i <= Highest_room_index + BOA_num_terrain_regions; i++) {
195 bn_list *nlist;
196 int j;
197 int k;
198
199 if (i >= 0 && i <= Highest_room_index && !Rooms[i].used)
200 continue;
201
202 if (i <= Highest_room_index && (Rooms[i].flags & RF_EXTERNAL))
203 continue;
204
205 nlist = BNode_GetBNListPtr(i);
206
207 for (j = 0; j < nlist->num_nodes; j++) {

Callers 10

OnAinAutoEdgeNodeMethod · 0.85
OnAinDeleteEdgeMethod · 0.85
OnAinDeleteNodeMethod · 0.85
OnAinInsertNodeOnEdgeMethod · 0.85
OnAinMakeEdgeMethod · 0.85
OnAinResetRoomNodesMethod · 0.85
OnAinVerifyLevelMethod · 0.85
OnAerButtonMethod · 0.85
EBNode_MakeFirstPassFunction · 0.85
SaveLevelFunction · 0.85

Calls 10

MakeBOAFunction · 0.85
BNode_GetBNListPtrFunction · 0.85
GetTerrainRoomFromPosFunction · 0.85
TERRAIN_REGIONFunction · 0.85
EBNode_RemoveNodeFunction · 0.85
EBNode_RemoveEdgeFunction · 0.85
EBNode_AddNodeFunction · 0.85
EBNode_AddEdgeFunction · 0.85
EBNode_AutoEdgeNodeFunction · 0.85
BNode_FindPathFunction · 0.85

Tested by

no test coverage detected