Rotates a face, and then renders it
| 182 | |
| 183 | // Rotates a face, and then renders it |
| 184 | void DrawPostrenderFace(int roomnum, int facenum, bool change_z) { |
| 185 | int i; |
| 186 | |
| 187 | // Always draw as non state limited |
| 188 | bool save_state = StateLimited; |
| 189 | StateLimited = false; |
| 190 | |
| 191 | ASSERT(roomnum >= 0 && roomnum < (MAX_ROOMS + MAX_PALETTE_ROOMS)); |
| 192 | ASSERT(Rooms[roomnum].used); |
| 193 | |
| 194 | room *rp = &Rooms[roomnum]; |
| 195 | |
| 196 | ASSERT(facenum >= 0 && facenum < rp->num_faces); |
| 197 | |
| 198 | face *fp = &rp->faces[facenum]; |
| 199 | |
| 200 | // Rotate points |
| 201 | rp->wpb_index = 0; |
| 202 | for (i = 0; i < fp->num_verts; i++) { |
| 203 | g3_RotatePoint(&World_point_buffer[fp->face_verts[i]], &rp->verts[fp->face_verts[i]]); |
| 204 | g3_ProjectPoint(&World_point_buffer[fp->face_verts[i]]); |
| 205 | } |
| 206 | |
| 207 | SetupPostrenderRoom(rp); |
| 208 | |
| 209 | // Render! |
| 210 | if (change_z) |
| 211 | rend_SetZBufferWriteMask(0); |
| 212 | RenderFace(rp, facenum); |
| 213 | |
| 214 | // Render any effects for this face |
| 215 | if (Num_specular_faces_to_render > 0) { |
| 216 | RenderSpecularFacesFlat(rp); |
| 217 | Num_specular_faces_to_render = 0; |
| 218 | } |
| 219 | |
| 220 | if (Num_fog_faces_to_render > 0) { |
| 221 | RenderFogFaces(rp); |
| 222 | Num_fog_faces_to_render = 0; |
| 223 | } |
| 224 | |
| 225 | // Restore statelimited setting |
| 226 | StateLimited = save_state; |
| 227 | |
| 228 | if (change_z) |
| 229 | rend_SetZBufferWriteMask(1); |
| 230 | } |
| 231 | |
| 232 | // Renders all the objects/viseffects/walls we have in our postrender list |
| 233 | void PostRender(int roomnum) { |
no test coverage detected