]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rsurf.c
fix fog mask scrolling on q1bsp sky
[xonotic/darkplaces.git] / gl_rsurf.c
index d8cef1658c79c9c593dd1b574d4394febc4418e6..085eb1e3c5f47e1fd2aaa15cf066b3d51afffd0b 100644 (file)
@@ -556,7 +556,7 @@ void R_Q1BSP_DrawAddWaterPlanes(entity_render_t *ent)
        if (ent == r_refdef.scene.worldentity)
                RSurf_ActiveWorldEntity();
        else
-               RSurf_ActiveModelEntity(ent, false, false);
+               RSurf_ActiveModelEntity(ent, false, false, false);
 
        surfaces = model->data_surfaces;
        flagsmask = MATERIALFLAG_WATERSHADER | MATERIALFLAG_REFRACTION | MATERIALFLAG_REFLECTION;
@@ -1171,6 +1171,7 @@ static void R_Q1BSP_DrawLight_TransparentCallback(const entity_render_t *ent, co
 
 #define RSURF_MAX_BATCHSURFACES 8192
 
+extern qboolean r_shadow_usingdeferredprepass;
 void R_Q1BSP_DrawLight(entity_render_t *ent, int numsurfaces, const int *surfacelist, const unsigned char *trispvs)
 {
        dp_model_t *model = ent->model;
@@ -1178,8 +1179,8 @@ void R_Q1BSP_DrawLight(entity_render_t *ent, int numsurfaces, const int *surface
        int i, k, kend, l, m, mend, endsurface, batchnumsurfaces, batchnumtriangles, batchfirstvertex, batchlastvertex, batchfirsttriangle;
        qboolean usebufferobject, culltriangles;
        const int *element3i;
-       msurface_t *batchsurfacelist[RSURF_MAX_BATCHSURFACES];
-       int batchelements[BATCHSIZE*3];
+       static msurface_t *batchsurfacelist[RSURF_MAX_BATCHSURFACES];
+       static int batchelements[BATCHSIZE*3];
        texture_t *tex;
        CHECKGLERROR
        culltriangles = r_shadow_culltriangles.integer && !(ent->flags & RENDER_NOSELFSHADOW);
@@ -1232,6 +1233,8 @@ void R_Q1BSP_DrawLight(entity_render_t *ent, int numsurfaces, const int *surface
                                }
                                continue;
                        }
+                       if (r_shadow_usingdeferredprepass)
+                               continue;
                        batchnumtriangles = 0;
                        batchfirsttriangle = surface->num_firsttriangle;
                        m = 0; // hush warning