From: Mircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Date: Sat, 8 Jan 2011 17:20:46 +0000 (+0200)
Subject: Add a cvar to bypass the menu forcing gl_picmip based on system resources. Only for... 
X-Git-Tag: xonotic-v0.5.0~318^2~146^2
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f129d276f5cfc1ce9300750592ba21273ee2dcc5;p=xonotic%2Fxonotic-data.pk3dir.git

Add a cvar to bypass the menu forcing gl_picmip based on system resources. Only for experienced users and those who want to take the risk of crashes.
---

diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg
index 08e26c6fa..72f43f6fd 100644
--- a/defaultXonotic.cfg
+++ b/defaultXonotic.cfg
@@ -1361,6 +1361,7 @@ seta slowmo 1
 seta menu_skin "luminos"
 set menu_slowmo 1
 seta menu_sounds 0 "enables menu sound effects. 1 enables click sounds, 2 also enables hover sounds"
+set menu_picmip_bypass 0 "bypass texture quality enforcement based on system resources, not recommended and may cause crashes!"
 
 r_textbrightness 0.2
 r_textcontrast 0.8
diff --git a/qcsrc/menu/xonotic/slider_picmip.c b/qcsrc/menu/xonotic/slider_picmip.c
index af278dfd1..2325e5fde 100644
--- a/qcsrc/menu/xonotic/slider_picmip.c
+++ b/qcsrc/menu/xonotic/slider_picmip.c
@@ -24,11 +24,14 @@ void XonoticPicmipSlider_configureXonoticPicmipSlider(entity me)
 }
 float texmemsize(float s3tc)
 {
-	return
-	(
-		  2500 * pow(0.5, max(0, cvar("gl_picmip") + cvar("gl_picmip_other")))
-		+ 1500 * pow(0.5, 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
+	if(cvar("menu_picmip_bypass"))
+		return 0;
+	else
+		return
+		(
+			  2500 * pow(0.5, max(0, cvar("gl_picmip") + cvar("gl_picmip_other")))
+			+ 1500 * pow(0.5, 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)
 {