diff --git a/main/config.cfg b/main/config.cfg index b8354cfb..122cb1ce 100644 --- a/main/config.cfg +++ b/main/config.cfg @@ -179,7 +179,9 @@ lightgamma "2" ex_interp "0.05" cl_cross "1" rate "30000" -cl_bob "0" +cl_bob "0.01" +cl_bobcycle "0.8" +cl_bob "0.5" cl_weaponswap "2" +mlook diff --git a/main/source/cl_dll/input.cpp b/main/source/cl_dll/input.cpp index 5724e271..3f6d3835 100644 --- a/main/source/cl_dll/input.cpp +++ b/main/source/cl_dll/input.cpp @@ -124,6 +124,7 @@ cvar_t *cl_yawspeed; cvar_t *cl_pitchspeed; cvar_t *cl_anglespeedkey; cvar_t *cl_vsmoothing; +cvar_t *cl_bobview; cvar_t *cl_autohelp; cvar_t *cl_centerentityid; cvar_t *cl_musicenabled; @@ -1619,6 +1620,7 @@ void InitInput (void) cl_pitchdown = gEngfuncs.pfnRegisterVariable ( "cl_pitchdown", "89", 0 ); cl_vsmoothing = gEngfuncs.pfnRegisterVariable ( "cl_vsmoothing", "0.05", FCVAR_ARCHIVE ); + cl_bobview = gEngfuncs.pfnRegisterVariable ( "cl_bobview", "0", FCVAR_ARCHIVE ); m_pitch = gEngfuncs.pfnRegisterVariable ( "m_pitch","0.022", FCVAR_ARCHIVE ); m_yaw = gEngfuncs.pfnRegisterVariable ( "m_yaw","0.022", FCVAR_ARCHIVE ); diff --git a/main/source/cl_dll/view.cpp b/main/source/cl_dll/view.cpp index e8066447..d0bd838b 100644 --- a/main/source/cl_dll/view.cpp +++ b/main/source/cl_dll/view.cpp @@ -77,6 +77,7 @@ when crossing a water boudnary. extern cvar_t *chase_active; extern cvar_t *scr_ofsx, *scr_ofsy, *scr_ofsz; extern cvar_t *cl_vsmoothing; +extern cvar_t *cl_bobview; #define CAM_MODE_RELAX 1 #define CAM_MODE_FOCUS 2 @@ -621,8 +622,11 @@ void V_CalcNormalRefdef ( struct ref_params_s *pparams ) // refresh position VectorCopy ( pparams->simorg, pparams->vieworg ); + + if (cl_bobview && cl_bobview->value != 0) + { pparams->vieworg[2] += ( bob ); - VectorAdd( pparams->vieworg, pparams->viewheight, pparams->vieworg ); + } VectorCopy ( pparams->cl_viewangles, pparams->viewangles ); @@ -754,7 +758,10 @@ void V_CalcNormalRefdef ( struct ref_params_s *pparams ) { view->origin[ i ] += bob * 0.4 * pparams->forward[ i ]; } + if (cl_bobview && cl_bobview->value != 0) + { view->origin[2] += bob; + } // throw in a little tilt. view->angles[YAW] -= bob * 0.5; diff --git a/main/user.scr b/main/user.scr index 913bd72d..3dab6269 100644 --- a/main/user.scr +++ b/main/user.scr @@ -94,6 +94,20 @@ DESCRIPTION INFO_OPTIONS } { "3.000000" } } + + "cl_bob" + { + "Weapon bobbing (0.01 default)" + { NUMBER 0.000000 0.010000 } + { "0.01" } + } + + "cl_bobview" + { + "View bobbing (requires weapon bobbing)" + { BOOL } + { "0" } + } "cl_weaponswap" { diff --git a/main/userconfig.cfg b/main/userconfig.cfg index 0f3c13cc..e8f508dc 100644 --- a/main/userconfig.cfg +++ b/main/userconfig.cfg @@ -12,9 +12,6 @@ lightgamma "2" fps_override "1" gl_vsync "0" -//View and weapon bob off -cl_bob "0" - //Network rates for the 21st century rate "30000" cl_updaterate "100"