Check why doing extra mouse updates at the end of frame doesn't work
This commit is contained in:
parent
edb80c2aa1
commit
c2e64fd750
1 changed files with 20 additions and 22 deletions
|
@ -3056,7 +3056,6 @@ void _Host_RunFrame (float time)
|
||||||
static double host_remainder = 0.0f;
|
static double host_remainder = 0.0f;
|
||||||
double prevremainder;
|
double prevremainder;
|
||||||
bool shouldrender;
|
bool shouldrender;
|
||||||
float angleframetime = 0.0f;
|
|
||||||
|
|
||||||
#if defined( RAD_TELEMETRY_ENABLED )
|
#if defined( RAD_TELEMETRY_ENABLED )
|
||||||
if( g_Telemetry.DemoTickEnd == ( uint32 )-1 )
|
if( g_Telemetry.DemoTickEnd == ( uint32 )-1 )
|
||||||
|
@ -3270,9 +3269,6 @@ void _Host_RunFrame (float time)
|
||||||
cl.m_tickRemainder = host_remainder;
|
cl.m_tickRemainder = host_remainder;
|
||||||
g_ServerGlobalVariables.simTicksThisFrame = 1;
|
g_ServerGlobalVariables.simTicksThisFrame = 1;
|
||||||
cl.SetFrameTime(host_frametime);
|
cl.SetFrameTime(host_frametime);
|
||||||
#ifndef SWDS
|
|
||||||
CalcInterpolationAmount();
|
|
||||||
#endif
|
|
||||||
for ( int tick = 0; tick < numticks; tick++ )
|
for ( int tick = 0; tick < numticks; tick++ )
|
||||||
{
|
{
|
||||||
g_ServerGlobalVariables.currenttick = tick;
|
g_ServerGlobalVariables.currenttick = tick;
|
||||||
|
@ -3398,6 +3394,8 @@ void _Host_RunFrame (float time)
|
||||||
// This causes cl.gettime() to return the true clock being used for rendering (tickcount * rate + remainder)
|
// This causes cl.gettime() to return the true clock being used for rendering (tickcount * rate + remainder)
|
||||||
Host_SetClientInSimulation(false);
|
Host_SetClientInSimulation(false);
|
||||||
|
|
||||||
|
CalcInterpolationAmount();
|
||||||
|
|
||||||
#if defined(REPLAY_ENABLED)
|
#if defined(REPLAY_ENABLED)
|
||||||
// Update client-side replay history manager - called here
|
// Update client-side replay history manager - called here
|
||||||
// since interpolation_amount is set
|
// since interpolation_amount is set
|
||||||
|
@ -3406,7 +3404,6 @@ void _Host_RunFrame (float time)
|
||||||
g_pClientReplayContext->Think();
|
g_pClientReplayContext->Think();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//-------------------
|
//-------------------
|
||||||
// Run prediction if it hasn't been run yet
|
// Run prediction if it hasn't been run yet
|
||||||
//-------------------
|
//-------------------
|
||||||
|
@ -3418,8 +3415,14 @@ void _Host_RunFrame (float time)
|
||||||
|
|
||||||
CL_ApplyAddAngle();
|
CL_ApplyAddAngle();
|
||||||
|
|
||||||
// Ensure we get the right frametime
|
// TODO_ENHANCED:
|
||||||
angleframetime = g_ClientGlobalVariables.frametime;
|
// Update the mouse as last so we can get the right viewangles while taking screenshot.
|
||||||
|
// 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
|
#endif
|
||||||
#if defined( REPLAY_ENABLED )
|
#if defined( REPLAY_ENABLED )
|
||||||
|
@ -3460,8 +3463,6 @@ void _Host_RunFrame (float time)
|
||||||
g_ServerGlobalVariables.simTicksThisFrame = serverticks;
|
g_ServerGlobalVariables.simTicksThisFrame = serverticks;
|
||||||
g_ServerGlobalVariables.tickcount = sv.m_nTickCount;
|
g_ServerGlobalVariables.tickcount = sv.m_nTickCount;
|
||||||
|
|
||||||
CalcInterpolationAmount();
|
|
||||||
|
|
||||||
// THREADED: Run Client
|
// THREADED: Run Client
|
||||||
// -------------------
|
// -------------------
|
||||||
for ( int tick = 0; tick < clientticks; tick++ )
|
for ( int tick = 0; tick < clientticks; tick++ )
|
||||||
|
@ -3507,8 +3508,7 @@ void _Host_RunFrame (float time)
|
||||||
// This causes cl.gettime() to return the true clock being used for rendering (tickcount * rate + remainder)
|
// This causes cl.gettime() to return the true clock being used for rendering (tickcount * rate + remainder)
|
||||||
Host_SetClientInSimulation( false );
|
Host_SetClientInSimulation( false );
|
||||||
|
|
||||||
// Ensure we get the right frametime
|
CalcInterpolationAmount();
|
||||||
angleframetime = g_ClientGlobalVariables.frametime;
|
|
||||||
|
|
||||||
//-------------------
|
//-------------------
|
||||||
// Run prediction if it hasn't been run yet
|
// Run prediction if it hasn't been run yet
|
||||||
|
@ -3544,6 +3544,15 @@ void _Host_RunFrame (float time)
|
||||||
|
|
||||||
Host_SetClientInSimulation( false );
|
Host_SetClientInSimulation( false );
|
||||||
|
|
||||||
|
// TODO_ENHANCED:
|
||||||
|
// Update the mouse as last so we can get the right viewangles while taking screenshot.
|
||||||
|
// 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;
|
g_ClientGlobalVariables.tickcount = saveTick;
|
||||||
numticks_last_frame = numticks;
|
numticks_last_frame = numticks;
|
||||||
host_remainder_last_frame = host_remainder;
|
host_remainder_last_frame = host_remainder;
|
||||||
|
@ -3678,17 +3687,6 @@ void _Host_RunFrame (float time)
|
||||||
} // Profile scope, protect from setjmp() problems
|
} // Profile scope, protect from setjmp() problems
|
||||||
|
|
||||||
Host_ShowIPCCallCount();
|
Host_ShowIPCCallCount();
|
||||||
|
|
||||||
#ifndef SWDS
|
|
||||||
// TODO_ENHANCED:
|
|
||||||
// Update the mouse as last so we can get the right viewangles while taking screenshot.
|
|
||||||
// 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( angleframetime );
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
==============================
|
==============================
|
||||||
|
|
Loading…
Add table
Reference in a new issue