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

Function PropagateToConnectedFacesSub

editor/HRoom.cpp:3204–3234  ·  view source on GitHub ↗

returns the number of faces changed

Source from the content-addressed store, hash-verified

3202
3203// returns the number of faces changed
3204int PropagateToConnectedFacesSub(room *rp, int facenum, bool *face_checked) {
3205 int n_changed = 0;
3206
3207 face_checked[facenum] = 1;
3208
3209 face *fp = &rp->faces[facenum];
3210
3211 for (int e = 0; e < fp->num_verts; e++) {
3212 int t = -1;
3213
3214 do {
3215
3216 t = FindConnectedFace(rp, facenum, e, t + 1);
3217
3218 if ((t != -1) && !face_checked[t]) {
3219
3220 if (NormalsAreSame(&fp->normal, &rp->faces[t].normal)) {
3221
3222 HTexturePropagateToFace(rp, t, rp, facenum);
3223
3224 n_changed++;
3225
3226 n_changed += PropagateToConnectedFacesSub(rp, t, face_checked);
3227 }
3228 }
3229
3230 } while (t != -1);
3231 }
3232
3233 return n_changed;
3234}
3235
3236void PropagateToConnectedFaces(room *rp, int facenum) {
3237 bool face_checked[MAX_FACES_PER_ROOM];

Callers 1

Calls 3

FindConnectedFaceFunction · 0.85
NormalsAreSameFunction · 0.85
HTexturePropagateToFaceFunction · 0.85

Tested by

no test coverage detected