]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Get rid of cl_bob2up. It's not good for -sideways- movement
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 12 Jul 2010 18:08:43 +0000 (18:08 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 12 Jul 2010 18:08:43 +0000 (18:08 +0000)
From: MirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>

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

darkplaces.txt
view.c

index a984a859f698a73d600b6d953fd05045ce74a951..eb3b30338f72ec25e8093e26ad2a99206999c6c5 100644 (file)
@@ -426,7 +426,6 @@ cl_followmodel_up_highpass1                       60                  gun follow
 cl_followmodel_up_highpass                        3                   gun following upward highpass in 1/s
 cl_followmodel_up_lowpass                         30                  gun following upward lowpass in 1/s
 cl_bobup                                          0.5                 view bobbing adjustment that makes the up or down swing of the bob last longer
-cl_bob2up                                         0.5                 view bobbing adjustment that makes the side swing of the bob last longer
 cl_capturevideo                                   0                   enables saving of video to a .avi file using uncompressed I420 colorspace and PCM audio, note that scr_screenshot_gammaboost affects the brightness of the output)
 cl_capturevideo_fps                               30                  how many frames per second to save (29.97 for NTSC, 30 for typical PC video, 15 can be useful)
 cl_capturevideo_number                            1                   number to append to video filename, incremented each time a capture begins
diff --git a/view.c b/view.c
index a5dcebcc9ef59d39e76807ae1b788115c200b0e3..ed3739f598210e3704ab1bf796cdf95cd251972e 100644 (file)
--- a/view.c
+++ b/view.c
@@ -41,7 +41,6 @@ cvar_t cl_bobcycle = {CVAR_SAVE, "cl_bobcycle","0.6", "view bobbing speed"};
 cvar_t cl_bobup = {CVAR_SAVE, "cl_bobup","0.5", "view bobbing adjustment that makes the up or down swing of the bob last longer"};
 cvar_t cl_bob2 = {CVAR_SAVE, "cl_bob2","0", "sideways view bobbing amount"};
 cvar_t cl_bob2cycle = {CVAR_SAVE, "cl_bob2cycle","0.6", "sideways view bobbing speed"};
-cvar_t cl_bob2up = {CVAR_SAVE, "cl_bob2up","0.5", "view bobbing adjustment that makes the side swing of the bob last longer"};
 cvar_t cl_bob2smooth = {CVAR_SAVE, "cl_bob2smooth","0.05", "how fast the view goes back when you stop touching the ground"};
 cvar_t cl_bobmodel = {CVAR_SAVE, "cl_bobmodel", "1", "enables gun bobbing"};
 cvar_t cl_bobmodel_side = {CVAR_SAVE, "cl_bobmodel_side", "0.15", "gun bobbing sideways sway amount"};
@@ -674,10 +673,10 @@ void V_CalcRefdef (void)
 
                                                cycle = cl.time / cl_bob2cycle.value;
                                                cycle -= (int) cycle;
-                                               if (cycle < cl_bob2up.value)
-                                                       cycle = sin(M_PI * cycle / cl_bob2up.value);
+                                               if (cycle < 0.5)
+                                                       cycle = sin(M_PI * cycle / 0.5);
                                                else
-                                                       cycle = sin(M_PI + M_PI * (cycle-cl_bob2up.value)/(1.0 - cl_bob2up.value));
+                                                       cycle = sin(M_PI + M_PI * (cycle-0.5)/0.5);
                                                bob = xyspeed * cl_bob2.value * cycle;
 
                                                // this value slowly decreases from 1 to 0 when we stop touching the ground.
@@ -948,7 +947,6 @@ void V_Init (void)
        Cvar_RegisterVariable (&cl_bobup);
        Cvar_RegisterVariable (&cl_bob2);
        Cvar_RegisterVariable (&cl_bob2cycle);
-       Cvar_RegisterVariable (&cl_bob2up);
        Cvar_RegisterVariable (&cl_bob2smooth);
        Cvar_RegisterVariable (&cl_bobmodel);
        Cvar_RegisterVariable (&cl_bobmodel_side);