+static void R_Q1BSP_DrawLight_TransparentCallback(const entity_render_t *ent, int surfacenumber, const rtlight_t *rtlight)
+{
+ msurface_t *surface = ent->model->data_surfaces + surfacenumber;
+ texture_t *texture = surface->texture;
+ R_UpdateTextureInfo(ent, texture);
+ texture = texture->currentframe;
+ R_Shadow_RenderMode_Begin();
+ R_Shadow_RenderMode_ActiveLight((rtlight_t *)rtlight);
+ R_Shadow_RenderMode_Lighting(false, true);
+ R_Shadow_SetupEntityLight(ent);
+ R_Shadow_RenderSurfacesLighting(ent, texture, 1, &surface);
+ R_Shadow_RenderMode_End();
+}
+
+static void R_Q1BSP_DrawLight_TransparentBatch(const entity_render_t *ent, texture_t *texture, int batchnumsurfaces, msurface_t **batchsurfacelist)
+{
+ int batchsurfaceindex;
+ msurface_t *batchsurface;
+ vec3_t tempcenter, center;
+ for (batchsurfaceindex = 0;batchsurfaceindex < batchnumsurfaces;batchsurfaceindex++)
+ {
+ batchsurface = batchsurfacelist[batchsurfaceindex];
+ tempcenter[0] = (batchsurface->mins[0] + batchsurface->maxs[0]) * 0.5f;
+ tempcenter[1] = (batchsurface->mins[1] + batchsurface->maxs[1]) * 0.5f;
+ tempcenter[2] = (batchsurface->mins[2] + batchsurface->maxs[2]) * 0.5f;
+ Matrix4x4_Transform(&ent->matrix, tempcenter, center);
+ R_MeshQueue_AddTransparent(texture->currentmaterialflags & MATERIALFLAG_NODEPTHTEST ? r_vieworigin : center, R_Q1BSP_DrawLight_TransparentCallback, ent, batchsurface - ent->model->data_surfaces, r_shadow_rtlight);
+ }
+}
+