moved state update from R_Mesh_Render to R_Mesh_Draw_GetBuffer
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 5 Sep 2002 14:22:28 +0000 (14:22 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 5 Sep 2002 14:22:28 +0000 (14:22 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2332 d7cf8633-e32d-0410-b094-e92efae38249

gl_backend.c

index 3e92f4b..e9835a9 100644 (file)
@@ -729,13 +729,6 @@ void R_Mesh_Render(void)
        if (!gl_mesh_floatcolors.integer || gl_mesh_drawmode.integer <= 0)
                GL_ConvertColorsFloatToByte();
 
-       if (gl_backend_rebindtextures)
-       {
-               gl_backend_rebindtextures = false;
-               GL_SetupTextureState();
-       }
-
-       GL_MeshState();
        m[0] = buf_mesh.matrix.m[0][0];
        m[1] = buf_mesh.matrix.m[0][1];
        m[2] = buf_mesh.matrix.m[0][2];
@@ -907,6 +900,14 @@ int R_Mesh_Draw_GetBuffer(rmeshbufferinfo_t *m, int wantoverbright)
        if (overbright && j >= 0)
                buf_mesh.texturergbscale[j] = 4;
 
+       if (gl_backend_rebindtextures)
+       {
+               gl_backend_rebindtextures = false;
+               GL_SetupTextureState();
+       }
+
+       GL_MeshState();
+
        return true;
 }