This adds multitexture for win32 back into the game.

This commit is contained in:
Joseph Carter 2000-06-03 22:32:53 +00:00
parent 8d08bc4d86
commit 19afb34084
4 changed files with 15 additions and 13 deletions

View file

@ -239,12 +239,10 @@ void GL_Bind (int texnum);
#define TEXTURE0_SGIS 0x835E #define TEXTURE0_SGIS 0x835E
#define TEXTURE1_SGIS 0x835F #define TEXTURE1_SGIS 0x835F
#ifdef _WIN32
typedef void (GLAPIENTRY *lpMTexFUNC) (GLenum, GLfloat, GLfloat); typedef void (GLAPIENTRY *lpMTexFUNC) (GLenum, GLfloat, GLfloat);
typedef void (GLAPIENTRY *lpSelTexFUNC) (GLenum); typedef void (GLAPIENTRY *lpSelTexFUNC) (GLenum);
extern lpMTexFUNC qglMTexCoord2fSGIS; extern lpMTexFUNC qglMTexCoord2fSGIS;
extern lpSelTexFUNC qglSelectTextureSGIS; extern lpSelTexFUNC qglSelectTextureSGIS;
#endif
extern qboolean gl_mtexable; extern qboolean gl_mtexable;

View file

@ -341,10 +341,8 @@ extern float speedscale; // for top sky and bottom sky
void DrawGLWaterPoly (glpoly_t *p); void DrawGLWaterPoly (glpoly_t *p);
void DrawGLWaterPolyLightmap (glpoly_t *p); void DrawGLWaterPolyLightmap (glpoly_t *p);
#ifdef _WIN32
lpMTexFUNC qglMTexCoord2fSGIS = NULL; lpMTexFUNC qglMTexCoord2fSGIS = NULL;
lpSelTexFUNC qglSelectTextureSGIS = NULL; lpSelTexFUNC qglSelectTextureSGIS = NULL;
#endif
qboolean mtexenabled = false; qboolean mtexenabled = false;
@ -382,8 +380,8 @@ void R_DrawSequentialPoly (msurface_t *s)
float *v; float *v;
int i; int i;
texture_t *t; texture_t *t;
// vec3_t nv; vec3_t nv;
// glRect_t *theRect; glRect_t *theRect;
// //
// normal lightmaped poly // normal lightmaped poly
@ -392,9 +390,9 @@ void R_DrawSequentialPoly (msurface_t *s)
if (! (s->flags & (SURF_DRAWSKY|SURF_DRAWTURB|SURF_UNDERWATER) ) ) if (! (s->flags & (SURF_DRAWSKY|SURF_DRAWTURB|SURF_UNDERWATER) ) )
{ {
R_RenderDynamicLightmaps (s); R_RenderDynamicLightmaps (s);
if (0) //gl_mtexable) if (gl_mtexable)
{ {
/* p = s->polys; p = s->polys;
t = R_TextureAnimation (s->texinfo->texture); t = R_TextureAnimation (s->texinfo->texture);
// Binds world to texture env 0 // Binds world to texture env 0
@ -427,7 +425,7 @@ void R_DrawSequentialPoly (msurface_t *s)
glVertex3fv (v); glVertex3fv (v);
} }
glEnd (); glEnd ();
return; */ return;
} else { } else {
p = s->polys; p = s->polys;
@ -491,9 +489,9 @@ void R_DrawSequentialPoly (msurface_t *s)
// underwater warped with lightmap // underwater warped with lightmap
// //
R_RenderDynamicLightmaps (s); R_RenderDynamicLightmaps (s);
if (0) //gl_mtexable) if (gl_mtexable)
{ {
/* p = s->polys; p = s->polys;
t = R_TextureAnimation (s->texinfo->texture); t = R_TextureAnimation (s->texinfo->texture);
GL_SelectTexture(TEXTURE0_SGIS); GL_SelectTexture(TEXTURE0_SGIS);
@ -528,7 +526,6 @@ void R_DrawSequentialPoly (msurface_t *s)
glVertex3fv (nv); glVertex3fv (nv);
} }
glEnd (); glEnd ();
*/
} else { } else {
p = s->polys; p = s->polys;

View file

@ -288,6 +288,11 @@ void VID_SetPalette (unsigned char *palette)
} }
} }
void
CheckMultiTextureExtensions ( void )
{
gl_mtexable = false;
}
/* /*
=============== ===============
@ -308,6 +313,8 @@ void GL_Init (void)
// Con_Printf ("%s %s\n", gl_renderer, gl_version); // Con_Printf ("%s %s\n", gl_renderer, gl_version);
CheckMultiTextureExtensions ();
glClearColor (0,0,0,0); glClearColor (0,0,0,0);
glCullFace(GL_FRONT); glCullFace(GL_FRONT);
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);

View file

@ -646,7 +646,7 @@ void GL_Init (void)
CheckTextureExtensions (); CheckTextureExtensions ();
CheckMultiTextureExtensions (); CheckMultiTextureExtensions ();
glClearColor (1,0,0,0); glClearColor (0,0,0,0);
glCullFace(GL_FRONT); glCullFace(GL_FRONT);
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);