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

Function ReInitRoomFace

editor/Erooms.cpp:1338–1350  ·  view source on GitHub ↗

Changes the number of verts in a face. Frees and reallocates the face_verts & face_uvls arrays. Leaves all other fields the same

Source from the content-addressed store, hash-verified

1336// Changes the number of verts in a face. Frees and reallocates the face_verts & face_uvls arrays.
1337// Leaves all other fields the same
1338void ReInitRoomFace(face *fp, int nverts) {
1339 ASSERT(nverts != 0);
1340
1341 fp->num_verts = nverts;
1342
1343 mem_free(fp->face_verts);
1344 mem_free(fp->face_uvls);
1345
1346 fp->face_verts = (int16_t *)mem_malloc(nverts * sizeof(*fp->face_verts));
1347 ASSERT(fp->face_verts != NULL);
1348 fp->face_uvls = (roomUVL *)mem_malloc(nverts * sizeof(*fp->face_uvls));
1349 ASSERT(fp->face_uvls != NULL);
1350}
1351
1352// Determines if two points are close enough together to be considered the same
1353// Parameters: v0,v1 - the two points

Callers 6

AddVertToFaceFunction · 0.85
ClipFaceFunction · 0.85
AddPointToFaceFunction · 0.85
DeletePointFromFaceFunction · 0.85
CombineFacesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected