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

Function LookForFVICracks

editor/MainFrm.cpp:2651–2678  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2649void CheckError(const char *str, ...);
2650uint32_t check_point_to_face(vector *colp, vector *face_normal, int nv, vector **vertex_ptr_list);
2651
2652void LookForFVICracks() {
2653 int r, f, v, edgemask, count = 0;
2654 room *rp;
2655 face *fp;
2656
2657 error_buf_offset = 0;
2658
2659 for (r = 0, rp = Rooms; r <= Highest_room_index; r++, rp++) {
2660 if (rp->used) {
2661 for (f = 0, fp = rp->faces; f < rp->num_faces; f++, fp++) {
2662 vector *vertex_ptr_list[MAX_VERTS_PER_FACE];
2663 for (v = 0; v < fp->num_verts; v++)
2664 vertex_ptr_list[v] = &rp->verts[fp->face_verts[v]];
2665 for (v = 0; v < fp->num_verts; v++) {
2666 edgemask = check_point_to_face(vertex_ptr_list[v], &fp->normal, fp->num_verts, vertex_ptr_list);
2667 if (edgemask) {
2668 CheckError("Vert %d is outside of %d:%d\n", v, r, f);
2669 count++;
2670 }
2671 }
2672 }
2673 }
2674 }
2675
2676 DumpTextToClipboard(error_buf);
2677
2678 OutrageMessageBox("Found %d FVI face cracks.", count);
2679}
2680
2681void MoveEntireMine() {

Callers

nothing calls this directly

Calls 4

check_point_to_faceFunction · 0.85
CheckErrorFunction · 0.85
DumpTextToClipboardFunction · 0.85
OutrageMessageBoxFunction · 0.85

Tested by

no test coverage detected