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

Function NormalizeFaceUVs

editor/Erooms.cpp:2622–2642  ·  view source on GitHub ↗

Get rid of large whole parts of face UV coordinates

Source from the content-addressed store, hash-verified

2620
2621// Get rid of large whole parts of face UV coordinates
2622void NormalizeFaceUVs() {
2623 int r;
2624 room *rp;
2625
2626 for (r = 0, rp = Rooms; r <= Highest_room_index; r++, rp++) {
2627 if (rp->used) {
2628 int f;
2629 face *fp;
2630
2631 for (f = 0, fp = rp->faces; f < rp->num_faces; f++, fp++) {
2632 float base_u = floor(fp->face_uvls[0].u);
2633 float base_v = floor(fp->face_uvls[0].v);
2634
2635 for (int v = 0; v < fp->num_verts; v++) {
2636 fp->face_uvls[v].u -= base_u;
2637 fp->face_uvls[v].v -= base_v;
2638 }
2639 }
2640 }
2641 }
2642}
2643
2644// Test the mine for validity
2645void VerifyMine() {

Callers 1

VerifyMineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected