| 2667 | } |
| 2668 | |
| 2669 | void 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 | |
| 2711 | void ObjRelink(int objnum, int newroomnum); |
| 2712 | int RemoveDuplicatePoints(room *rp); |
no test coverage detected