Search and replace job to get to compile
This commit is contained in:
parent
c6624eba2d
commit
7e5d433eea
6 changed files with 761 additions and 742 deletions
112
gl_bumpgeneric.c
112
gl_bumpgeneric.c
|
@ -52,17 +52,17 @@ static void generic_checkerror()
|
|||
/**
|
||||
Light attenuation shader
|
||||
*/
|
||||
void GL_EnableGenericAttShader() {
|
||||
|
||||
void GL_EnableGenericAttShader(void)
|
||||
{
|
||||
GL_Bind(glow_texture_object);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
GL_EnableMultitexture();
|
||||
GL_Bind(glow_texture_object);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
}
|
||||
|
||||
void GL_DisableGenericAttShader() {
|
||||
void GL_DisableGenericAttShader(void)
|
||||
{
|
||||
GL_DisableMultitexture();
|
||||
}
|
||||
|
||||
|
@ -72,8 +72,8 @@ void GL_DisableGenericAttShader() {
|
|||
tu0 = light filter cube map
|
||||
tu1 = material color map
|
||||
*/
|
||||
void GL_EnableGenericColorShader (qboolean specular) {
|
||||
|
||||
void GL_EnableGenericColorShader (qboolean specular)
|
||||
{
|
||||
GL_SelectTexture(GL_TEXTURE0_ARB);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glEnable(GL_TEXTURE_CUBE_MAP_ARB);
|
||||
|
@ -85,13 +85,16 @@ void GL_EnableGenericColorShader (qboolean specular) {
|
|||
glTexEnvf (GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_TEXTURE);
|
||||
glTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE);
|
||||
|
||||
if (!specular) {
|
||||
if (!specular)
|
||||
{
|
||||
GL_EnableMultitexture();
|
||||
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
|
||||
glTexEnvf (GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_PREVIOUS_ARB);
|
||||
glTexEnvf (GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_TEXTURE);
|
||||
glTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
GL_EnableMultitexture();
|
||||
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB);
|
||||
glTexEnvf (GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_PREVIOUS_ARB);
|
||||
|
@ -102,11 +105,15 @@ void GL_EnableGenericColorShader (qboolean specular) {
|
|||
|
||||
}
|
||||
|
||||
void GL_DisableGenericColorShader (qboolean specular) {
|
||||
void GL_DisableGenericColorShader (qboolean specular)
|
||||
{
|
||||
|
||||
if (!specular) {
|
||||
if (!specular)
|
||||
{
|
||||
GL_DisableMultitexture();
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
glTexEnvf (GL_TEXTURE_ENV, GL_OPERAND1_RGB_ARB, GL_SRC_COLOR);
|
||||
GL_DisableMultitexture();
|
||||
}
|
||||
|
@ -121,7 +128,8 @@ void GL_DisableGenericColorShader (qboolean specular) {
|
|||
texture coords for unit 0: Tangent space light vector
|
||||
texture coords for unit 1: Normal map texture coords
|
||||
*/
|
||||
void GL_EnableGenericDiffuseShader () {
|
||||
void GL_EnableGenericDiffuseShader(void)
|
||||
{
|
||||
|
||||
GL_SelectTexture(GL_TEXTURE0_ARB);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
@ -141,8 +149,8 @@ void GL_EnableGenericDiffuseShader () {
|
|||
|
||||
}
|
||||
|
||||
void GL_DisableGenericDiffuseShader () {
|
||||
|
||||
void GL_DisableGenericDiffuseShader (void)
|
||||
{
|
||||
GL_DisableMultitexture();
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glDisable(GL_TEXTURE_CUBE_MAP_ARB);
|
||||
|
@ -228,7 +236,7 @@ void Generic_drawTriangleListBump (const vertexdef_t *verts, int *indecies,
|
|||
{
|
||||
return;
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
|
||||
GL_AddColor();
|
||||
glColor3fv(¤tshadowlight->color[0]);
|
||||
|
@ -243,7 +251,7 @@ void Generic_drawTriangleListBump (const vertexdef_t *verts, int *indecies,
|
|||
if (!verts->texcoords)
|
||||
FormatError();
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
|
||||
GL_SelectTexture(GL_TEXTURE1_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
|
@ -252,21 +260,21 @@ void Generic_drawTriangleListBump (const vertexdef_t *verts, int *indecies,
|
|||
if (!verts->tangents)
|
||||
FormatError();
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->tangentstride, verts->tangents);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->tangentstride, verts->tangents);
|
||||
|
||||
if (!verts->binormals)
|
||||
FormatError();
|
||||
GL_SelectTexture(GL_TEXTURE2_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE2_ARB);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->binormalstride, verts->binormals);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->binormalstride, verts->binormals);
|
||||
|
||||
if (!verts->normals)
|
||||
FormatError();
|
||||
GL_SelectTexture(GL_TEXTURE3_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE3_ARB);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->normalstride, verts->normals);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->normalstride, verts->normals);
|
||||
|
||||
glDrawElements(GL_TRIANGLES, numIndecies, GL_UNSIGNED_INT, indecies);
|
||||
|
||||
|
@ -288,18 +296,21 @@ void Generic_drawTriangleListBump (const vertexdef_t *verts, int *indecies,
|
|||
|
||||
static const lightobject_t *currentLo;
|
||||
|
||||
void VertWV(float *pos, float *tex, float *lm, float *tg, float *bn, float*nr) {
|
||||
void VertWV(float *pos, float *tex, float *lm, float *tg, float *bn, float*nr)
|
||||
{
|
||||
glTexCoord3fv(pos);
|
||||
qglMultiTexCoord2fvARB(GL_TEXTURE1_ARB, tex);
|
||||
glVertex3fv(pos);
|
||||
}
|
||||
|
||||
void VertTex(float *pos, float *tex, float *lm, float *tg, float *bn, float*nr) {
|
||||
void VertTex(float *pos, float *tex, float *lm, float *tg, float *bn, float*nr)
|
||||
{
|
||||
glTexCoord2fv(tex);
|
||||
glVertex3fv(pos);
|
||||
}
|
||||
|
||||
void VertFakeSpecular(float *pos, float *tex, float *lm, float *tg, float *bn, float*nr) {
|
||||
void VertFakeSpecular(float *pos, float *tex, float *lm, float *tg, float *bn, float*nr)
|
||||
{
|
||||
glNormal3fv(nr);
|
||||
glTexCoord3fv(pos);
|
||||
qglMultiTexCoord2fvARB(GL_TEXTURE1_ARB, tex);
|
||||
|
@ -307,8 +318,8 @@ void VertFakeSpecular(float *pos, float *tex, float *lm, float *tg, float *bn, f
|
|||
}
|
||||
|
||||
|
||||
void VertAtt(float *pos, float *tex, float *lm, float *tg, float *bn, float*nr) {
|
||||
|
||||
void VertAtt(float *pos, float *tex, float *lm, float *tg, float *bn, float*nr)
|
||||
{
|
||||
vec3_t nearToVert;
|
||||
float tu, tv, tw;
|
||||
|
||||
|
@ -323,8 +334,8 @@ void VertAtt(float *pos, float *tex, float *lm, float *tg, float *bn, float*nr)
|
|||
glVertex3fv(pos);
|
||||
}
|
||||
|
||||
void VertDiffuse(float *pos, float *tex, float *lm, float *tg, float *bn, float*nr) {
|
||||
|
||||
void VertDiffuse(float *pos, float *tex, float *lm, float *tg, float *bn, float*nr)
|
||||
{
|
||||
vec3_t lightDir, tsLightDir;
|
||||
|
||||
VectorSubtract(currentLo->objectorigin, pos, lightDir);
|
||||
|
@ -339,7 +350,9 @@ void VertDiffuse(float *pos, float *tex, float *lm, float *tg, float *bn, float*
|
|||
}
|
||||
|
||||
void Generic_DrawTriWithFunc(const vertexdef_t *verts, int *indecies,
|
||||
int numIndecies, void (*VertFunc) (float *, float *, float *, float *, float *, float*))
|
||||
int numIndecies,
|
||||
void (*VertFunc) (float *, float *, float *,
|
||||
float *, float *, float*))
|
||||
{
|
||||
int i;
|
||||
vertexdef_t v = *verts;
|
||||
|
@ -352,7 +365,8 @@ void Generic_DrawTriWithFunc(const vertexdef_t *verts, int *indecies,
|
|||
if (!v.normalstride) v.normalstride = 12;
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
for (i=0; i<numIndecies; i++) {
|
||||
for (i=0; i<numIndecies; i++)
|
||||
{
|
||||
int ind = indecies[i];
|
||||
|
||||
VertFunc( (float *)((byte *)v.vertices + ind*v.vertexstride),
|
||||
|
@ -391,7 +405,8 @@ void Generic_drawTriangleListBump (const vertexdef_t *verts, int *indecies,
|
|||
GL_DisableGenericDiffuseShader ();
|
||||
|
||||
//Do fake specular
|
||||
if (sh_fakespecular.value) {
|
||||
if (sh_fakespecular.value)
|
||||
{
|
||||
float black[4] = {0.0, 0.0, 0.0, 1.0};
|
||||
float white[4] = {1.0, 1.0, 1.0, 1.0};
|
||||
float pos[4];
|
||||
|
@ -419,7 +434,8 @@ void Generic_drawTriangleListBump (const vertexdef_t *verts, int *indecies,
|
|||
glColor4fv(white);
|
||||
|
||||
GL_EnableGenericColorShader (true);
|
||||
if (shader->numbumpstages > 0) {
|
||||
if (shader->numbumpstages > 0)
|
||||
{
|
||||
GL_BindAdvanced(shader->bumpstages[0].texture[0]);
|
||||
}
|
||||
Generic_DrawTriWithFunc(verts, indecies, numIndecies, VertFakeSpecular);
|
||||
|
@ -451,7 +467,8 @@ void Generic_drawTriangleListBump (const vertexdef_t *verts, int *indecies,
|
|||
{
|
||||
// Just alpha * light color
|
||||
GL_DisableMultitexture();
|
||||
if (shader->numcolorstages > 0) {
|
||||
if (shader->numcolorstages > 0)
|
||||
{
|
||||
GL_BindAdvanced(shader->colorstages[0].texture[0]);
|
||||
}
|
||||
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
@ -471,12 +488,12 @@ void Generic_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
{
|
||||
int i;
|
||||
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
GL_SelectTexture(GL_TEXTURE0_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
if (!shader->cull)
|
||||
|
@ -526,7 +543,7 @@ void Generic_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
|
||||
GL_SelectTexture(GL_TEXTURE0_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
|
@ -534,7 +551,7 @@ void Generic_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
glEnable(GL_TEXTURE_2D);
|
||||
GL_Bind(lightmap_textures+lightmapIndex);
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->lightmapstride, verts->lightmapcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->lightmapstride, verts->lightmapcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
@ -549,7 +566,7 @@ void Generic_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
{
|
||||
if (verts->colors && (shader->flags & SURF_PPLIGHT))
|
||||
{
|
||||
glColorPointer(3, GL_UNSIGNED_BYTE, verts->colorstride, verts->colors);
|
||||
GL_ColorPointer(3, GL_UNSIGNED_BYTE, verts->colorstride, verts->colors);
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
||||
|
@ -859,7 +876,8 @@ void Generic_sendSurfacesATT(msurface_t **surfs, int numSurfaces)
|
|||
glColor4f(1, 1, 1, 1);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
for (j=0; j<surf->polys->numindecies; j++) {
|
||||
for (j=0; j<surf->polys->numindecies; j++)
|
||||
{
|
||||
v = (float *)(&cl.worldmodel->userVerts[surf->polys->indecies[j]]);
|
||||
|
||||
VectorSubtract (v, currentshadowlight->origin, nearToVert);
|
||||
|
@ -918,10 +936,13 @@ void Generic_sendSurfacesWV(msurface_t **surfs, int numSurfaces, qboolean specul
|
|||
}
|
||||
lastshader = shader;
|
||||
GL_SelectTexture(GL_TEXTURE1_ARB);
|
||||
if (!specular) {
|
||||
if (!specular)
|
||||
{
|
||||
if (shader->numcolorstages > 0)
|
||||
GL_BindAdvanced(shader->colorstages[0].texture[0]);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
if (shader->numbumpstages > 0)
|
||||
GL_BindAdvanced(shader->bumpstages[0].texture[0]);
|
||||
}
|
||||
|
@ -930,7 +951,8 @@ void Generic_sendSurfacesWV(msurface_t **surfs, int numSurfaces, qboolean specul
|
|||
glNormal3fv(surf->plane->normal);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
for (j=0; j<surf->polys->numindecies; j++) {
|
||||
for (j=0; j<surf->polys->numindecies; j++)
|
||||
{
|
||||
v = (float *)(&cl.worldmodel->userVerts[surf->polys->indecies[j]]);
|
||||
glTexCoord3fv(&v[0]);
|
||||
qglMultiTexCoord2fARB(GL_TEXTURE1_ARB, v[3], v[4]);
|
||||
|
@ -1000,7 +1022,8 @@ void Generic_sendSurfacesTex(msurface_t **surfs, int numSurfaces)
|
|||
*/
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
for (j=0; j<surf->polys->numindecies; j++) {
|
||||
for (j=0; j<surf->polys->numindecies; j++)
|
||||
{
|
||||
v = (float *)(&cl.worldmodel->userVerts[surf->polys->indecies[j]]);
|
||||
glTexCoord2fv(&v[3]);
|
||||
glVertex3fv(&v[0]);
|
||||
|
@ -1012,7 +1035,8 @@ void Generic_sendSurfacesTex(msurface_t **surfs, int numSurfaces)
|
|||
}
|
||||
|
||||
void Generic_drawSurfaceListBump (vertexdef_t *verts, msurface_t **surfs,
|
||||
int numSurfaces,const transform_t *tr, const lightobject_t *lo)
|
||||
int numSurfaces,const transform_t *tr,
|
||||
const lightobject_t *lo)
|
||||
{
|
||||
glDepthMask (0);
|
||||
|
||||
|
@ -1029,8 +1053,8 @@ void Generic_drawSurfaceListBump (vertexdef_t *verts, msurface_t **surfs,
|
|||
GL_DisableGenericDiffuseShader ();
|
||||
|
||||
//Do fake specular
|
||||
if (sh_fakespecular.value) {
|
||||
|
||||
if (sh_fakespecular.value)
|
||||
{
|
||||
//This is so fake...
|
||||
//-it gets attenuated with the diffuse dot product and the light attenuation
|
||||
//-The specular gets caclulated per vertex
|
||||
|
|
74
gl_bumpgf.c
74
gl_bumpgf.c
|
@ -448,6 +448,8 @@ Shader utitlity routines
|
|||
|
||||
*************************/
|
||||
|
||||
void FormatError(void); // in gl_bumparb.c
|
||||
|
||||
void GF3_SetupTcMod(tcmod_t *tc) {
|
||||
|
||||
switch (tc->type) {
|
||||
|
@ -509,17 +511,13 @@ Generic triangle list routines
|
|||
|
||||
*************************/
|
||||
|
||||
void FormatError () {
|
||||
Sys_Error("Invalid vertexdef_t\n");
|
||||
}
|
||||
|
||||
void GF3_sendTriangleListWV(const vertexdef_t *verts, int *indecies, int numIndecies) {
|
||||
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
//draw them
|
||||
|
@ -531,27 +529,29 @@ void GF3_sendTriangleListWV(const vertexdef_t *verts, int *indecies, int numInde
|
|||
|
||||
void GF3_sendTriangleListTA(const vertexdef_t *verts, int *indecies, int numIndecies) {
|
||||
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
if (!verts->texcoords) FormatError();
|
||||
//Check the input vertices
|
||||
if (IsNullDriver(verts->texcoords)) FormatError();
|
||||
if (IsNullDriver(verts->binormals)) FormatError();
|
||||
if (IsNullDriver(verts->tangents)) FormatError();
|
||||
if (IsNullDriver(verts->normals)) FormatError();
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
if (!verts->tangents) FormatError();
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->tangentstride, verts->tangents);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->tangentstride, verts->tangents);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
if (!verts->binormals) FormatError();
|
||||
qglClientActiveTextureARB(GL_TEXTURE2_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->binormalstride, verts->binormals);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->binormalstride, verts->binormals);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
if (!verts->normals) FormatError();
|
||||
qglClientActiveTextureARB(GL_TEXTURE3_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->normalstride, verts->normals);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->normalstride, verts->normals);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
//draw them
|
||||
|
@ -627,11 +627,11 @@ void GF3_drawTriangleListBase (vertexdef_t *verts, int *indecies, int numIndecie
|
|||
|
||||
int i;
|
||||
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
if (!shader->cull) {
|
||||
|
@ -649,7 +649,7 @@ void GF3_drawTriangleListBase (vertexdef_t *verts, int *indecies, int numIndecie
|
|||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
if (verts->lightmapcoords && (lightmapIndex >= 0) && (shader->flags & SURF_PPLIGHT)) {
|
||||
if (!IsNullDriver(verts->lightmapcoords) && (lightmapIndex >= 0) && (shader->flags & SURF_PPLIGHT)) {
|
||||
|
||||
//Delux lightmapping
|
||||
qboolean usedelux = (sh_delux.value != 0);
|
||||
|
@ -660,23 +660,23 @@ void GF3_drawTriangleListBase (vertexdef_t *verts, int *indecies, int numIndecie
|
|||
|
||||
if (usedelux) {
|
||||
|
||||
glNormalPointer(GL_FLOAT, verts->normalstride, verts->normals);
|
||||
GL_NormalPointer(GL_FLOAT, verts->normalstride, verts->normals);
|
||||
glEnableClientState(GL_NORMAL_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->tangentstride, verts->tangents);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->tangentstride, verts->tangents);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->binormalstride, verts->binormals);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->binormalstride, verts->binormals);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE2_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->lightmapstride, verts->lightmapcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->lightmapstride, verts->lightmapcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE3_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
GL_SelectTexture(GL_TEXTURE0_ARB);
|
||||
|
@ -778,11 +778,11 @@ void GF3_drawTriangleListBase (vertexdef_t *verts, int *indecies, int numIndecie
|
|||
glEnable(GL_TEXTURE_2D);
|
||||
GL_Bind(lightmap_textures+lightmapIndex);
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->lightmapstride, verts->lightmapcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->lightmapstride, verts->lightmapcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
@ -796,9 +796,9 @@ void GF3_drawTriangleListBase (vertexdef_t *verts, int *indecies, int numIndecie
|
|||
glDisable(GL_TEXTURE_2D);
|
||||
GL_SelectTexture(GL_TEXTURE0_ARB);
|
||||
|
||||
} else if (verts->colors && (shader->flags & SURF_PPLIGHT)) {
|
||||
} else if (!IsNullDriver(verts->colors) && (shader->flags & SURF_PPLIGHT)) {
|
||||
|
||||
glColorPointer(3, GL_UNSIGNED_BYTE, verts->colorstride, verts->colors);
|
||||
GL_ColorPointer(3, GL_UNSIGNED_BYTE, verts->colorstride, verts->colors);
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
||||
|
@ -938,7 +938,7 @@ void GF3_TestAmbientBumps (vertexdef_t *verts, msurface_t **surfs, int numSurfac
|
|||
//Pass 1: Lightmap (= ambient occlusion) * colormap
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->lightmapstride, verts->lightmapcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->lightmapstride, verts->lightmapcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
if (shader->numcolorstages) {
|
||||
|
@ -1053,11 +1053,11 @@ void GF3_drawSurfaceListBase (vertexdef_t *verts, msurface_t **surfs, int numSur
|
|||
int i;
|
||||
qboolean usedelux;
|
||||
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
glColor3ub(255,255,255);
|
||||
|
@ -1078,14 +1078,14 @@ void GF3_drawSurfaceListBase (vertexdef_t *verts, msurface_t **surfs, int numSur
|
|||
glPopMatrix();
|
||||
}
|
||||
|
||||
if (verts->lightmapcoords && (shader->flags & SURF_PPLIGHT)) {
|
||||
if (!IsNullDriver(verts->lightmapcoords) && (shader->flags & SURF_PPLIGHT)) {
|
||||
#ifdef AMBIENT_BUMP
|
||||
|
||||
GF3_TestAmbientBumps(verts, surfs, numSurfaces, shader);
|
||||
|
||||
#else
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->lightmapstride, verts->lightmapcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->lightmapstride, verts->lightmapcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
//Delux lightmapping
|
||||
|
@ -1102,11 +1102,11 @@ void GF3_drawSurfaceListBase (vertexdef_t *verts, msurface_t **surfs, int numSur
|
|||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE2_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->lightmapstride, verts->lightmapcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->lightmapstride, verts->lightmapcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE3_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
GL_SelectTexture(GL_TEXTURE0_ARB);
|
||||
|
@ -1401,7 +1401,7 @@ void GF3_drawSurfaceListBump (vertexdef_t *verts, msurface_t **surfs, int numSur
|
|||
|
||||
int i, num;
|
||||
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
|
@ -1412,7 +1412,7 @@ void GF3_drawSurfaceListBump (vertexdef_t *verts, msurface_t **surfs, int numSur
|
|||
GL_DrawAlpha();
|
||||
GL_EnableAttentShaderGF3(tr);
|
||||
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GF3_sendSurfacesPlain(surfs,numSurfaces);
|
||||
|
||||
GL_DisableAttentShaderGF3();
|
||||
|
@ -1425,7 +1425,7 @@ void GF3_drawSurfaceListBump (vertexdef_t *verts, msurface_t **surfs, int numSur
|
|||
num = (currentshadowlight->shader->numstages == 0) ? 1 : currentshadowlight->shader->numstages;
|
||||
for (i=0; i<num; i++) {
|
||||
GL_EnableSpecularShaderGF3(tr, lo, i, true,true);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GF3_sendSurfacesTA(surfs,numSurfaces, true);
|
||||
GL_DisableDiffuseShaderGF3(i);
|
||||
}
|
||||
|
|
63
gl_bumpgl2.c
63
gl_bumpgl2.c
|
@ -828,11 +828,17 @@ void GL2_drawTriangleListBump (const vertexdef_t *verts, int *indecies,
|
|||
const transform_t *tr, const lightobject_t *lo)
|
||||
{
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
|
||||
GL_AddColor();
|
||||
glColor3fv(¤tshadowlight->color[0]);
|
||||
|
||||
//Check the input vertices
|
||||
if (IsNullDriver(verts->texcoords)) FormatError();
|
||||
if (IsNullDriver(verts->binormals)) FormatError();
|
||||
if (IsNullDriver(verts->tangents)) FormatError();
|
||||
if (IsNullDriver(verts->normals)) FormatError();
|
||||
|
||||
GL2_EnableBumpShader(tr, lo, true, shader);
|
||||
|
||||
//bind the correct textures
|
||||
|
@ -840,33 +846,25 @@ void GL2_drawTriangleListBump (const vertexdef_t *verts, int *indecies,
|
|||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
if (shader->numbumpstages > 0)
|
||||
GL_BindAdvanced(shader->bumpstages[0].texture[0]);
|
||||
if (!verts->texcoords)
|
||||
FormatError();
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
|
||||
GL_SelectTexture(GL_TEXTURE1_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
if (shader->numcolorstages > 0)
|
||||
GL_BindAdvanced(shader->colorstages[0].texture[0]);
|
||||
if (!verts->tangents)
|
||||
FormatError();
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->tangentstride, verts->tangents);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->tangentstride, verts->tangents);
|
||||
|
||||
if (!verts->binormals)
|
||||
FormatError();
|
||||
GL_SelectTexture(GL_TEXTURE2_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE2_ARB);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->binormalstride, verts->binormals);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->binormalstride, verts->binormals);
|
||||
|
||||
if (!verts->normals)
|
||||
FormatError();
|
||||
GL_SelectTexture(GL_TEXTURE3_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE3_ARB);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->normalstride, verts->normals);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->normalstride, verts->normals);
|
||||
|
||||
glDrawElements(GL_TRIANGLES, numIndecies, GL_UNSIGNED_INT, indecies);
|
||||
|
||||
|
@ -892,12 +890,12 @@ void GL2_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
int i;
|
||||
|
||||
glGetError();
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
GL_SelectTexture(GL_TEXTURE0_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
if (!shader->cull)
|
||||
|
@ -915,7 +913,7 @@ void GL2_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
}
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
if (verts->lightmapcoords && (lightmapIndex >= 0) && (shader->flags & SURF_PPLIGHT))
|
||||
if (!IsNullDriver(verts->lightmapcoords) && (lightmapIndex >= 0) && (shader->flags & SURF_PPLIGHT))
|
||||
{
|
||||
//Delux lightmapping
|
||||
qboolean usedelux = (sh_delux.value != 0);
|
||||
|
@ -965,14 +963,15 @@ void GL2_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
// Light map
|
||||
GL_SelectTexture(GL_TEXTURE0_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride,
|
||||
verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
GL_Bind(lightmap_textures+lightmapIndex);
|
||||
|
||||
// Delux map
|
||||
GL_SelectTexture(GL_TEXTURE1_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->lightmapstride,
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->lightmapstride,
|
||||
verts->lightmapcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
GL_Bind(lightmap_textures+lightmapIndex+1);
|
||||
|
@ -985,14 +984,14 @@ void GL2_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
GL_BindAdvanced(shader->bumpstages[0].texture[0]);
|
||||
}
|
||||
qglClientActiveTextureARB(GL_TEXTURE2_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->tangentstride,
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->tangentstride,
|
||||
verts->tangents);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
// Setup base texture
|
||||
GL_SelectTexture(GL_TEXTURE3_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE3_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->binormalstride,
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->binormalstride,
|
||||
verts->binormals);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
|
@ -1010,7 +1009,7 @@ void GL2_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
|
||||
// Normals
|
||||
qglClientActiveTextureARB(GL_TEXTURE4_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->normalstride,
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->normalstride,
|
||||
verts->normals);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
|
@ -1064,7 +1063,8 @@ void GL2_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
|
||||
GL_SelectTexture(GL_TEXTURE0_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride,
|
||||
verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
|
@ -1072,7 +1072,8 @@ void GL2_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
glEnable(GL_TEXTURE_2D);
|
||||
GL_Bind(lightmap_textures+lightmapIndex);
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->lightmapstride, verts->lightmapcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->lightmapstride,
|
||||
verts->lightmapcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
@ -1086,9 +1087,9 @@ void GL2_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (verts->colors && (shader->flags & SURF_PPLIGHT))
|
||||
if (!IsNullDriver(verts->colors) && (shader->flags & SURF_PPLIGHT))
|
||||
{
|
||||
glColorPointer(3, GL_UNSIGNED_BYTE, verts->colorstride, verts->colors);
|
||||
GL_ColorPointer(3, GL_UNSIGNED_BYTE, verts->colorstride, verts->colors);
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
||||
|
@ -1235,13 +1236,13 @@ void GL2_drawSurfaceListBase (vertexdef_t* verts, msurface_t** surfs,
|
|||
int usedelux;
|
||||
|
||||
checkerror();
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
GL_SelectTexture(GL_TEXTURE0_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
|
||||
glColor3ub(255,255,255);
|
||||
|
||||
|
@ -1257,11 +1258,11 @@ void GL2_drawSurfaceListBase (vertexdef_t* verts, msurface_t** surfs,
|
|||
GL2_sendSurfacesBase(surfs, numSurfaces, false);
|
||||
glPopMatrix();
|
||||
}
|
||||
if (verts->lightmapcoords && (shader->flags & SURF_PPLIGHT))
|
||||
if (!IsNullDriver(verts->lightmapcoords) && (shader->flags & SURF_PPLIGHT))
|
||||
{
|
||||
GL_SelectTexture(GL_TEXTURE1_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->lightmapstride,
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->lightmapstride,
|
||||
verts->lightmapcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
|
@ -1495,12 +1496,12 @@ void GL2_sendSurfacesTA(msurface_t** surfs, int numSurfaces, const transform_t *
|
|||
void GL2_drawSurfaceListBump (vertexdef_t *verts, msurface_t **surfs,
|
||||
int numSurfaces,const transform_t *tr, const lightobject_t *lo)
|
||||
{
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
|
||||
GL_AddColor();
|
||||
glColor3fv(¤tshadowlight->color[0]);
|
||||
|
|
|
@ -728,11 +728,17 @@ void NV3x_drawTriangleListBump (const vertexdef_t *verts, int *indecies,
|
|||
const transform_t *tr, const lightobject_t *lo)
|
||||
{
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
|
||||
GL_AddColor();
|
||||
glColor3fv(¤tshadowlight->color[0]);
|
||||
|
||||
//Check the input vertices
|
||||
if (IsNullDriver(verts->texcoords)) FormatError();
|
||||
if (IsNullDriver(verts->binormals)) FormatError();
|
||||
if (IsNullDriver(verts->tangents)) FormatError();
|
||||
if (IsNullDriver(verts->normals)) FormatError();
|
||||
|
||||
NV3x_EnableBumpShader(tr, lo, true, shader);
|
||||
|
||||
//bind the correct textures
|
||||
|
@ -740,33 +746,25 @@ void NV3x_drawTriangleListBump (const vertexdef_t *verts, int *indecies,
|
|||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
if (shader->numbumpstages > 0)
|
||||
GL_BindAdvanced(shader->bumpstages[0].texture[0]);
|
||||
if (!verts->texcoords)
|
||||
FormatError();
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
|
||||
GL_SelectTexture(GL_TEXTURE1_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
if (shader->numcolorstages > 0)
|
||||
GL_BindAdvanced(shader->colorstages[0].texture[0]);
|
||||
if (!verts->tangents)
|
||||
FormatError();
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->tangentstride, verts->tangents);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->tangentstride, verts->tangents);
|
||||
|
||||
if (!verts->binormals)
|
||||
FormatError();
|
||||
GL_SelectTexture(GL_TEXTURE2_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE2_ARB);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->binormalstride, verts->binormals);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->binormalstride, verts->binormals);
|
||||
|
||||
if (!verts->normals)
|
||||
FormatError();
|
||||
GL_SelectTexture(GL_TEXTURE3_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE3_ARB);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->normalstride, verts->normals);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->normalstride, verts->normals);
|
||||
|
||||
glDrawElements(GL_TRIANGLES, numIndecies, GL_UNSIGNED_INT, indecies);
|
||||
|
||||
|
@ -792,12 +790,12 @@ void NV3x_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
int i;
|
||||
|
||||
glGetError();
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
GL_SelectTexture(GL_TEXTURE0_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
if (!shader->cull)
|
||||
|
@ -815,7 +813,7 @@ void NV3x_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
}
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
if (verts->lightmapcoords && (lightmapIndex >= 0) && (shader->flags & SURF_PPLIGHT))
|
||||
if (!IsNullDriver(verts->lightmapcoords) && (lightmapIndex >= 0) && (shader->flags & SURF_PPLIGHT))
|
||||
{
|
||||
//Delux lightmapping
|
||||
qboolean usedelux = (sh_delux.value != 0);
|
||||
|
@ -865,7 +863,7 @@ void NV3x_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
GL_SelectTexture(GL_TEXTURE0_ARB);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
GL_Bind(lightmap_textures+lightmapIndex);
|
||||
|
||||
|
@ -873,7 +871,7 @@ void NV3x_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
GL_SelectTexture(GL_TEXTURE1_ARB);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->lightmapstride,
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->lightmapstride,
|
||||
verts->lightmapcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
GL_Bind(lightmap_textures+lightmapIndex+1);
|
||||
|
@ -887,7 +885,7 @@ void NV3x_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
GL_BindAdvanced(shader->bumpstages[0].texture[0]);
|
||||
}
|
||||
qglClientActiveTextureARB(GL_TEXTURE2_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->tangentstride,
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->tangentstride,
|
||||
verts->tangents);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
|
@ -895,7 +893,7 @@ void NV3x_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
GL_SelectTexture(GL_TEXTURE3_ARB);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
qglClientActiveTextureARB(GL_TEXTURE3_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->binormalstride,
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->binormalstride,
|
||||
verts->binormals);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
|
@ -913,7 +911,7 @@ void NV3x_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
|
||||
// Normals
|
||||
qglClientActiveTextureARB(GL_TEXTURE4_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->normalstride,
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->normalstride,
|
||||
verts->normals);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
|
@ -972,7 +970,7 @@ void NV3x_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
|
||||
GL_SelectTexture(GL_TEXTURE0_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
|
@ -980,7 +978,7 @@ void NV3x_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
glEnable(GL_TEXTURE_2D);
|
||||
GL_Bind(lightmap_textures+lightmapIndex);
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->lightmapstride, verts->lightmapcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->lightmapstride, verts->lightmapcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
@ -994,9 +992,9 @@ void NV3x_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (verts->colors && (shader->flags & SURF_PPLIGHT))
|
||||
if (!IsNullDriver(verts->colors) && (shader->flags & SURF_PPLIGHT))
|
||||
{
|
||||
glColorPointer(3, GL_UNSIGNED_BYTE, verts->colorstride, verts->colors);
|
||||
GL_ColorPointer(3, GL_UNSIGNED_BYTE, verts->colorstride, verts->colors);
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
||||
|
@ -1143,13 +1141,13 @@ void NV3x_drawSurfaceListBase (vertexdef_t* verts, msurface_t** surfs,
|
|||
int usedelux;
|
||||
|
||||
checkerror();
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
GL_SelectTexture(GL_TEXTURE0_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
|
||||
glColor3ub(255,255,255);
|
||||
|
||||
|
@ -1166,11 +1164,11 @@ void NV3x_drawSurfaceListBase (vertexdef_t* verts, msurface_t** surfs,
|
|||
NV3x_sendSurfacesBase(surfs, numSurfaces, false);
|
||||
glPopMatrix();
|
||||
}
|
||||
if (verts->lightmapcoords && (shader->flags & SURF_PPLIGHT))
|
||||
if (!IsNullDriver(verts->lightmapcoords) && (shader->flags & SURF_PPLIGHT))
|
||||
{
|
||||
GL_SelectTexture(GL_TEXTURE1_ARB);
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->lightmapstride,
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->lightmapstride,
|
||||
verts->lightmapcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
|
@ -1416,12 +1414,12 @@ void NV3x_sendSurfacesTA(msurface_t** surfs, int numSurfaces, const transform_t
|
|||
void NV3x_drawSurfaceListBump (vertexdef_t *verts, msurface_t **surfs,
|
||||
int numSurfaces,const transform_t *tr, const lightobject_t *lo)
|
||||
{
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
|
||||
GL_AddColor();
|
||||
glColor3fv(¤tshadowlight->color[0]);
|
||||
|
|
|
@ -1169,11 +1169,11 @@ void Parhelia_sendTriangleListWV(const vertexdef_t *verts, int *indecies,
|
|||
int numIndecies)
|
||||
{
|
||||
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
//draw them
|
||||
|
@ -1186,31 +1186,29 @@ void Parhelia_sendTriangleListWV(const vertexdef_t *verts, int *indecies,
|
|||
void Parhelia_sendTriangleListTA(const vertexdef_t *verts, int *indecies,
|
||||
int numIndecies)
|
||||
{
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
if (!verts->texcoords)
|
||||
FormatError();
|
||||
//Check the input vertices
|
||||
if (IsNullDriver(verts->texcoords)) FormatError();
|
||||
if (IsNullDriver(verts->binormals)) FormatError();
|
||||
if (IsNullDriver(verts->tangents)) FormatError();
|
||||
if (IsNullDriver(verts->normals)) FormatError();
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
if (!verts->tangents)
|
||||
FormatError();
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->tangentstride, verts->tangents);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->tangentstride, verts->tangents);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
if (!verts->binormals)
|
||||
FormatError();
|
||||
qglClientActiveTextureARB(GL_TEXTURE2_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->binormalstride, verts->binormals);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->binormalstride, verts->binormals);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
if (!verts->normals)
|
||||
FormatError();
|
||||
qglClientActiveTextureARB(GL_TEXTURE3_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->normalstride, verts->normals);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->normalstride, verts->normals);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
//draw them
|
||||
|
@ -1280,11 +1278,11 @@ void Parhelia_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
{
|
||||
int i;
|
||||
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
if (!shader->cull)
|
||||
|
@ -1302,9 +1300,9 @@ void Parhelia_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
}
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
if (verts->colors && (shader->flags & SURF_PPLIGHT))
|
||||
if (!IsNullDriver(verts->colors) && (shader->flags & SURF_PPLIGHT))
|
||||
{
|
||||
glColorPointer(3, GL_UNSIGNED_BYTE, verts->colorstride, verts->colors);
|
||||
GL_ColorPointer(3, GL_UNSIGNED_BYTE, verts->colorstride, verts->colors);
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
||||
|
@ -1407,11 +1405,11 @@ void Parhelia_drawSurfaceListBase (vertexdef_t* verts, msurface_t** surfs,
|
|||
{
|
||||
int i;
|
||||
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
glColor3ub(255,255,255);
|
||||
|
@ -1429,10 +1427,10 @@ void Parhelia_drawSurfaceListBase (vertexdef_t* verts, msurface_t** surfs,
|
|||
glPopMatrix();
|
||||
}
|
||||
|
||||
if (verts->lightmapcoords && (shader->flags & SURF_PPLIGHT))
|
||||
if (!IsNullDriver(verts->lightmapcoords) && (shader->flags & SURF_PPLIGHT))
|
||||
{
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->lightmapstride,
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->lightmapstride,
|
||||
verts->lightmapcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
|
@ -1623,7 +1621,7 @@ void Parhelia_sendSurfacesPlain(msurface_t** surfs, int numSurfaces)
|
|||
void Parhelia_drawSurfaceListBump (vertexdef_t *verts, msurface_t **surfs,
|
||||
int numSurfaces,const transform_t *tr, const lightobject_t *lo)
|
||||
{
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
|
@ -1635,7 +1633,7 @@ void Parhelia_drawSurfaceListBump (vertexdef_t *verts, msurface_t **surfs,
|
|||
GL_DrawAlpha();
|
||||
Parhelia_EnableAttentShader(tr);
|
||||
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
Parhelia_sendSurfacesPlain(surfs,numSurfaces);
|
||||
|
||||
Parhelia_DisableAttentShader();
|
||||
|
@ -1649,7 +1647,7 @@ void Parhelia_drawSurfaceListBump (vertexdef_t *verts, msurface_t **surfs,
|
|||
|
||||
Parhelia_EnableSpecularShader(tr, lo, true);
|
||||
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
Parhelia_sendSurfacesTA(surfs,numSurfaces);
|
||||
Parhelia_DisableDiffuseShader();
|
||||
|
||||
|
|
|
@ -990,11 +990,11 @@ void Radeon_sendTriangleListWV(const vertexdef_t *verts, int *indecies,
|
|||
int numIndecies)
|
||||
{
|
||||
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
//draw them
|
||||
|
@ -1007,31 +1007,29 @@ void Radeon_sendTriangleListWV(const vertexdef_t *verts, int *indecies,
|
|||
void Radeon_sendTriangleListTA(const vertexdef_t *verts, int *indecies,
|
||||
int numIndecies)
|
||||
{
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
if (!verts->texcoords)
|
||||
FormatError();
|
||||
//Check the input vertices
|
||||
if (IsNullDriver(verts->texcoords)) FormatError();
|
||||
if (IsNullDriver(verts->binormals)) FormatError();
|
||||
if (IsNullDriver(verts->tangents)) FormatError();
|
||||
if (IsNullDriver(verts->normals)) FormatError();
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
if (!verts->tangents)
|
||||
FormatError();
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->tangentstride, verts->tangents);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->tangentstride, verts->tangents);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
if (!verts->binormals)
|
||||
FormatError();
|
||||
qglClientActiveTextureARB(GL_TEXTURE2_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->binormalstride, verts->binormals);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->binormalstride, verts->binormals);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
if (!verts->normals)
|
||||
FormatError();
|
||||
qglClientActiveTextureARB(GL_TEXTURE3_ARB);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->normalstride, verts->normals);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->normalstride, verts->normals);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
//draw them
|
||||
|
@ -1090,11 +1088,11 @@ void Radeon_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
{
|
||||
int i;
|
||||
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
if (!shader->cull)
|
||||
|
@ -1114,9 +1112,9 @@ void Radeon_drawTriangleListBase (vertexdef_t *verts, int *indecies,
|
|||
}
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
if (verts->colors && (shader->flags & SURF_PPLIGHT))
|
||||
if (!IsNullDriver(verts->colors) && (shader->flags & SURF_PPLIGHT))
|
||||
{
|
||||
glColorPointer(3, GL_UNSIGNED_BYTE, verts->colorstride, verts->colors);
|
||||
GL_ColorPointer(3, GL_UNSIGNED_BYTE, verts->colorstride, verts->colors);
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
||||
|
@ -1220,11 +1218,11 @@ void Radeon_drawSurfaceListBase (vertexdef_t* verts, msurface_t** surfs,
|
|||
{
|
||||
int i;
|
||||
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
glColor3ub(255,255,255);
|
||||
|
@ -1242,10 +1240,10 @@ void Radeon_drawSurfaceListBase (vertexdef_t* verts, msurface_t** surfs,
|
|||
glPopMatrix();
|
||||
}
|
||||
|
||||
if (verts->lightmapcoords && (shader->flags & SURF_PPLIGHT))
|
||||
if (!IsNullDriver(verts->lightmapcoords) && (shader->flags & SURF_PPLIGHT))
|
||||
{
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->lightmapstride,
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->lightmapstride,
|
||||
verts->lightmapcoords);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
|
@ -1443,7 +1441,7 @@ void Radeon_drawSurfaceListBump (vertexdef_t *verts, msurface_t **surfs,
|
|||
int numSurfaces, const transform_t *tr,
|
||||
const lightobject_t *lo)
|
||||
{
|
||||
glVertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_VertexPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
qglClientActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
|
@ -1454,7 +1452,7 @@ void Radeon_drawSurfaceListBump (vertexdef_t *verts, msurface_t **surfs,
|
|||
//draw attent into dest alpha
|
||||
GL_DrawAlpha();
|
||||
Radeon_EnableAttentShader(tr);
|
||||
glTexCoordPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
GL_TexCoordPointer(3, GL_FLOAT, verts->vertexstride, verts->vertices);
|
||||
Radeon_sendSurfacesPlain(surfs,numSurfaces);
|
||||
Radeon_DisableAttentShader();
|
||||
GL_ModulateAlphaDrawColor();
|
||||
|
@ -1465,7 +1463,7 @@ void Radeon_drawSurfaceListBump (vertexdef_t *verts, msurface_t **surfs,
|
|||
}
|
||||
glColor3fv(¤tshadowlight->color[0]);
|
||||
|
||||
glTexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
GL_TexCoordPointer(2, GL_FLOAT, verts->texcoordstride, verts->texcoords);
|
||||
Radeon_sendSurfacesTA(surfs, numSurfaces, tr, lo);
|
||||
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
|
|
Loading…
Reference in a new issue