Changes a face's texture within a room returns true on successs
| 1235 | // Changes a face's texture within a room |
| 1236 | // returns true on successs |
| 1237 | bool ChangeRoomFaceTexture(int room_num, int face_num, int texture) { |
| 1238 | if ((room_num < 0) || (room_num > Highest_room_index) || ROOMNUM_OUTSIDE(room_num) || (!Rooms[room_num].used)) { |
| 1239 | mprintf(0, "Invalid room passed to ChangeRoomFaceTexture\n"); |
| 1240 | Int3(); |
| 1241 | return false; |
| 1242 | } |
| 1243 | |
| 1244 | room *rp = &Rooms[room_num]; |
| 1245 | |
| 1246 | if (face_num < 0 || face_num >= rp->num_faces) { |
| 1247 | mprintf(0, "Invalid face number passed to ChangeRoomFaceTexture." |
| 1248 | " Room=%d, you gave face #%d, there are only %d in the room\n", |
| 1249 | room_num, face_num, rp->num_faces); |
| 1250 | Int3(); |
| 1251 | return false; |
| 1252 | } |
| 1253 | |
| 1254 | if (texture == -1) { |
| 1255 | mprintf(0, "not a valid texture, passed to ChangeRoomFaceTexture\n"); |
| 1256 | Int3(); |
| 1257 | return false; |
| 1258 | } |
| 1259 | |
| 1260 | face *fp = &rp->faces[face_num]; |
| 1261 | |
| 1262 | fp->tmap = texture; |
| 1263 | fp->flags |= FF_TEXTURE_CHANGED; |
| 1264 | rp->room_change_flags |= RCF_TEXTURE; |
| 1265 | return true; |
| 1266 | } |
| 1267 | |
| 1268 | // Clears the data for room changes |
| 1269 | void ClearRoomChanges() { |
no outgoing calls
no test coverage detected