]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_draw.c
no more m.transparent, transparent surfaces are sorted using MeshQueue now
[xonotic/darkplaces.git] / gl_draw.c
index a6b3323690e86af748e04d4a48e07e685d38f9dc..d92928858ad31f794b427950c8cf2702978267ab 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -272,7 +272,7 @@ cachepic_t *Draw_NewPic(char *picname, int width, int height, int alpha, qbyte *
 
        if (pic)
        {
-               if (pic->tex && R_TextureWidth(pic->tex) == width && R_TextureHeight(pic->tex) == height && (R_TextureHasAlpha(pic->tex) != 0) == (alpha != 0))
+               if (pic->tex && pic->width == width && pic->height == height)
                {
                        R_UpdateTexture(pic->tex, pixels);
                        return pic;
@@ -358,6 +358,9 @@ void GL_Draw_Init (void)
 }
 
 extern cvar_t gl_mesh_drawmode;
+extern int gl_maxdrawrangeelementsvertices;
+extern int gl_maxdrawrangeelementsindices;
+
 void R_DrawQueue(void)
 {
        int pos, num, chartexnum, overbright;
@@ -555,7 +558,7 @@ void R_DrawQueue(void)
                                Cvar_SetValueQuick(&gl_mesh_drawmode, 0);
                        if (gl_mesh_drawmode.integer > 3)
                                Cvar_SetValueQuick(&gl_mesh_drawmode, 3);
-                       if (gl_mesh_drawmode.integer >= 3 && (qglDrawRangeElements == NULL || gl_maxdrawrangeelementsindices < 3072 || gl_maxdrawrangeelementsvertices < 3072))
+                       if (gl_mesh_drawmode.integer >= 3 && qglDrawRangeElements == NULL)
                                Cvar_SetValueQuick(&gl_mesh_drawmode, 2);
 
                        if (gl_mesh_drawmode.integer > 0)
@@ -568,7 +571,7 @@ void R_DrawQueue(void)
                                qglEnableClientState(GL_COLOR_ARRAY);CHECKGLERROR
                        }
 
-                       if (gl_mesh_drawmode.integer >= 3)
+                       if (gl_mesh_drawmode.integer >= 3/* && (mesh->numvertices) <= gl_maxdrawrangeelementsvertices && (mesh->numindices) <= gl_maxdrawrangeelementsindices*/)
                        {
                                // GL 1.2 or GL 1.1 with extension
                                GL_LockArray(0, mesh->numvertices);