]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rsurf.c
reenabled R_UpdateAllTextureInfo calls when lighting the world model
[xonotic/darkplaces.git] / gl_rsurf.c
index 9dd089fed970d5449ce5a277eb8e8b8ed63b01d1..4afc3a07363060bc481539911a54baefae01bc4b 100644 (file)
@@ -899,8 +899,7 @@ void R_Q1BSP_GetLightInfo(entity_render_t *ent, vec3_t relativelightorigin, floa
                info.pvs = info.model->brush.GetPVS(info.model, info.relativelightorigin);
        else
                info.pvs = NULL;
-       if (ent != r_refdef.worldentity)
-               R_UpdateAllTextureInfo(ent);
+       R_UpdateAllTextureInfo(ent);
 
        if (r_shadow_frontsidecasting.integer && r_shadow_compilingrtlight && r_shadow_realtime_world_compileportalculling.integer)
        {
@@ -963,8 +962,7 @@ void R_Q1BSP_DrawShadowVolume(entity_render_t *ent, vec3_t relativelightorigin,
        // check the box in modelspace, it was already checked in worldspace
        if (!BoxesOverlap(model->normalmins, model->normalmaxs, lightmins, lightmaxs))
                return;
-       if (ent != r_refdef.worldentity)
-               R_UpdateAllTextureInfo(ent);
+       R_UpdateAllTextureInfo(ent);
        if (ent->model->brush.submodel)
                GL_PolygonOffset(r_refdef.shadowpolygonfactor + r_polygonoffset_submodel_factor.value, r_refdef.shadowpolygonoffset + r_polygonoffset_submodel_offset.value);
        if (model->brush.shadowmesh)
@@ -1031,7 +1029,7 @@ static void R_Q1BSP_DrawLight_TransparentCallback(const entity_render_t *ent, co
        R_Shadow_RenderMode_End();
 }
 
-#define RSURF_MAX_BATCHSURFACES 1024
+#define RSURF_MAX_BATCHSURFACES 8192
 
 void R_Q1BSP_DrawLight(entity_render_t *ent, int numsurfaces, const int *surfacelist, const unsigned char *trispvs)
 {
@@ -1044,14 +1042,6 @@ void R_Q1BSP_DrawLight(entity_render_t *ent, int numsurfaces, const int *surface
        int batchelements[BATCHSIZE*3];
        texture_t *tex;
        CHECKGLERROR
-       if (ent == r_refdef.worldentity)
-               RSurf_ActiveWorldEntity();
-       else
-       {
-               RSurf_ActiveModelEntity(ent, true, true);
-               R_UpdateAllTextureInfo(ent);
-       }
-       CHECKGLERROR
        culltriangles = r_shadow_culltriangles.integer && !(ent->flags & RENDER_NOSELFSHADOW);
        element3i = rsurface.modelelement3i;
        // this is a double loop because non-visible surface skipping has to be