diff options
Diffstat (limited to 'src/renderer')
-rw-r--r-- | src/renderer/tr_backend.c | 8 | ||||
-rw-r--r-- | src/renderer/tr_bsp.c | 2 | ||||
-rw-r--r-- | src/renderer/tr_font.c | 2 | ||||
-rw-r--r-- | src/renderer/tr_image.c | 8 | ||||
-rw-r--r-- | src/renderer/tr_image_jpg.c | 2 | ||||
-rw-r--r-- | src/renderer/tr_local.h | 2 | ||||
-rw-r--r-- | src/renderer/tr_scene.c | 3 | ||||
-rw-r--r-- | src/renderer/tr_shader.c | 9 |
8 files changed, 16 insertions, 20 deletions
diff --git a/src/renderer/tr_backend.c b/src/renderer/tr_backend.c index 5eed467a..4f1e9955 100644 --- a/src/renderer/tr_backend.c +++ b/src/renderer/tr_backend.c @@ -777,8 +777,8 @@ void RE_StretchRaw (int x, int y, int w, int h, int cols, int rows, const byte * qglTexImage2D( GL_TEXTURE_2D, 0, GL_RGB8, cols, rows, 0, GL_RGBA, GL_UNSIGNED_BYTE, data ); qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); - qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP ); - qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP ); + qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); + qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); } else { if (dirty) { // otherwise, just subimage upload it so that drivers can tell we are going to be changing @@ -819,8 +819,8 @@ void RE_UploadCinematic (int w, int h, int cols, int rows, const byte *data, int qglTexImage2D( GL_TEXTURE_2D, 0, GL_RGB8, cols, rows, 0, GL_RGBA, GL_UNSIGNED_BYTE, data ); qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); - qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP ); - qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP ); + qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); + qglTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); } else { if (dirty) { // otherwise, just subimage upload it so that drivers can tell we are going to be changing diff --git a/src/renderer/tr_bsp.c b/src/renderer/tr_bsp.c index 1f63f9f0..fd1b64b6 100644 --- a/src/renderer/tr_bsp.c +++ b/src/renderer/tr_bsp.c @@ -206,7 +206,7 @@ static void R_LoadLightmaps( lump_t *l ) { } } tr.lightmaps[i] = R_CreateImage( va("*lightmap%d",i), image, - LIGHTMAP_SIZE, LIGHTMAP_SIZE, qfalse, qfalse, GL_CLAMP ); + LIGHTMAP_SIZE, LIGHTMAP_SIZE, qfalse, qfalse, GL_CLAMP_TO_EDGE ); } if ( r_lightmap->integer == 2 ) { diff --git a/src/renderer/tr_font.c b/src/renderer/tr_font.c index ea7b9e80..95df7a15 100644 --- a/src/renderer/tr_font.c +++ b/src/renderer/tr_font.c @@ -494,7 +494,7 @@ void RE_RegisterFont(const char *fontName, int pointSize, fontInfo_t *font) { } //Com_sprintf (name, sizeof(name), "fonts/fontImage_%i_%i", imageNumber++, pointSize); - image = R_CreateImage(name, imageBuff, 256, 256, qfalse, qfalse, GL_CLAMP); + image = R_CreateImage(name, imageBuff, 256, 256, qfalse, qfalse, GL_CLAMP_TO_EDGE); h = RE_RegisterShaderFromImage(name, LIGHTMAP_2D, image, qfalse); for (j = lastStart; j < i; j++) { font->glyphs[j].glyph = h; diff --git a/src/renderer/tr_image.c b/src/renderer/tr_image.c index a2e92e49..836433b5 100644 --- a/src/renderer/tr_image.c +++ b/src/renderer/tr_image.c @@ -200,7 +200,7 @@ void R_ImageList_f( void ) { case GL_REPEAT: ri.Printf( PRINT_ALL, "rept " ); break; - case GL_CLAMP: + case GL_CLAMP_TO_EDGE: ri.Printf( PRINT_ALL, "clmp " ); break; default: @@ -1005,7 +1005,7 @@ static void R_CreateDlightImage( void ) { data[y][x][3] = 255; } } - tr.dlightImage = R_CreateImage("*dlight", (byte *)data, DLIGHT_SIZE, DLIGHT_SIZE, qfalse, qfalse, GL_CLAMP ); + tr.dlightImage = R_CreateImage("*dlight", (byte *)data, DLIGHT_SIZE, DLIGHT_SIZE, qfalse, qfalse, GL_CLAMP_TO_EDGE ); } @@ -1095,7 +1095,7 @@ static void R_CreateFogImage( void ) { // 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, qfalse, qfalse, GL_CLAMP ); + tr.fogImage = R_CreateImage("*fog", (byte *)data, FOG_S, FOG_T, qfalse, qfalse, GL_CLAMP_TO_EDGE ); ri.Hunk_FreeTempMemory( data ); borderColor[0] = 1.0; @@ -1173,7 +1173,7 @@ void R_CreateBuiltinImages( void ) { for(x=0;x<32;x++) { // scratchimage is usually used for cinematic drawing - tr.scratchImage[x] = R_CreateImage("*scratch", (byte *)data, DEFAULT_SIZE, DEFAULT_SIZE, qfalse, qtrue, GL_CLAMP ); + tr.scratchImage[x] = R_CreateImage("*scratch", (byte *)data, DEFAULT_SIZE, DEFAULT_SIZE, qfalse, qtrue, GL_CLAMP_TO_EDGE ); } R_CreateDlightImage(); diff --git a/src/renderer/tr_image_jpg.c b/src/renderer/tr_image_jpg.c index 8a9bbc4e..fb4f2121 100644 --- a/src/renderer/tr_image_jpg.c +++ b/src/renderer/tr_image_jpg.c @@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #define JPEG_INTERNALS -#include "../jpeg-6/jpeglib.h" +#include "../jpeg-6b/jpeglib.h" void R_LoadJPG( const char *filename, unsigned char **pic, int *width, int *height ) { /* This struct contains the JPEG decompression parameters and pointers to diff --git a/src/renderer/tr_local.h b/src/renderer/tr_local.h index b8d89af8..ef434718 100644 --- a/src/renderer/tr_local.h +++ b/src/renderer/tr_local.h @@ -104,7 +104,7 @@ typedef struct image_s { qboolean mipmap; qboolean allowPicmip; - int wrapClampMode; // GL_CLAMP or GL_REPEAT + int wrapClampMode; // GL_CLAMP_TO_EDGE or GL_REPEAT struct image_s* next; } image_t; diff --git a/src/renderer/tr_scene.c b/src/renderer/tr_scene.c index 82084886..22b3842b 100644 --- a/src/renderer/tr_scene.c +++ b/src/renderer/tr_scene.c @@ -209,8 +209,7 @@ void RE_AddRefEntityToScene( const refEntity_t *ent ) { if ( !tr.registered ) { return; } - // https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=402 - if ( r_numentities >= ENTITYNUM_WORLD ) { + if ( r_numentities >= MAX_ENTITIES ) { return; } if ( ent->reType < 0 || ent->reType >= RT_MAX_REF_ENTITY_TYPE ) { diff --git a/src/renderer/tr_shader.c b/src/renderer/tr_shader.c index f3f8a331..bcd817bb 100644 --- a/src/renderer/tr_shader.c +++ b/src/renderer/tr_shader.c @@ -658,7 +658,7 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) return qfalse; } - stage->bundle[0].image[0] = R_FindImageFile( token, !shader.noMipMaps, !shader.noPicMip, GL_CLAMP ); + stage->bundle[0].image[0] = R_FindImageFile( token, !shader.noMipMaps, !shader.noPicMip, GL_CLAMP_TO_EDGE ); if ( !stage->bundle[0].image[0] ) { ri.Printf( PRINT_WARNING, "WARNING: R_FindImageFile could not find '%s' in shader '%s'\n", token, shader.name ); @@ -1231,11 +1231,8 @@ static void ParseSkyParms( char **text ) { for (i=0 ; i<6 ; i++) { Com_sprintf( pathname, sizeof(pathname), "%s_%s.tga" , token, suf[i] ); -#ifdef GL_CLAMP_TO_EDGE shader.sky.outerbox[i] = R_FindImageFile( ( char * ) pathname, qtrue, qtrue, GL_CLAMP_TO_EDGE ); -#else - shader.sky.outerbox[i] = R_FindImageFile( ( char * ) pathname, qtrue, qtrue, GL_CLAMP ); -#endif + if ( !shader.sky.outerbox[i] ) { shader.sky.outerbox[i] = tr.defaultImage; } @@ -2517,7 +2514,7 @@ shader_t *R_FindShader( const char *name, int lightmapIndex, qboolean mipRawImag // if not defined in the in-memory shader descriptions, // look for a single supported image file // - image = R_FindImageFile( name, mipRawImage, mipRawImage, mipRawImage ? GL_REPEAT : GL_CLAMP ); + image = R_FindImageFile( name, mipRawImage, mipRawImage, mipRawImage ? GL_REPEAT : GL_CLAMP_TO_EDGE ); if ( !image ) { ri.Printf( PRINT_DEVELOPER, "Couldn't find image file for shader %s\n", name ); shader.defaultShader = qtrue; |