changed texrgbscale to int rather than float, this allowed me to change all remaining...
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 30 Apr 2002 06:24:30 +0000 (06:24 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 30 Apr 2002 06:24:30 +0000 (06:24 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1799 d7cf8633-e32d-0410-b094-e92efae38249

gl_backend.c
gl_backend.h
gl_draw.c
r_clip.c

index 4a15b6d..3e0c3ac 100644 (file)
@@ -85,7 +85,7 @@ typedef struct buf_mesh_s
        int depthtest;
        int blendfunc1, blendfunc2;
        int textures[MAX_TEXTUREUNITS];
-       float texturergbscale[MAX_TEXTUREUNITS];
+       int texturergbscale[MAX_TEXTUREUNITS];
        int firsttriangle;
        int triangles;
        int firstvert;
@@ -384,7 +384,7 @@ static int mesh_depthtest;
 static int mesh_unit;
 static int mesh_clientunit;
 static int mesh_texture[MAX_TEXTUREUNITS];
-static float mesh_texturergbscale[MAX_TEXTUREUNITS];
+static int mesh_texturergbscale[MAX_TEXTUREUNITS];
 
 void GL_SetupTextureState(void)
 {
@@ -412,8 +412,8 @@ void GL_SetupTextureState(void)
                                glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);CHECKGLERROR
                                glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA_ARB, GL_SRC_ALPHA);CHECKGLERROR
                                glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA_ARB, GL_SRC_ALPHA);CHECKGLERROR
-                               glTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, mesh_texturergbscale[i]);CHECKGLERROR
-                               glTexEnvf(GL_TEXTURE_ENV, GL_ALPHA_SCALE, 1.0f);CHECKGLERROR
+                               glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, mesh_texturergbscale[i]);CHECKGLERROR
+                               glTexEnvi(GL_TEXTURE_ENV, GL_ALPHA_SCALE, 1);CHECKGLERROR
                        }
                        else
                        {
@@ -611,7 +611,7 @@ void GL_MeshState(buf_mesh_t *mesh)
                                {
                                        qglActiveTexture(GL_TEXTURE0_ARB + (mesh_unit = i));CHECKGLERROR
                                }
-                               glTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, (mesh_texturergbscale[i] = mesh->texturergbscale[i]));CHECKGLERROR
+                               glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, (mesh_texturergbscale[i] = mesh->texturergbscale[i]));CHECKGLERROR
                        }
                }
        }
@@ -763,7 +763,7 @@ void R_Mesh_Finish(void)
                        glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);CHECKGLERROR
                        if (gl_combine.integer)
                        {
-                               glTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, 1.0f);CHECKGLERROR
+                               glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, 1.0f);CHECKGLERROR
                        }
                        if (i > 0)
                        {
index 0082501..ae14212 100644 (file)
@@ -21,7 +21,7 @@ typedef struct
        int tex[MAX_TEXTUREUNITS];
        float *texcoords[MAX_TEXTUREUNITS];
        int texcoordstep[MAX_TEXTUREUNITS];
-       float texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present
+       int texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present
 }
 rmeshinfo_t;
 
@@ -36,7 +36,7 @@ typedef struct
        int numtriangles;
        int numverts;
        int tex[MAX_TEXTUREUNITS];
-       float texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present
+       int texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present
 
        // output
        int *index;
index 330b13e..7ff921e 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -327,7 +327,7 @@ void R_DrawQueue(void)
        glDisable(GL_CULL_FACE);
        glEnable(GL_BLEND);
        glEnable(GL_TEXTURE_2D);
-       glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+       glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
 
        chartexnum = R_GetTexture(char_texture);
 
index 547bcda..cca9170 100644 (file)
--- a/r_clip.c
+++ b/r_clip.c
@@ -886,7 +886,7 @@ void R_Clip_DisplayBuffer(void)
                memset(clipbuffertex, 0, sizeof(clipbuffertex));
                glTexImage2D(GL_TEXTURE_2D, 0, 1, 256, 256, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, clipbuffertex);
        }
-       glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+       glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
        if (lighthalf)