From 6c0eed1b2bd55f81605e36beaab1a813ec630dbb Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 31 Oct 2023 04:27:34 +0300 Subject: [PATCH] ref: gl: allow viewing water textures in their full glory with enabled r_ripple 2 --- ref/gl/gl_warp.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ref/gl/gl_warp.c b/ref/gl/gl_warp.c index 46a0ce79..21b02150 100644 --- a/ref/gl/gl_warp.c +++ b/ref/gl/gl_warp.c @@ -82,7 +82,7 @@ static struct uint32_t texture[RIPPLES_TEXSIZE]; int gl_texturenum; int rippletexturenum; - int texturescale; // not all textures are 128x128, scale the texcoords down + float texturescale; // not all textures are 128x128, scale the texcoords down } g_ripple; static qboolean CheckSkybox( const char *name, char out[6][MAX_STRING] ) @@ -1010,7 +1010,15 @@ void R_UploadRipples( texture_t *image ) return; g_ripple.gl_texturenum = image->gl_texturenum; - g_ripple.texturescale = Q_max( 1, image->width / 64 ); + if( r_ripple.value == 1.0f ) + { + g_ripple.texturescale = Q_max( 1.0f, image->width / 64.0f ); + } + else + { + g_ripple.texturescale = 1.0f; + } + pixels = (uint32_t *)glt->original->buffer; wbits = MostSignificantBit( image->width );