]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into divVerent/csqcmodel
authorRudolf Polzer <divverent@xonotic.org>
Thu, 17 Nov 2011 17:02:24 +0000 (18:02 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 17 Nov 2011 17:02:24 +0000 (18:02 +0100)
defaultXonotic.cfg
qcsrc/client/View.qc
qcsrc/client/autocvars.qh
qcsrc/client/csqc_builtins.qc
qcsrc/client/gibs.qc
qcsrc/client/main.qh

index 2003d80d89503ee27ee954b2c23b54e73c1b0826..8dc18eacb0434059be4008b37fe0d560d9510a59 100644 (file)
@@ -925,6 +925,7 @@ seta cl_gibs_velocity_random 1 "gib throw velocity randomness scale"
 seta cl_gibs_velocity_up 1 "extra z velocity for gibs"
 seta cl_gibs_ticrate 0.1 "ticrate for gibs"
 seta cl_gibs_sloppy 1 "sloppy gibs, may temporarily penetrate walls"
+seta cl_gibs_avelocity_scale 1 "how much angular velocity to use on gibs"
 seta cl_casings 1 "enable or disable bullet casings"
 seta cl_casings_shell_time 30 "shell casing lifetime"
 seta cl_casings_bronze_time 10 "bullet casings lifetime"
index c0123c87f721d93559a2409820a802173b996872..415c69557e66c8b487c546bc443c912380580290 100644 (file)
@@ -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);
 
index add0473595f6116681e78c50c1e1b9ef11627e0a..070f4f6c96c55a6e09ed72636bfd6ab840f355e0 100644 (file)
@@ -48,6 +48,7 @@ var float autocvar_cl_gibs_sloppy = 1;
 var float autocvar_cl_gibs_ticrate = 0.1;
 var float autocvar_cl_gibs_velocity_random = 1;
 var float autocvar_cl_gibs_velocity_scale = 1;
+var float autocvar_cl_gibs_avelocity_scale = 1;
 float autocvar_cl_gibs_velocity_up;
 float autocvar_cl_gunalign;
 float autocvar_cl_hidewaypoints;
index 35cf6b19bcd6aa87308efbd243064b98269c3bc7..96e28b96abcc114f01f1bab91e4009bedf2bc937 100644 (file)
@@ -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
index dca48bd82ff64891f4a7cab6c3ff88f5b3cb070c..9cb2878e992d55823aa78748b62e718c0161057f 100644 (file)
@@ -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)
@@ -133,7 +138,7 @@ void TossGib (string mdlname, vector safeorg, vector org, vector vconst, vector
 
        gib.move_origin = gib.origin = org;
        gib.move_velocity = vconst * autocvar_cl_gibs_velocity_scale + vrand * autocvar_cl_gibs_velocity_random + '0 0 1' * autocvar_cl_gibs_velocity_up;
-       gib.move_avelocity = prandomvec() * vlen(gib.move_velocity);
+       gib.move_avelocity = prandomvec() * vlen(gib.move_velocity) * autocvar_gl_gibs_avelocity_scale;
        gib.move_time = time;
        gib.damageforcescale = autocvar_cl_gibs_damageforcescale;
 
index 2a4147170fa1e7cb1f4e20efabff1c823b1dbb6a..6efedb7deb6f52b2410793f5892d4df7c83de5ee 100644 (file)
@@ -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);