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

Function ClassifyAMFaces

Descent3/TelComAutoMap.cpp:206–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204void AutomapClearVisMap() { memset(AutomapVisMap, 0, MAX_ROOMS); }
205
206void ClassifyAMFaces() {
207 int i = 0;
208 for (i = 0; i <= Highest_room_index; i++) {
209 if (Rooms[i].used) {
210 Small_faces[i] = (uint8_t *)mem_malloc(Rooms[i].num_faces);
211 ASSERT(Small_faces[i]);
212
213 memset(Small_faces[i], 0, Rooms[i].num_faces);
214
215 room *rp = &Rooms[i];
216
217 for (int t = 0; t < rp->num_faces; t++) {
218 face *fp = &rp->faces[t];
219
220 vector verts[MAX_VERTS_PER_FACE];
221 vector center;
222 for (int k = 0; k < fp->num_verts; k++)
223 verts[k] = rp->verts[fp->face_verts[k]];
224
225 float size = vm_GetCentroidFast(&center, verts, fp->num_verts);
226
227 if (size < 120)
228 Small_faces[i][t] = 1;
229 if (size < 60)
230 Small_faces[i][t] = 2;
231 }
232 }
233 }
234}
235
236void FreeAMFaces() {
237 for (int i = 0; i <= Highest_room_index; i++) {

Callers 1

TelComAutoMapFunction · 0.85

Calls 1

vm_GetCentroidFastFunction · 0.50

Tested by

no test coverage detected