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

Function CopyFace

editor/Erooms.cpp:1173–1191  ·  view source on GitHub ↗

Copies the contents of one face to another. Sets the portal num in the new face to -1. Parameters: dfp - pointer to the destination face. This face should be uninitialized. sfp - pointer to the source face

Source from the content-addressed store, hash-verified

1171// Parameters: dfp - pointer to the destination face. This face should be uninitialized.
1172// sfp - pointer to the source face
1173void CopyFace(face *dfp, face *sfp) {
1174 InitRoomFace(dfp, sfp->num_verts);
1175
1176 dfp->flags = sfp->flags;
1177 dfp->portal_num = -1;
1178 dfp->normal = sfp->normal;
1179 dfp->tmap = sfp->tmap;
1180 dfp->light_multiple = sfp->light_multiple;
1181
1182 // Clear the flags that we don't want transferred over
1183 dfp->flags &= ~FF_LIGHTMAP;
1184 dfp->flags &= ~FF_HAS_TRIGGER;
1185
1186 // Copy vertices and uvls
1187 for (int i = 0; i < sfp->num_verts; i++) {
1188 dfp->face_verts[i] = sfp->face_verts[i];
1189 dfp->face_uvls[i] = sfp->face_uvls[i];
1190 }
1191}
1192
1193// Checks to see if a face is planar.
1194// See if all the points are within a certain distance of an average point

Callers 3

CopyRoomFunction · 0.85
AttachRoomFunction · 0.85
CombineRoomsFunction · 0.85

Calls 1

InitRoomFaceFunction · 0.85

Tested by

no test coverage detected