]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
changed gl_workaround_mac_texmatrix to additionally call
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 4 May 2008 06:04:20 +0000 (06:04 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 4 May 2008 06:04:20 +0000 (06:04 +0000)
GL_ActiveTexture everywhere it calls GL_ClientActiveTexture

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8273 d7cf8633-e32d-0410-b094-e92efae38249

gl_backend.c

index 73fa632e715e6a25b2be3e40d4f3c08b141ff642..750a9c187a4543013d1df26a408b8b70ae5babbf 100644 (file)
@@ -609,6 +609,8 @@ void GL_SetupTextureState(void)
 
        for (i = 0;i < backendarrayunits;i++)
        {
+               if (gl_workaround_mac_texmatrix.integer)
+                       GL_ActiveTexture(i);
                GL_ClientActiveTexture(i);
                GL_BindVBO(0);
                qglTexCoordPointer(2, GL_FLOAT, sizeof(float[2]), NULL);CHECKGLERROR
@@ -618,6 +620,8 @@ void GL_SetupTextureState(void)
        for (i = 0;i < backendunits;i++)
        {
                GL_ActiveTexture(i);
+               if (gl_workaround_mac_texmatrix.integer)
+                       GL_ClientActiveTexture(i);
                qglDisable(GL_TEXTURE_1D);CHECKGLERROR
                qglDisable(GL_TEXTURE_2D);CHECKGLERROR
                if (gl_texture3d)
@@ -1153,6 +1157,8 @@ void R_Mesh_Draw(int firstvertex, int numvertices, int firsttriangle, int numtri
                {
                        if (gl_state.units[i].arrayenabled)
                        {
+                               if (gl_workaround_mac_texmatrix.integer)
+                                       GL_ActiveTexture(i);
                                GL_ClientActiveTexture(i);
                                if (!qglIsEnabled(GL_TEXTURE_COORD_ARRAY))
                                        Con_Print("R_Mesh_Draw: texcoord array set but not enabled\n");
@@ -1546,6 +1552,8 @@ void R_Mesh_TexCoordPointer(unsigned int unitnum, unsigned int numcomponents, co
                if (!unit->arrayenabled)
                {
                        unit->arrayenabled = true;
+                       if (gl_workaround_mac_texmatrix.integer)
+                               GL_ActiveTexture(unitnum);
                        GL_ClientActiveTexture(unitnum);
                        qglEnableClientState(GL_TEXTURE_COORD_ARRAY);CHECKGLERROR
                }
@@ -1556,6 +1564,8 @@ void R_Mesh_TexCoordPointer(unsigned int unitnum, unsigned int numcomponents, co
                        unit->pointer_texcoord_buffer = bufferobject;
                        unit->pointer_texcoord_offset = bufferoffset;
                        unit->arraycomponents = numcomponents;
+                       if (gl_workaround_mac_texmatrix.integer)
+                               GL_ActiveTexture(unitnum);
                        GL_ClientActiveTexture(unitnum);
                        GL_BindVBO(bufferobject);
                        qglTexCoordPointer(unit->arraycomponents, GL_FLOAT, sizeof(float) * unit->arraycomponents, bufferobject ? (void *)bufferoffset : texcoord);CHECKGLERROR
@@ -1567,6 +1577,8 @@ void R_Mesh_TexCoordPointer(unsigned int unitnum, unsigned int numcomponents, co
                if (unit->arrayenabled)
                {
                        unit->arrayenabled = false;
+                       if (gl_workaround_mac_texmatrix.integer)
+                               GL_ActiveTexture(unitnum);
                        GL_ClientActiveTexture(unitnum);
                        qglDisableClientState(GL_TEXTURE_COORD_ARRAY);CHECKGLERROR
                }
@@ -2157,6 +2169,8 @@ void R_Mesh_ResetTextureState(void)
                if (unit->arrayenabled)
                {
                        unit->arrayenabled = false;
+                       if (gl_workaround_mac_texmatrix.integer)
+                               GL_ActiveTexture(unitnum);
                        GL_ClientActiveTexture(unitnum);
                        qglDisableClientState(GL_TEXTURE_COORD_ARRAY);CHECKGLERROR
                }