| 1 | /* |
| 2 | * Descent 3 |
| 3 | * Copyright (C) 2024 Parallax Software |
| 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation, either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | |
| 18 | --- HISTORICAL COMMENTS FOLLOW --- |
| 19 | |
| 20 | * $Logfile: /DescentIII/Main/editor/RoomUVs.h $ |
| 21 | * $Revision: 1.1.1.1 $ |
| 22 | * $Date: 2003-08-26 03:57:38 $ |
| 23 | * $Author: kevinb $ |
| 24 | * |
| 25 | * Header for RoomUVs.cpp |
| 26 | * |
| 27 | * $Log: not supported by cvs2svn $ |
| 28 | * |
| 29 | * 4 9/30/99 6:35p Matt |
| 30 | * Added code to scale the UVs of a texture based on the size of the |
| 31 | * texture when the texture is applied to a face. This will cause the |
| 32 | * applied texture to have the make 3D texel size at the old texture. |
| 33 | * |
| 34 | * 3 4/02/98 12:23p Jason |
| 35 | * trimmed some fat from our structures |
| 36 | * |
| 37 | * 2 7/18/97 7:38p Jason |
| 38 | * finished room/terrain texture modifications |
| 39 | * |
| 40 | * $NoKeywords: $ |
| 41 | */ |
| 42 | |
| 43 | #include "room.h" |
| 44 | |
| 45 | // Given u,v coordinates at two vertices, assign u,v coordinates to the other vertices on a face. |
| 46 | // va, vb = face-relative vertex indices corresponding to uva, uvb. Ie, they are always in 0..num_verts_in_face |
| 47 | void AssignUVsToFace(room *rp, int facenum, roomUVL *uva, roomUVL *uvb, int va, int vb); |
| 48 | |
| 49 | // Stretches the UVS of a face |
| 50 | // Edge is the vertex number - so the edge is actually edge,edge+1 |
| 51 | void StretchRoomUVs(room *rp, int facenum, int edge); |
| 52 | |
| 53 | // Scale all the UV values in a face from the center point (as defined by averaging the u & v values) |
| 54 | void ScaleFaceUVs(room *rp, int facenum, float scale); |