]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
added cl_minfps_qualitypower cvar to make particle quality drop more
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 27 Jan 2008 00:46:45 +0000 (00:46 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 27 Jan 2008 00:46:45 +0000 (00:46 +0000)
sharply at lower framerates

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8016 d7cf8633-e32d-0410-b094-e92efae38249

cl_screen.c
host.c

index 3c4ffd56e8fbb9ab6f78468ef0f9a24ad2cb0f6f..6124402ca8e07a47085af89db777c708de907e40 100644 (file)
@@ -2097,6 +2097,7 @@ extern cvar_t cl_minfps;
 extern cvar_t cl_minfps_fade;
 extern cvar_t cl_minfps_qualitymax;
 extern cvar_t cl_minfps_qualitymin;
+extern cvar_t cl_minfps_qualitypower;
 extern cvar_t cl_minfps_qualityscale;
 static double cl_updatescreen_rendertime = 0;
 static double cl_updatescreen_quality = 1;
@@ -2170,7 +2171,7 @@ void CL_UpdateScreen(void)
        qglClearColor(0,0,0,0);CHECKGLERROR
        R_ClearScreen(false);
        r_refdef.view.clear = false;
-       r_refdef.view.quality = bound(cl_minfps_qualitymin.value, cl_updatescreen_quality * cl_minfps_qualityscale.value, cl_minfps_qualitymax.value);
+       r_refdef.view.quality = bound(cl_minfps_qualitymin.value, pow(cl_updatescreen_quality, cl_minfps_qualitypower.value) * cl_minfps_qualityscale.value, cl_minfps_qualitymax.value);
 
        if(scr_stipple.integer)
        {
diff --git a/host.c b/host.c
index 5e830cacc896266cdd90d8c6905df334332af8d8..5c8cb67ee12e96067327e44454f79d91a4fde621 100644 (file)
--- a/host.c
+++ b/host.c
@@ -63,6 +63,7 @@ cvar_t cl_minfps = {CVAR_SAVE, "cl_minfps", "40", "minimum fps target - while th
 cvar_t cl_minfps_fade = {CVAR_SAVE, "cl_minfps_fade", "0.2", "how fast the quality adapts to varying framerate"};
 cvar_t cl_minfps_qualitymax = {CVAR_SAVE, "cl_minfps_qualitymax", "1", "highest allowed drawdistance multiplier"};
 cvar_t cl_minfps_qualitymin = {CVAR_SAVE, "cl_minfps_qualitymin", "0.25", "lowest allowed drawdistance multiplier"};
+cvar_t cl_minfps_qualitypower = {CVAR_SAVE, "cl_minfps_qualitypower", "4", "raises quality value to a power of itself, higher values make quality drop more sharply in relation to framerate"};
 cvar_t cl_minfps_qualityscale = {CVAR_SAVE, "cl_minfps_qualityscale", "0.5", "multiplier for quality"};
 cvar_t cl_maxfps = {CVAR_SAVE, "cl_maxfps", "1000000", "maximum fps cap, if game is running faster than this it will wait before running another frame (useful to make cpu time available to other programs)"};
 cvar_t cl_maxidlefps = {CVAR_SAVE, "cl_maxidlefps", "20", "maximum fps cap when the game is not the active window (makes cpu time available to other programs"};
@@ -210,6 +211,7 @@ static void Host_InitLocal (void)
        Cvar_RegisterVariable (&cl_minfps_fade);
        Cvar_RegisterVariable (&cl_minfps_qualitymax);
        Cvar_RegisterVariable (&cl_minfps_qualitymin);
+       Cvar_RegisterVariable (&cl_minfps_qualitypower);
        Cvar_RegisterVariable (&cl_minfps_qualityscale);
        Cvar_RegisterVariable (&cl_maxfps);
        Cvar_RegisterVariable (&cl_maxidlefps);