From ead54782d05b67e33ba5338fae081ea3c4af45af Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Mon, 21 Aug 2017 21:32:24 -0500 Subject: [PATCH] Improve client input responsiveness Move sampling input to the other side of framerate limiter. Thanks to Alexander "wareya" Nadeau and Juraj "youurayy" Vitko for pointing this out. --- code/qcommon/common.c | 2 ++ code/qcommon/qcommon.h | 8 ++++++++ code/sys/sys_main.c | 1 - 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/code/qcommon/common.c b/code/qcommon/common.c index 0359a307..fd9f9b18 100644 --- a/code/qcommon/common.c +++ b/code/qcommon/common.c @@ -3162,6 +3162,8 @@ void Com_Frame( void ) { NET_Sleep(timeVal - 1); } while(Com_TimeVal(minMsec)); + IN_Frame(); + lastTime = com_frameTime; com_frameTime = Com_EventLoop(); diff --git a/code/qcommon/qcommon.h b/code/qcommon/qcommon.h index 07eebe71..b1224ac6 100644 --- a/code/qcommon/qcommon.h +++ b/code/qcommon/qcommon.h @@ -1058,6 +1058,14 @@ int SV_SendQueuedPackets(void); qboolean UI_GameCommand( void ); qboolean UI_usesUniqueCDKey(void); +// +// input interface +// +void IN_Init( void *windowData ); +void IN_Frame( void ); +void IN_Shutdown( void ); +void IN_Restart( void ); + /* ============================================================== diff --git a/code/sys/sys_main.c b/code/sys/sys_main.c index 586e37a1..0598f293 100644 --- a/code/sys/sys_main.c +++ b/code/sys/sys_main.c @@ -756,7 +756,6 @@ int main( int argc, char **argv ) while( 1 ) { - IN_Frame( ); Com_Frame( ); }