From cf311a09bb0444e61d692b53d9350501c29219c9 Mon Sep 17 00:00:00 2001 From: Kamay Xutax Date: Sat, 20 Jul 2024 00:57:02 +0200 Subject: [PATCH] Update mouse calls at the end of the frame --- engine/host.cpp | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/engine/host.cpp b/engine/host.cpp index 4187a17b9a..9864c2e472 100644 --- a/engine/host.cpp +++ b/engine/host.cpp @@ -3139,7 +3139,7 @@ void _Host_RunFrame (float time) g_pMDLCache->MarkFrame(); } - +#ifndef SWDS const auto CalcInterpolationAmount = [&]() { // TODO_ENHANCED: @@ -3200,7 +3200,7 @@ void _Host_RunFrame (float time) #endif } }; - +#endif { // Profile scope, protect from setjmp() problems VPROF( "_Host_RunFrame" ); @@ -3394,13 +3394,6 @@ void _Host_RunFrame (float time) CL_RunPrediction( PREDICTION_NORMAL ); CL_ApplyAddAngle(); - - // The mouse is always simulated for the current frame's time - // This makes updates smooth in every case - // continuous controllers affecting the view are also simulated this way - // but they have a cap applied by IN_SetSampleTime() so they are not also - // simulated during input gathering - CL_ExtraMouseUpdate( g_ClientGlobalVariables.frametime ); } #endif #if defined( REPLAY_ENABLED ) @@ -3516,13 +3509,6 @@ void _Host_RunFrame (float time) Host_SetClientInSimulation( false ); - // The mouse is always simulated for the current frame's time - // This makes updates smooth in every case - // continuous controllers affecting the view are also simulated this way - // but they have a cap applied by IN_SetSampleTime() so they are not also - // simulated during input gathering - CL_ExtraMouseUpdate( g_ClientGlobalVariables.frametime ); - g_ClientGlobalVariables.tickcount = saveTick; numticks_last_frame = numticks; host_remainder_last_frame = host_remainder; @@ -3657,6 +3643,16 @@ void _Host_RunFrame (float time) } // Profile scope, protect from setjmp() problems Host_ShowIPCCallCount(); +#ifndef SWDS + // TODO_ENHANCED: + // Update the mouse as last so we can get the right prediction viewangles on a frame + // The mouse is always simulated for the current frame's time + // This makes updates smooth in every case + // continuous controllers affecting the view are also simulated this way + // but they have a cap applied by IN_SetSampleTime() so they are not also + // simulated during input gathering + CL_ExtraMouseUpdate( g_ClientGlobalVariables.frametime ); +#endif } /* ==============================