Skip to content

Commit

Permalink
spearmint: OpenGL2: Fix r_imageUpsample only applying if r_picmip > 0
Browse files Browse the repository at this point in the history
r_imageUpsample is suppose to upsample images that allow picmip; not
require that r_picmip be set as that reduces image size.
  • Loading branch information
zturtleman committed Feb 21, 2024
1 parent 2417ecb commit cd8f274
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/renderergl2/tr_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -1482,6 +1482,7 @@ static qboolean RawImage_ScaleToPower2( const textureLevel_t *pic, int baseLevel
int height = *inout_height;
int scaled_width;
int scaled_height;
qboolean picmipEnabled = flags & ( IMGFLAG_PICMIP | IMGFLAG_PICMIP2 );
qboolean mipmap = flags & IMGFLAG_MIPMAP;
qboolean clampToEdge = flags & IMGFLAG_CLAMPTOEDGE;
qboolean scaled;
Expand All @@ -1505,7 +1506,7 @@ static qboolean RawImage_ScaleToPower2( const textureLevel_t *pic, int baseLevel
if ( r_roundImagesDown->integer && scaled_height > height )
scaled_height >>= 1;

if ( picmip && pic && pic->data && resampledBuffer && r_imageUpsample->integer &&
if ( picmipEnabled && pic && pic->data && resampledBuffer && r_imageUpsample->integer &&
scaled_width < r_imageUpsampleMaxSize->integer && scaled_height < r_imageUpsampleMaxSize->integer)
{
int finalwidth, finalheight;
Expand Down

0 comments on commit cd8f274

Please sign in to comment.