| 1118 | } |
| 1119 | |
| 1120 | void EBNode_MakeFirstPass(void) { |
| 1121 | int i; |
| 1122 | |
| 1123 | if (BNode_allocated) { |
| 1124 | OutrageMessageBox("The BNode system is already made.\nUse the other functions to modify the graph."); |
| 1125 | return; |
| 1126 | } |
| 1127 | |
| 1128 | for (i = 0; i <= Highest_room_index; i++) { |
| 1129 | ASSERT(Rooms[i].bn_info.num_nodes == 0); |
| 1130 | |
| 1131 | if (Rooms[i].used && !(Rooms[i].flags & RF_EXTERNAL)) { |
| 1132 | EBNode_MakeDefaultIntraRoomNodes(i); |
| 1133 | } |
| 1134 | } |
| 1135 | |
| 1136 | for (i = 0; i < BOA_num_terrain_regions; i++) { |
| 1137 | ASSERT(BNode_terrain_list[i].num_nodes == 0); |
| 1138 | EBNode_MakeDefaultTerrainNodes(i); |
| 1139 | } |
| 1140 | |
| 1141 | // This function assumes that Node(X) goes to Portal(X) |
| 1142 | for (i = 0; i <= Highest_room_index; i++) { |
| 1143 | if (Rooms[i].used && !(Rooms[i].flags & RF_EXTERNAL)) { |
| 1144 | EBNode_MakeDefaultInterRoomEdges(i); |
| 1145 | } |
| 1146 | } |
| 1147 | |
| 1148 | // This function assumes that Node(X) goes to Portal(X) |
| 1149 | for (i = 0; i <= Highest_room_index; i++) { |
| 1150 | if (Rooms[i].used && !(Rooms[i].flags & RF_EXTERNAL)) { |
| 1151 | EBNode_RemoveNodesAtUnopenablePortals(i); |
| 1152 | } |
| 1153 | } |
| 1154 | |
| 1155 | for (i = 0; i <= Highest_room_index + BOA_num_terrain_regions; i++) { |
| 1156 | bn_list *nlist; |
| 1157 | int j; |
| 1158 | int k; |
| 1159 | |
| 1160 | if (i >= 0 && i <= Highest_room_index && !Rooms[i].used) |
| 1161 | continue; |
| 1162 | |
| 1163 | nlist = BNode_GetBNListPtr(i); |
| 1164 | |
| 1165 | for (j = 0; j < nlist->num_nodes; j++) { |
| 1166 | for (k = 0; k < nlist->nodes[j].num_edges; k++) { |
| 1167 | if (nlist->nodes[j].edges[k].max_rad < 5.0f) { |
| 1168 | EBNode_RemoveEdge(j, i, nlist->nodes[j].edges[k].end_index, nlist->nodes[j].edges[k].end_room); |
| 1169 | k--; |
| 1170 | } |
| 1171 | } |
| 1172 | } |
| 1173 | } |
| 1174 | |
| 1175 | BNode_allocated = true; |
| 1176 | #ifndef NEWEDITOR |
| 1177 | EBNode_VerifyGraph(); |
no test coverage detected