From: havoc Date: Sat, 27 Feb 2010 21:08:14 +0000 (+0000) Subject: minor cleanup to R_DrawSurface_TransparentCallback X-Git-Tag: xonotic-v0.1.0preview~230^2~441 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=fc2df393e29803fad1ac52a0dabdbe797800829f;p=xonotic%2Fdarkplaces.git minor cleanup to R_DrawSurface_TransparentCallback git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10028 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index e91a8d19..c976cda4 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -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++)