TexMgr_SafeTextureSize: don't use function calls from q_min() macro

This commit is contained in:
Ozkan Sezer 2022-06-02 14:33:10 +03:00
parent 6c9bde021c
commit 35b2d77661
1 changed files with 5 additions and 2 deletions

View File

@ -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;
}