]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/slider_picmip.qc
take3: format 903 files
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / slider_picmip.qc
index 5611079335c5930ceaf50e07180d0eb71a6464aa..024d766e9223e71aaa7dc431b244ef284871e82d 100644 (file)
@@ -16,23 +16,23 @@ void XonoticPicmipSlider_configureXonoticPicmipSlider(entity me)
 }
 float texmemsize(float s3tc)
 {
-       return
-       (
-                 2500 * POW(0.25, max(0, cvar("gl_picmip") + cvar("gl_picmip_other")))
+       return (
+               2500 * POW(0.25, max(0, cvar("gl_picmip") + cvar("gl_picmip_other")))
                + 1500 * POW(0.25, max(0, cvar("gl_picmip") + cvar("gl_picmip_world")))
        ) * ((s3tc && (cvar("r_texture_dds_load") || cvar("gl_texturecompression"))) ? 0.2 : 1.0); // TC: normalmaps 50%, other 25%, few incompressible, guessing 40% as conservative average
 }
 void XonoticPicmipSlider_autofix(entity me)
 {
        float max_hard, max_soft;
-       if(cvar("menu_picmip_bypass"))
+       if (cvar("menu_picmip_bypass")) {
                return;
+       }
        max_hard = cvar("sys_memsize_virtual");
        max_soft = cvar("sys_memsize_physical");
-       if(max_hard > 0)
-       {
-               while(me.value > 0 && texmemsize(me.have_s3tc) > max_hard)
+       if (max_hard > 0) {
+               while (me.value > 0 && texmemsize(me.have_s3tc) > max_hard) {
                        me.setValue(me, me.value - 1);
+               }
        }
        // TODO also check the soft limit!
        // TODO better handling than clamping the slider!