shithub: choc

Download patch

ref: 439d4f5ea9417cf6a4ef8eb10c9133778d10c4a8
parent: 20c58f5fc3032e41baac99ae66ab49491e817be2
author: Fabian Greffrath <fabian@greffrath.com>
date: Sun Mar 19 12:31:38 EDT 2017

video: do not ignore 0x0 max texture dimensions

If max texture dimensions are reported as 0x0, do not merely ignore
this but create an actual 0x0 texture instead.

--- a/src/i_video.c
+++ b/src/i_video.c
@@ -564,18 +564,17 @@
                 SDL_GetError());
     }
 
-    while (rinfo.max_texture_width > 0 &&
-           *w_upscale * SCREENWIDTH > rinfo.max_texture_width)
+    while (*w_upscale * SCREENWIDTH > rinfo.max_texture_width)
     {
         --*w_upscale;
     }
-    while (rinfo.max_texture_height > 0 &&
-           *h_upscale * SCREENHEIGHT > rinfo.max_texture_height)
+    while (*h_upscale * SCREENHEIGHT > rinfo.max_texture_height)
     {
         --*h_upscale;
     }
 
-    if (*w_upscale < 1 || *h_upscale < 1)
+    if ((*w_upscale < 1 && rinfo.max_texture_width > 0) ||
+        (*h_upscale < 1 && rinfo.max_texture_height > 0))
     {
         I_Error("CreateUpscaledTexture: Can't create a texture big enough for "
                 "the whole screen! Maximum texture size %dx%d",