mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-27 06:13:01 +00:00
Don't set fog image border color
GL1's R_CreateImage sets GL texture to 0 before it ends, so border color is not applied to the fog image. GL_CLAMP is not used for fog image (in either renderer), so it would presumably not be used even if applied to the fog image.
This commit is contained in:
parent
60d28722ef
commit
d06deb41c8
2 changed files with 0 additions and 23 deletions
|
@ -899,7 +899,6 @@ image_t *R_CreateImage( const char *name, byte *pic, int width, int height,
|
|||
qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, glWrapClampMode );
|
||||
qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, glWrapClampMode );
|
||||
|
||||
// FIXME: this stops fog from setting border color?
|
||||
glState.currenttextures[glState.currenttmu] = 0;
|
||||
qglBindTexture( GL_TEXTURE_2D, 0 );
|
||||
|
||||
|
@ -1168,7 +1167,6 @@ static void R_CreateFogImage( void ) {
|
|||
int x,y;
|
||||
byte *data;
|
||||
float d;
|
||||
float borderColor[4];
|
||||
|
||||
data = ri.Hunk_AllocateTempMemory( FOG_S * FOG_T * 4 );
|
||||
|
||||
|
@ -1183,18 +1181,8 @@ static void R_CreateFogImage( void ) {
|
|||
data[(y*FOG_S+x)*4+3] = 255*d;
|
||||
}
|
||||
}
|
||||
// standard openGL clamping doesn't really do what we want -- it includes
|
||||
// the border color at the edges. OpenGL 1.2 has clamp-to-edge, which does
|
||||
// what we want.
|
||||
tr.fogImage = R_CreateImage("*fog", (byte *)data, FOG_S, FOG_T, IMGTYPE_COLORALPHA, IMGFLAG_CLAMPTOEDGE, 0 );
|
||||
ri.Hunk_FreeTempMemory( data );
|
||||
|
||||
borderColor[0] = 1.0;
|
||||
borderColor[1] = 1.0;
|
||||
borderColor[2] = 1.0;
|
||||
borderColor[3] = 1;
|
||||
|
||||
qglTexParameterfv( GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -2641,7 +2641,6 @@ static void R_CreateFogImage( void ) {
|
|||
int x,y;
|
||||
byte *data;
|
||||
float d;
|
||||
float borderColor[4];
|
||||
|
||||
data = ri.Hunk_AllocateTempMemory( FOG_S * FOG_T * 4 );
|
||||
|
||||
|
@ -2656,18 +2655,8 @@ static void R_CreateFogImage( void ) {
|
|||
data[(y*FOG_S+x)*4+3] = 255*d;
|
||||
}
|
||||
}
|
||||
// standard openGL clamping doesn't really do what we want -- it includes
|
||||
// the border color at the edges. OpenGL 1.2 has clamp-to-edge, which does
|
||||
// what we want.
|
||||
tr.fogImage = R_CreateImage("*fog", (byte *)data, FOG_S, FOG_T, IMGTYPE_COLORALPHA, IMGFLAG_CLAMPTOEDGE, 0 );
|
||||
ri.Hunk_FreeTempMemory( data );
|
||||
|
||||
borderColor[0] = 1.0;
|
||||
borderColor[1] = 1.0;
|
||||
borderColor[2] = 1.0;
|
||||
borderColor[3] = 1;
|
||||
|
||||
qglTexParameterfv( GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue