]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
minor cleanup to R_DrawSurface_TransparentCallback
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 27 Feb 2010 21:08:14 +0000 (21:08 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 27 Feb 2010 21:08:14 +0000 (21:08 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10028 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index e91a8d1961d2b9008f36e12ec56eaff5e79e7f13..c976cda49ba6009e40d6b3cad647631144c2e4ed 100644 (file)
@@ -11226,7 +11226,8 @@ static void R_DrawSurface_TransparentCallback(const entity_render_t *ent, const
        int texturenumsurfaces, endsurface;
        texture_t *texture;
        const msurface_t *surface;
-       const msurface_t *texturesurfacelist[256];
+#define MAXBATCH_TRANSPARENTSURFACES 256
+       const msurface_t *texturesurfacelist[MAXBATCH_TRANSPARENTSURFACES];
 
        // if the model is static it doesn't matter what value we give for
        // wantnormals and wanttangents, so this logic uses only rules applicable
@@ -11303,7 +11304,7 @@ static void R_DrawSurface_TransparentCallback(const entity_render_t *ent, const
                rsurface.texture = R_GetCurrentTexture(texture);
                rsurface.uselightmaptexture = surface->lightmaptexture != NULL;
                // scan ahead until we find a different texture
-               endsurface = min(i + 1024, numsurfaces);
+               endsurface = min(i + MAXBATCH_TRANSPARENTSURFACES, numsurfaces);
                texturenumsurfaces = 0;
                texturesurfacelist[texturenumsurfaces++] = surface;
                for (;j < endsurface;j++)