From 35b2d77661b3ada87d5721fbe7114631008480c2 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Thu, 2 Jun 2022 14:33:10 +0300 Subject: [PATCH] TexMgr_SafeTextureSize: don't use function calls from q_min() macro --- Quake/gl_texmgr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Quake/gl_texmgr.c b/Quake/gl_texmgr.c index 598759cf..4087785a 100644 --- a/Quake/gl_texmgr.c +++ b/Quake/gl_texmgr.c @@ -672,10 +672,13 @@ TexMgr_SafeTextureSize -- return a size with hardware and user prefs in mind */ int TexMgr_SafeTextureSize (int s) { + int p = (int)gl_max_size.value; if (!gl_texture_NPOT) s = TexMgr_Pad(s); - if ((int)gl_max_size.value > 0) - s = q_min(TexMgr_Pad((int)gl_max_size.value), s); + if (p > 0) { + p = TexMgr_Pad(p); + if (p < s) s = p; + } s = q_min(gl_hardware_maxsize, s); return s; }