From: Rudolf Polzer Date: Thu, 17 Nov 2011 13:17:46 +0000 (+0100) Subject: cl_minfps: make gibs die faster on low fps X-Git-Tag: xonotic-v0.6.0~35^2~56 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=92912178c2ec22dfe649dc3fc19c619b6d71be24;p=xonotic%2Fxonotic-data.pk3dir.git cl_minfps: make gibs die faster on low fps --- diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 2d79f8f10..d41923811 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -369,6 +369,11 @@ void CSQC_UpdateView(float w, float h) float a; hud = getstati(STAT_HUD); + if(checkextension("DP_CSQC_MINFPS_QUALITY")) + view_quality = R_SetView(VF_MINFPS_QUALITY); + else + view_quality = 1; + button_attack2 = (input_buttons & BUTTON_3); button_zoom = (input_buttons & BUTTON_4); diff --git a/qcsrc/client/csqc_builtins.qc b/qcsrc/client/csqc_builtins.qc index 35cf6b19b..96e28b96a 100644 --- a/qcsrc/client/csqc_builtins.qc +++ b/qcsrc/client/csqc_builtins.qc @@ -348,3 +348,11 @@ string(string digest, string data, ...) digest_hex = #639; //only the "MD4" digest is always supported! //if the given digest is not supported, string_null is returned //the digest string is matched case sensitively, use "MD4", not "md4"! + +//DP_CSQC_MINFPS_QUALITY +//idea: divVerent +//darkplaces implementation: divVerent +//constant definitions: +const float VF_MINFPS_QUALITY = 213; +//use getproperty(VF_MINFPS_QUALITY); to do CSQC based LOD based on cl_minfps +//1 should lead to an unmodified view diff --git a/qcsrc/client/gibs.qc b/qcsrc/client/gibs.qc index dca48bd82..779f9f7ff 100644 --- a/qcsrc/client/gibs.qc +++ b/qcsrc/client/gibs.qc @@ -94,6 +94,11 @@ void Gib_Draw() trailparticles(self, particleeffectnum(strcat(species_prefix(self.cnt), "TR_BLOOD")), oldorg, self.origin); self.renderflags = 0; + + // make gibs die faster at low view quality + // if view_quality is 0.5, we want to have them die twice as fast + self.nextthink -= frametime * (1 / bound(0.01, view_quality, 1.00) - 1); + self.alpha = bound(0, self.nextthink - time, 1); if(self.alpha < ALPHA_MIN_VISIBLE) diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 2a4147170..6efedb7de 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -165,5 +165,6 @@ float g_trueaim_minrange; entity entcs_receiver[255]; // 255 is the engine limit on maxclients float hud; +float view_quality; void cvar_clientsettemp(string cv, string val);