]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_shadow.c
redesigned some of the model animation code, should be a speed gain (no longer proces...
[xonotic/darkplaces.git] / r_shadow.c
index dcfdef54285da3fd9d994f99d546c073de4858e0..d43bf7b466818cc9b3a8958cfeb90274df23ff1d 100644 (file)
@@ -1241,12 +1241,10 @@ static void R_Shadow_RenderSurfacesLighting_VisibleLighting(const entity_render_
        GL_Color(0.1, 0.025, 0, 1);
        memset(&m, 0, sizeof(m));
        R_Mesh_State(&m);
-       RSurf_SetPointersForPass(false, false);
+       RSurf_PrepareVerticesForBatch(ent, texture, r_shadow_entityeyeorigin, false, false, numsurfaces, surfacelist);
        for (surfacelistindex = 0;surfacelistindex < numsurfaces;surfacelistindex++)
        {
                const msurface_t *surface = surfacelist[surfacelistindex];
-               if (rsurface_dynamicvertex)
-                       RSurf_PrepareDynamicSurfaceVertices(surface);
                GL_LockArrays(surface->num_firstvertex, surface->num_vertices);
                R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, model->surfmesh.data_element3i + 3 * surface->num_firsttriangle);
                GL_LockArrays(0, 0);
@@ -1258,14 +1256,12 @@ static void R_Shadow_RenderSurfacesLighting_Light_GLSL(const entity_render_t *en
        // ARB2 GLSL shader path (GFFX5200, Radeon 9500)
        int surfacelistindex;
        model_t *model = ent->model;
+       RSurf_PrepareVerticesForBatch(ent, texture, r_shadow_entityeyeorigin, true, true, numsurfaces, surfacelist);
        R_SetupSurfaceShader(ent, texture, r_shadow_entityeyeorigin, lightcolorbase, false);
-       RSurf_SetPointersForPass(false, true);
        for (surfacelistindex = 0;surfacelistindex < numsurfaces;surfacelistindex++)
        {
                const msurface_t *surface = surfacelist[surfacelistindex];
                const int *elements = model->surfmesh.data_element3i + surface->num_firsttriangle * 3;
-               if (rsurface_dynamicvertex)
-                       RSurf_PrepareDynamicSurfaceVertices(surface);
                R_Mesh_TexCoordPointer(0, 2, model->surfmesh.data_texcoordtexture2f);
                R_Mesh_TexCoordPointer(1, 3, rsurface_svector3f);
                R_Mesh_TexCoordPointer(2, 3, rsurface_tvector3f);
@@ -1821,12 +1817,10 @@ static void R_Shadow_RenderSurfacesLighting_Light_Dot3(const entity_render_t *en
        qboolean dospecular = specularscale > 0;
        if (!doambient && !dodiffuse && !dospecular)
                return;
-       RSurf_SetPointersForPass(false, true);
+       RSurf_PrepareVerticesForBatch(ent, texture, r_shadow_entityeyeorigin, true, true, numsurfaces, surfacelist);
        for (surfacelistindex = 0;surfacelistindex < numsurfaces;surfacelistindex++)
        {
                const msurface_t *surface = surfacelist[surfacelistindex];
-               if (rsurface_dynamicvertex)
-                       RSurf_PrepareDynamicSurfaceVertices(surface);
                if (doambient)
                        R_Shadow_RenderSurfacesLighting_Light_Dot3_AmbientPass(ent, texture, surface, lightcolorbase, basetexture, r_shadow_rtlight->ambientscale);
                if (dodiffuse)
@@ -1951,12 +1945,10 @@ static void R_Shadow_RenderSurfacesLighting_Light_Vertex(const entity_render_t *
        }
        m.pointer_color = rsurface_array_color4f;
        R_Mesh_State(&m);
-       RSurf_SetPointersForPass(true, false);
+       RSurf_PrepareVerticesForBatch(ent, texture, r_shadow_entityeyeorigin, true, false, numsurfaces, surfacelist);
        for (surfacelistindex = 0;surfacelistindex < numsurfaces;surfacelistindex++)
        {
                const msurface_t *surface = surfacelist[surfacelistindex];
-               if (rsurface_dynamicvertex)
-                       RSurf_PrepareDynamicSurfaceVertices(surface);
                // OpenGL 1.1 path (anything)
                R_Mesh_TexCoordPointer(0, 2, model->surfmesh.data_texcoordtexture2f);
                R_Mesh_TexMatrix(0, &texture->currenttexmatrix);
@@ -1999,7 +1991,6 @@ void R_Shadow_RenderSurfacesLighting(const entity_render_t *ent, const texture_t
                qglDisable(GL_CULL_FACE);
        else
                qglEnable(GL_CULL_FACE);
-       RSurf_PrepareForBatch(ent, texture, r_shadow_entityeyeorigin);
        if (texture->colormapping)
        {
                qboolean dopants = texture->skin.pants != NULL && VectorLength2(ent->colormap_pantscolor) >= (1.0f / 1048576.0f);