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

Function EBNode_ClearLevel

editor/ebnode.cpp:470–508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

468}
469
470void EBNode_ClearLevel() {
471 int i, j;
472
473 for (i = 0; i <= Highest_room_index + BOA_num_terrain_regions; i++) {
474 if (i >= 0 && i <= Highest_room_index) {
475 if (!Rooms[i].used) {
476 continue;
477 } else {
478 int j;
479
480 for (j = 0; j < Rooms[i].num_portals; j++) {
481 Rooms[i].portals[j].bnode_index = -1;
482 }
483 }
484 }
485
486 bn_list *nlist;
487 nlist = BNode_GetBNListPtr(i);
488
489 ASSERT(nlist);
490
491 for (j = nlist->num_nodes - 1; j >= 0; j--) {
492 if (nlist->nodes[j].edges) {
493 mem_free(nlist->nodes[j].edges);
494 }
495 nlist->nodes[j].edges = NULL;
496 nlist->nodes[j].num_edges = 0;
497 }
498
499 if (nlist->nodes) {
500 mem_free(nlist->nodes);
501 }
502 nlist->nodes = NULL;
503 nlist->num_nodes = 0;
504 }
505
506 BNode_allocated = false;
507 BNode_verified = false;
508}
509
510void RemapEdgeNodesEqualAndAbove(int croom, int sroom, int spnt) {
511 int i;

Callers 1

OnAinVerifyRoomMethod · 0.85

Calls 1

BNode_GetBNListPtrFunction · 0.85

Tested by

no test coverage detected