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

Function EndNewFace

editor/HRoom.cpp:2669–2709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2667}
2668
2669void EndNewFace() {
2670 AddNewFaceVert();
2671
2672 if (New_face_num_verts == -1) {
2673 OutrageMessageBox("You must start a new face before ending it");
2674 return;
2675 }
2676
2677 if (New_face_num_verts < 3) {
2678 OutrageMessageBox("A face must have at least three vertices");
2679 return;
2680 }
2681
2682 int facenum;
2683
2684 facenum = RoomAddFaces(Curroomp, 1);
2685
2686 face *fp = &Curroomp->faces[facenum];
2687
2688 InitRoomFace(fp, New_face_num_verts);
2689
2690 for (int i = 0; i < New_face_num_verts; i++)
2691 fp->face_verts[i] = New_face_verts[i];
2692
2693#ifndef NEWEDITOR
2694 fp->tmap = 0;
2695#else
2696 int texnum = Editor_state.GetCurrentTexture();
2697 // Apply texture
2698 HTextureApplyToRoomFace(Curroomp, facenum, texnum);
2699#endif
2700
2701 ComputeFaceNormal(Curroomp, facenum);
2702 AssignDefaultUVsToRoomFace(Curroomp, facenum);
2703
2704 EditorStatus("New face %d created", facenum);
2705
2706 New_face_num_verts = -1;
2707
2708 World_changed = 1;
2709}
2710
2711void ObjRelink(int objnum, int newroomnum);
2712int RemoveDuplicatePoints(room *rp);

Callers 1

OnRoomFinishNewFaceMethod · 0.85

Calls 8

AddNewFaceVertFunction · 0.85
OutrageMessageBoxFunction · 0.85
RoomAddFacesFunction · 0.85
InitRoomFaceFunction · 0.85
HTextureApplyToRoomFaceFunction · 0.85
ComputeFaceNormalFunction · 0.85
EditorStatusFunction · 0.85

Tested by

no test coverage detected