Integrated youurayy's input lag fix (which was long overdue)

This commit is contained in:
leilei-
2016-06-02 02:33:07 -04:00
parent 22d8f94415
commit 3b1646bf1e
4 changed files with 10 additions and 4 deletions

View File

@@ -31,6 +31,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <winsock.h>
#endif
int demo_protocols[] =
{ 66, 67, 68, 69, 70, 71, 0 };
@@ -3038,6 +3039,9 @@ int Com_TimeVal(int minMsec)
return timeVal;
}
extern void IN_Frame( qboolean in_com_frame ); // youurayy input lag fix
/*
=================
Com_Frame
@@ -3126,6 +3130,8 @@ void Com_Frame( void ) {
NET_Sleep(timeVal - 1);
} while(Com_TimeVal(minMsec));
IN_Frame(qtrue); // youurayy input lag fix
lastTime = com_frameTime;
com_frameTime = Com_EventLoop();

View File

@@ -967,7 +967,7 @@ static void IN_ProcessEvents( void )
IN_Frame
===============
*/
void IN_Frame( void )
void IN_Frame( qboolean in_com_frame )
{
qboolean loading;
@@ -996,7 +996,7 @@ void IN_Frame( void )
IN_ActivateMouse( );
/* in case we had to delay actual restart of video system... */
if ( (vidRestartTime != 0) && (vidRestartTime < Sys_Milliseconds()) )
if( !in_com_frame && ( vidRestartTime != 0 ) && ( vidRestartTime < Sys_Milliseconds( ) ) ) // youurayy input lag fix
{
vidRestartTime = 0;
Cbuf_AddText( "vid_restart\n" );

View File

@@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// Input subsystem
void IN_Init( void );
void IN_Frame( void );
void IN_Frame( qboolean in_com_frame ); // youurayy input lag fix
void IN_Shutdown( void );
void IN_Restart( void );

View File

@@ -655,7 +655,7 @@ int main( int argc, char **argv )
while( 1 )
{
IN_Frame( );
IN_Frame( qfalse ); // youurayy input lag fix
Com_Frame( );
}