Renders a specific room. If pos_offset is not NULL, adds that offset to each of the rooms vertices
| 2953 | // Renders a specific room. If pos_offset is not NULL, adds that offset to each of the |
| 2954 | // rooms vertices |
| 2955 | void RenderRoom(room *rp) { |
| 2956 | Num_glows_this_frame = 0; |
| 2957 | |
| 2958 | // Set up rendering states |
| 2959 | rend_SetColorModel(CM_MONO); |
| 2960 | rend_SetLighting(LS_GOURAUD); |
| 2961 | rend_SetWrapType(WT_WRAP); |
| 2962 | if (rp->used == 0) { |
| 2963 | Int3(); // Trying to draw a room that isn't in use! |
| 2964 | return; |
| 2965 | } |
| 2966 | |
| 2967 | // Figure out pulse lighting for room |
| 2968 | ComputeRoomPulseLight(rp); |
| 2969 | |
| 2970 | // Mark it visible for automap |
| 2971 | AutomapVisMap[rp - Rooms] = 1; |
| 2972 | |
| 2973 | #ifdef EDITOR |
| 2974 | if (!UseHardware) { |
| 2975 | RenderRoomSorted(rp); |
| 2976 | } else |
| 2977 | #endif |
| 2978 | { |
| 2979 | // NOTE LINK TO ABOVE ELSE |
| 2980 | RenderRoomUnsorted(rp); |
| 2981 | } |
| 2982 | |
| 2983 | rp->last_render_time = Gametime; |
| 2984 | rp->flags &= ~RF_MIRROR_VISIBLE; |
| 2985 | |
| 2986 | CheckLightGlowsForRoom(rp); |
| 2987 | |
| 2988 | if (Num_scorches_to_render > 0) { |
| 2989 | RenderScorchesForRoom(rp); |
| 2990 | Num_scorches_to_render = 0; |
| 2991 | } |
| 2992 | |
| 2993 | if (Num_specular_faces_to_render > 0) { |
| 2994 | RenderSpecularFacesFlat(rp); |
| 2995 | Num_specular_faces_to_render = 0; |
| 2996 | Num_real_specular_faces_to_render = 0; |
| 2997 | } |
| 2998 | |
| 2999 | if (Num_fog_faces_to_render > 0) { |
| 3000 | RenderFogFaces(rp); |
| 3001 | Num_fog_faces_to_render = 0; |
| 3002 | } |
| 3003 | } |
| 3004 | |
| 3005 | #define MAX_OBJECTS_PER_ROOM 2000 |
| 3006 | struct obj_sort_item { |
no test coverage detected