foxygit / doom Log in
commit 10db74bbd140e5b36e55e9b21df0d6143a95d275
Author:     Fabian Greffrath <fabian@greffrath.com>
AuthorDate: Sun Aug 7 18:18:27 2016 +0200
Commit:     Fabian Greffrath <fabian@greffrath.com>
CommitDate: Mon Aug 8 14:00:14 2016 +0200

    CreateUpscaledTexture(): set max texture dimensions more generally

    Think of forks for which the native resolution isn't 320x200. ;)

    No functional changes for Chocolate Doom!
---
 src/i_video.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/i_video.c b/src/i_video.c
index 0c0311bb..c637327d 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -576,13 +576,13 @@ static void CreateUpscaledTexture(void)
     // Limit maximum texture dimensions to 1600x1200.
     // It's really diminishing returns at this point.

-    if (w_upscale > 5)
+    if (w_upscale * SCREENWIDTH > 1600)
     {
-        w_upscale = 5;
+        w_upscale = 1600 / SCREENWIDTH;
     }
-    if (h_upscale > 6)
+    if (h_upscale * SCREENHEIGHT > 1200)
     {
-        h_upscale = 6;
+        h_upscale = 1200 / SCREENHEIGHT;
     }

     // Create a new texture only if the upscale factors have actually changed.