Get rid of large whole parts of face UV coordinates
| 2620 | |
| 2621 | // Get rid of large whole parts of face UV coordinates |
| 2622 | void 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 |
| 2645 | void VerifyMine() { |