int alphatest;
int scissortest;
unsigned int unit;
- unsigned int clientunit;
gltextureunit_t units[MAX_TEXTUREUNITS];
float color4f[4];
int lockrange_first;
gltextureunit_t *unit;
CHECKGLERROR
gl_state.unit = MAX_TEXTUREUNITS;
- gl_state.clientunit = MAX_TEXTUREUNITS;
for (i = 0;i < MAX_TEXTUREUNITS;i++)
{
unit = gl_state.units + i;
for (i = 0;i < backendarrayunits;i++)
{
- GL_ClientActiveTexture(i);
+ GL_ActiveTexture(i);
GL_BindVBO(0);
qglTexCoordPointer(2, GL_FLOAT, sizeof(float[2]), NULL);CHECKGLERROR
qglDisableClientState(GL_TEXTURE_COORD_ARRAY);CHECKGLERROR
{
CHECKGLERROR
qglActiveTexture(GL_TEXTURE0_ARB + gl_state.unit);
- CHECKGLERROR
- }
- }
-}
-
-void GL_ClientActiveTexture(unsigned int num)
-{
- if (gl_state.clientunit != num)
- {
- gl_state.clientunit = num;
- if (qglActiveTexture)
- {
- CHECKGLERROR
- qglClientActiveTexture(GL_TEXTURE0_ARB + gl_state.clientunit);
+ qglClientActiveTexture(GL_TEXTURE0_ARB + gl_state.unit);
CHECKGLERROR
}
}
{
if (gl_state.units[i].arrayenabled)
{
- GL_ClientActiveTexture(i);
+ GL_ActiveTexture(i);
if (!qglIsEnabled(GL_TEXTURE_COORD_ARRAY))
Con_Print("R_Mesh_Draw: texcoord array set but not enabled\n");
CHECKGLERROR
if (!unit->arrayenabled)
{
unit->arrayenabled = true;
- GL_ClientActiveTexture(unitnum);
+ GL_ActiveTexture(unitnum);
qglEnableClientState(GL_TEXTURE_COORD_ARRAY);CHECKGLERROR
}
// texcoord array
unit->pointer_texcoord_buffer = bufferobject;
unit->pointer_texcoord_offset = bufferoffset;
unit->arraycomponents = numcomponents;
- GL_ClientActiveTexture(unitnum);
+ GL_ActiveTexture(unitnum);
GL_BindVBO(bufferobject);
qglTexCoordPointer(unit->arraycomponents, GL_FLOAT, sizeof(float) * unit->arraycomponents, bufferobject ? (void *)bufferoffset : texcoord);CHECKGLERROR
}
if (unit->arrayenabled)
{
unit->arrayenabled = false;
- GL_ClientActiveTexture(unitnum);
+ GL_ActiveTexture(unitnum);
qglDisableClientState(GL_TEXTURE_COORD_ARRAY);CHECKGLERROR
}
}
CHECKGLERROR
Matrix4x4_ToArrayDoubleGL(&unit->matrix, glmatrix);
GL_ActiveTexture(unitnum);
- GL_ClientActiveTexture(unitnum);
qglMatrixMode(GL_TEXTURE);CHECKGLERROR
+ if (gl_workaround_mac_texmatrix.integer & 4)
+ {
+ qglActiveTexture(GL_TEXTURE0_ARB + gl_state.unit);
+ qglClientActiveTexture(GL_TEXTURE0_ARB + gl_state.unit);
+ }
qglLoadMatrixd(glmatrix);CHECKGLERROR
qglMatrixMode(GL_MODELVIEW);CHECKGLERROR
}
unit->matrix = identitymatrix;
CHECKGLERROR
GL_ActiveTexture(unitnum);
- GL_ClientActiveTexture(unitnum);
qglMatrixMode(GL_TEXTURE);CHECKGLERROR
+ qglLoadIdentity();CHECKGLERROR
if (gl_workaround_mac_texmatrix.integer)
{
+ qglActiveTexture(GL_TEXTURE0_ARB + gl_state.unit);
+ qglClientActiveTexture(GL_TEXTURE0_ARB + gl_state.unit);
qglLoadMatrixd(gl_identitymatrix);CHECKGLERROR
- if (gl_workaround_mac_texmatrix.integer == 2)
+ if (gl_workaround_mac_texmatrix.integer & 1)
qglLoadIdentity();CHECKGLERROR
}
- else
- {
- qglLoadIdentity();CHECKGLERROR
- }
qglMatrixMode(GL_MODELVIEW);CHECKGLERROR
}
}
if (unit->arrayenabled)
{
unit->arrayenabled = false;
- GL_ClientActiveTexture(unitnum);
+ GL_ActiveTexture(unitnum);
qglDisableClientState(GL_TEXTURE_COORD_ARRAY);CHECKGLERROR
}
}