From f2b5400e983a4cf20da96783908a0a825e9f60c6 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sun, 28 Jun 2015 18:24:55 -0500 Subject: Fix abs() being used for float in cl_input.c --- src/client/cl_input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/client/cl_input.c') diff --git a/src/client/cl_input.c b/src/client/cl_input.c index e09d7d75..fdd0c474 100644 --- a/src/client/cl_input.c +++ b/src/client/cl_input.c @@ -605,10 +605,10 @@ usercmd_t CL_CreateCmd( void ) { // draw debug graphs of turning for mouse testing if ( cl_debugMove->integer ) { if ( cl_debugMove->integer == 1 ) { - SCR_DebugGraph( abs(cl.viewangles[YAW] - oldAngles[YAW]) ); + SCR_DebugGraph( fabs(cl.viewangles[YAW] - oldAngles[YAW]) ); } if ( cl_debugMove->integer == 2 ) { - SCR_DebugGraph( abs(cl.viewangles[PITCH] - oldAngles[PITCH]) ); + SCR_DebugGraph( fabs(cl.viewangles[PITCH] - oldAngles[PITCH]) ); } } -- cgit From 975d4d97e4b9459c3d21b4dc3ecd807e9c330d9a Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Tue, 10 Dec 2013 21:14:13 -0600 Subject: Use Opus for VoIP Server/client VoIP protocol is handled by adding new cvars cl_voipProtocol and sv_voipProtocol, sv_voip and cl_voip are used to auto set/clear them. All users need to touch are cl/sv_voip as 0 or 1 just like before. Old Speex VoIP packets in demos are skipped. New VoIP packets are skipped in demos if sv_voipProtocol doesn't match cl_voipProtocol. Notable difference between usage of speex and opus codecs, when using Speex client would be sent 80ms at a time. Using Opus, 60ms is sent at a time. This was changed because the Opus codec supports encoding up to 60ms at a time. (Simpler to send only one codec frame in a packet.) --- src/client/cl_input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/client/cl_input.c') diff --git a/src/client/cl_input.c b/src/client/cl_input.c index fdd0c474..48bf51df 100644 --- a/src/client/cl_input.c +++ b/src/client/cl_input.c @@ -789,7 +789,7 @@ void CL_WritePacket( void ) { { if((clc.voipFlags & VOIP_SPATIAL) || Com_IsVoipTarget(clc.voipTargets, sizeof(clc.voipTargets), -1)) { - MSG_WriteByte (&buf, clc_voip); + MSG_WriteByte (&buf, clc_voipOpus); MSG_WriteByte (&buf, clc.voipOutgoingGeneration); MSG_WriteLong (&buf, clc.voipOutgoingSequence); MSG_WriteByte (&buf, clc.voipOutgoingDataFrames); @@ -810,7 +810,7 @@ void CL_WritePacket( void ) { MSG_Init (&fakemsg, fakedata, sizeof (fakedata)); MSG_Bitstream (&fakemsg); MSG_WriteLong (&fakemsg, clc.reliableAcknowledge); - MSG_WriteByte (&fakemsg, svc_voip); + MSG_WriteByte (&fakemsg, svc_voipOpus); MSG_WriteShort (&fakemsg, clc.clientNum); MSG_WriteByte (&fakemsg, clc.voipOutgoingGeneration); MSG_WriteLong (&fakemsg, clc.voipOutgoingSequence); -- cgit From 004db47aa205b6705ae11c86924eb63549127de6 Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Fri, 29 Jan 2016 20:14:35 -0800 Subject: Fix frame_msec possibly being zero in cl_input.c. This fixes a mouse freezing bug. --- src/client/cl_input.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/client/cl_input.c') diff --git a/src/client/cl_input.c b/src/client/cl_input.c index 48bf51df..7a917df2 100644 --- a/src/client/cl_input.c +++ b/src/client/cl_input.c @@ -633,6 +633,12 @@ void CL_CreateNewCommands( void ) { frame_msec = com_frameTime - old_com_frameTime; + // if running over 1000fps, act as if each frame is 1ms + // prevents divisions by zero + if ( frame_msec < 1 ) { + frame_msec = 1; + } + // if running less than 5fps, truncate the extra time to prevent // unexpected moves after a hitch if ( frame_msec > 200 ) { -- cgit