]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/slider_resolution.c
Merge branch 'master' into mirceakitsune/preview_images
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / slider_resolution.c
index 7049f0f3cb8b311549a5d108d28bdf74f785b773..2e3ea4ce4c4d255166b123e5062b6d8fff345df3 100644 (file)
@@ -34,8 +34,8 @@ void updateConwidths()
        if(f < 1)
                c = c * f; // ensures that c_x <= r_x and c_y <= r_y
 
-       minfactor = min(1, 640 / c_x);             // can be > 1 only if c_x is <640
-       maxfactor = max3(1, r_x / c_x, r_y / c_y); // can be < 1 only if r_x < c_x and r_y < c_y
+       minfactor = min(1, 640 / c_x);            // can be > 1 only if c_x is <640
+       maxfactor = max(1, r_x / c_x, r_y / c_y); // can be < 1 only if r_x < c_x and r_y < c_y
        dprint("min factor: ", ftos(minfactor), "\n");
        dprint("max factor: ", ftos(maxfactor), "\n");
 
@@ -85,9 +85,22 @@ void XonoticResolutionSlider_configureXonoticResolutionSlider(entity me)
                r0 = r;
                if(r_x < 640 || r_y < 480)
                        continue;
+               if(r_x > 2 * r_y) // likely dualscreen resolution, skip this one
+                       continue;
                me.addResolution(me, r_x, r_y, r_z);
        }
 
+       if(me.nValues == 0)
+       {
+               me.addResolution(me, 640, 480, 1);
+               me.addResolution(me, 800, 600, 1);
+               me.addResolution(me, 1024, 768, 1);
+               me.addResolution(me, 1280, 960, 1);
+               me.addResolution(me, 1280, 1024, 1);
+               me.addResolution(me, 1650, 1080, 1);
+               me.addResolution(me, 1920, 1080, 1);
+       }
+
        me.configureXonoticTextSliderValues(me);
 }
 void XonoticResolutionSlider_loadCvars(entity me)