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

Function ChangeRoomFaceTexture

Descent3/room.cpp:1237–1266  ·  view source on GitHub ↗

Changes a face's texture within a room returns true on successs

Source from the content-addressed store, hash-verified

1235// Changes a face's texture within a room
1236// returns true on successs
1237bool 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
1269void ClearRoomChanges() {

Callers 2

msafe_CallFunctionFunction · 0.85
MultiDoWorldStatesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected