From ffe1a651a99da6b5b588c80e5247648283dd55bc Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 20 Dec 2019 18:11:22 +0200 Subject: [PATCH] - upsample texture if width * height is less or equal to gl_texture_hqresize_maxinputsize squared https://forum.zdoom.org/viewtopic.php?t=66652 --- src/gamedata/textures/hires/hqresize.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gamedata/textures/hires/hqresize.cpp b/src/gamedata/textures/hires/hqresize.cpp index f67d4a137..8a63dd06f 100644 --- a/src/gamedata/textures/hires/hqresize.cpp +++ b/src/gamedata/textures/hires/hqresize.cpp @@ -411,8 +411,9 @@ void FTexture::CreateUpsampledTextureBuffer(FTextureBuffer &texbuffer, bool hasA int inWidth = texbuffer.mWidth; int inHeight = texbuffer.mHeight; - // [BB] Don't resample if the width or height of the input texture is bigger than gl_texture_hqresize_maxinputsize. - if ((inWidth > gl_texture_hqresize_maxinputsize) || (inHeight > gl_texture_hqresize_maxinputsize)) + // [BB] Don't resample if width * height of the input texture is bigger than gl_texture_hqresize_maxinputsize squared. + const int maxInputSize = gl_texture_hqresize_maxinputsize; + if (inWidth * inHeight > maxInputSize * maxInputSize) return; // [BB] Don't try to upsample textures based off FCanvasTexture. (This should never get here in the first place!)