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

Function VerifyMine

editor/Erooms.cpp:2645–2763  ·  view source on GitHub ↗

Test the mine for validity

Source from the content-addressed store, hash-verified

2643
2644// Test the mine for validity
2645void VerifyMine() {
2646 int r;
2647 room *rp;
2648 int errors = 0, bad_normals = 0, concave_faces = 0, degenerate_faces = 0, bad_portals = 0, duplicate_faces = 0,
2649 duplicate_points = 0, duplicate_face_points = 0, unused_points = 0, nonplanar_faces = 0, mismatched_portals = 0,
2650 tjoints = 0, bad_shells = 0, quiet_soundsource_objects = 0;
2651
2652 error_buf_offset = 0;
2653
2654 // Normalize all the UV coordinates in the level
2655 NormalizeFaceUVs();
2656
2657 // Check normals, portals, & duplicate faces
2658 for (r = 0, rp = Rooms; r <= Highest_room_index; r++, rp++)
2659 if (rp->used) {
2660
2661 bad_normals += CheckNormals(rp);
2662 errors += bad_normals;
2663
2664 concave_faces += CheckConcaveFaces(rp);
2665 errors += concave_faces;
2666
2667 degenerate_faces += CheckDegenerateFaces(rp);
2668 errors += degenerate_faces;
2669
2670 bad_portals += CheckPortals(rp);
2671 errors += bad_portals;
2672
2673 duplicate_faces += CheckDuplicateFaces(rp);
2674 errors += duplicate_faces;
2675
2676 nonplanar_faces += CheckNonPlanarFaces(rp);
2677 errors += nonplanar_faces;
2678
2679 duplicate_points += CheckDuplicatePoints(rp);
2680 errors += duplicate_points;
2681
2682 duplicate_face_points += CheckDuplicateFacePoints(rp);
2683 errors += duplicate_face_points;
2684
2685 unused_points += CheckUnusedPoints(rp);
2686 errors += unused_points;
2687
2688 mismatched_portals += CheckRoomPortalFaces(rp);
2689 errors += mismatched_portals;
2690
2691 tjoints += FindTJoints(rp);
2692 errors += tjoints;
2693
2694 if ((rp->num_portals > 0) && !(rp->flags & RF_EXTERNAL)) {
2695 int shell_errors = ComputeRoomShell(rp);
2696 if (shell_errors) {
2697 bad_shells++;
2698 errors++;
2699 }
2700 }
2701 }
2702

Callers 1

OnFileVerifyLevelMethod · 0.85

Calls 15

NormalizeFaceUVsFunction · 0.85
CheckNormalsFunction · 0.85
CheckConcaveFacesFunction · 0.85
CheckDegenerateFacesFunction · 0.85
CheckPortalsFunction · 0.85
CheckDuplicateFacesFunction · 0.85
CheckNonPlanarFacesFunction · 0.85
CheckDuplicatePointsFunction · 0.85
CheckDuplicateFacePointsFunction · 0.85
CheckUnusedPointsFunction · 0.85
CheckRoomPortalFacesFunction · 0.85
FindTJointsFunction · 0.85

Tested by

no test coverage detected