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

Function FlipFace

editor/HRoom.cpp:2210–2238  ·  view source on GitHub ↗

Flips a face

Source from the content-addressed store, hash-verified

2208
2209// Flips a face
2210void FlipFace(room *rp, int facenum) {
2211 face *fp = &rp->faces[facenum];
2212
2213 ASSERT(fp->portal_num == -1);
2214
2215 for (int i = 0; i < fp->num_verts / 2; i++) {
2216 int v = fp->face_verts[i];
2217 fp->face_verts[i] = fp->face_verts[fp->num_verts - 1 - i];
2218 fp->face_verts[fp->num_verts - 1 - i] = v;
2219
2220 roomUVL uvl = fp->face_uvls[i];
2221 fp->face_uvls[i] = fp->face_uvls[fp->num_verts - 1 - i];
2222 fp->face_uvls[fp->num_verts - 1 - i] = uvl;
2223 }
2224
2225 // Get new normal
2226 if (!ComputeFaceNormal(rp, facenum))
2227 Int3(); // Bad! Get Matt!
2228
2229#ifndef NEWEDITOR
2230 World_changed = 1;
2231 EditorStatus("Room %d face %d flipped.", ROOMNUM(rp), facenum);
2232#else
2233 if (ROOMNUM(rp) < MAX_ROOMS)
2234 EditorStatus("Room %d face %d flipped.", ROOMNUM(rp), facenum);
2235 else
2236 EditorStatus("Face %d flipped.", facenum);
2237#endif
2238}
2239
2240// Attempt to fix the cracks in a level
2241void FixCracks() {

Callers 1

OnRoompadFlipFaceMethod · 0.85

Calls 2

ComputeFaceNormalFunction · 0.85
EditorStatusFunction · 0.85

Tested by

no test coverage detected