Comment out places which are using texture matrix mode for core profile

There is only two places which are using texture matrix mode:

- Tiled tface support.
- Texture shading mode for texture mapping.

Both cases are subject for reconsideration: it is likely that we'll be getting
rid of tface, which means game properties like tiles needs to be revisited
anyway. As for texture shading it is using basic shader which is also not
supported by core profile anyway.
This commit is contained in:
2017-04-19 14:38:26 +02:00
parent 9c84d99819
commit b01df8222f
2 changed files with 12 additions and 0 deletions

View File

@@ -1103,9 +1103,13 @@ static void tex_mat_set_texture_cb(void *userData, int mat_nr, void *attribs)
/* bind texture */
glBindTexture(GL_TEXTURE_2D, ima->bindcode[TEXTARGET_TEXTURE_2D]);
#if SUPPORT_LEGACY_MATRIX
glMatrixMode(GL_TEXTURE);
glLoadMatrixf((float*) texbase->tex_mapping.mat); /* TEXTURE */
glMatrixMode(GL_MODELVIEW);
#else
(void)texbase;
#endif
/* use active UV texture layer */
memset(gattribs, 0, sizeof(*gattribs));

View File

@@ -420,9 +420,11 @@ void GPU_clear_tpage(bool force)
GTS.curtile = 0;
GTS.curima = NULL;
if (GTS.curtilemode != 0) {
#if SUPPORT_LEGACY_MATRIX
glMatrixMode(GL_TEXTURE);
glLoadIdentity(); /* TEXTURE */
glMatrixMode(GL_MODELVIEW);
#endif
}
GTS.curtilemode = 0;
GTS.curtileXRep = 0;
@@ -604,6 +606,7 @@ int GPU_verify_image(
if (GTS.tilemode != GTS.curtilemode || GTS.curtileXRep != GTS.tileXRep ||
GTS.curtileYRep != GTS.tileYRep)
{
#if SUPPORT_LEGACY_MATRIX
glMatrixMode(GL_TEXTURE);
glLoadIdentity(); /* TEXTURE */
@@ -611,6 +614,7 @@ int GPU_verify_image(
glScalef(ima->xrep, ima->yrep, 0); /* TEXTURE */
glMatrixMode(GL_MODELVIEW);
#endif
}
/* check if we have a valid image */
@@ -2117,9 +2121,11 @@ void GPU_end_object_materials(void)
/* resetting the texture matrix after the scaling needed for tiled textures */
if (GTS.tilemode) {
#if SUPPORT_LEGACY_MATRIX
glMatrixMode(GL_TEXTURE);
glLoadIdentity(); /* TEXTURE */
glMatrixMode(GL_MODELVIEW);
#endif
}
}
@@ -2302,9 +2308,11 @@ void GPU_state_init(void)
glDepthRange(0.0, 1.0);
#if SUPPORT_LEGACY_MATRIX
glMatrixMode(GL_TEXTURE);
glLoadIdentity(); /* TEXTURE */
glMatrixMode(GL_MODELVIEW);
#endif
glFrontFace(GL_CCW);
glCullFace(GL_BACK);