| 171 | int Lightmap_debug_model = -1; |
| 172 | |
| 173 | inline void RenderSubmodelFace(poly_model *pm, bsp_info *sm, int facenum) { |
| 174 | |
| 175 | g3Point *pointlist[100]; |
| 176 | int bm_handle; |
| 177 | int smooth = 0; |
| 178 | polyface *fp = &sm->faces[facenum]; |
| 179 | int modelnum = sm - pm->submodel; |
| 180 | texture *texp = nullptr; |
| 181 | int t; |
| 182 | int custom = 0; |
| 183 | g3Codes face_cc; |
| 184 | int triface = 0; |
| 185 | |
| 186 | face_cc.cc_and = 0xff; |
| 187 | face_cc.cc_or = 0; |
| 188 | |
| 189 | triangulated_faces[facenum] = 0; |
| 190 | |
| 191 | if (sm->flags & SOF_CUSTOM) |
| 192 | custom = 1; |
| 193 | |
| 194 | // Setup texturing |
| 195 | if (fp->texnum != -1) |
| 196 | texp = &GameTextures[pm->textures[fp->texnum]]; |
| 197 | |
| 198 | if (texp && custom && Polymodel_use_effect && (Polymodel_effect.type & PEF_CUSTOM_TEXTURE)) |
| 199 | texp = &GameTextures[Polymodel_effect.custom_texture]; |
| 200 | |
| 201 | // Set radiosity lightmaps if needed |
| 202 | if (Polymodel_light_type == POLYMODEL_LIGHTING_LIGHTMAP) { |
| 203 | rend_SetOverlayMap( |
| 204 | LightmapInfo[Polylighting_lightmap_object->lightmap_faces[modelnum][facenum].lmi_handle].lm_handle); |
| 205 | } |
| 206 | |
| 207 | // Do bump mapping |
| 208 | if ((Polymodel_effect.type & PEF_BUMPMAPPED) && texp && texp->bumpmap != -1 && |
| 209 | Polymodel_light_type == POLYMODEL_LIGHTING_GOURAUD) { |
| 210 | rend_SetOverlayType(OT_NONE); |
| 211 | rend_SetBumpmapReadyState(1, texp->bumpmap); |
| 212 | if ((GameTextures[fp->texnum].flags & TF_SMOOTH_SPECULAR)) |
| 213 | smooth = 1; |
| 214 | } |
| 215 | |
| 216 | float uchange = 0, vchange = 0; |
| 217 | |
| 218 | // Figure out if there is any texture sliding |
| 219 | if (texp && texp->slide_u != 0) { |
| 220 | int int_time = Gametime / texp->slide_u; |
| 221 | float norm_time = Gametime - (int_time * texp->slide_u); |
| 222 | norm_time /= texp->slide_u; |
| 223 | |
| 224 | uchange = norm_time; |
| 225 | } |
| 226 | |
| 227 | if (texp && texp->slide_v != 0) { |
| 228 | int int_time = Gametime / texp->slide_v; |
| 229 | float norm_time = Gametime - (int_time * texp->slide_v); |
| 230 | norm_time /= texp->slide_v; |
no test coverage detected