Browse Source

engine: client: correctly decompiled version of CL_AdjustClock (with removed useless float-to-int operation)

pull/2/head
Alibek Omarov 2 years ago
parent
commit
4a3efa511c
  1. 10
      engine/client/cl_main.c
  2. 3
      engine/client/client.h

10
engine/client/cl_main.c

@ -3030,12 +3030,12 @@ void CL_AdjustClock( void )
if( fabs( cl.timedelta ) >= 0.001f ) if( fabs( cl.timedelta ) >= 0.001f )
{ {
double msec, adjust; double msec, adjust;
float sign; double sign;
msec = ( cl.timedelta * 1000.0f ); msec = ( cl.timedelta * 1000.0 );
sign = ( msec < 0 ) ? 1.0f : -1.0f; sign = ( msec < 0 ) ? 1.0 : -1.0;
msec = fabs( msec ); msec = Q_min( cl_fixtimerate->value, fabs( msec ));
adjust = sign * ( cl_fixtimerate->value / 1000.0f ); adjust = sign * ( msec / 1000.0 );
if( fabs( adjust ) < fabs( cl.timedelta )) if( fabs( adjust ) < fabs( cl.timedelta ))
{ {

3
engine/client/client.h

@ -211,7 +211,7 @@ typedef struct
// a lerp point for other data // a lerp point for other data
double oldtime; // previous cl.time, time-oldtime is used double oldtime; // previous cl.time, time-oldtime is used
// to decay light values and smooth step ups // to decay light values and smooth step ups
float timedelta; // floating delta between two updates double timedelta; // floating delta between two updates
char serverinfo[MAX_SERVERINFO_STRING]; char serverinfo[MAX_SERVERINFO_STRING];
player_info_t players[MAX_CLIENTS]; // collected info about all other players include himself player_info_t players[MAX_CLIENTS]; // collected info about all other players include himself
@ -917,7 +917,6 @@ qboolean CL_IsPredicted( void );
int CL_TruePointContents( const vec3_t p ); int CL_TruePointContents( const vec3_t p );
int CL_WaterEntity( const float *rgflPos ); int CL_WaterEntity( const float *rgflPos );
cl_entity_t *CL_GetWaterEntity( const float *rgflPos ); cl_entity_t *CL_GetWaterEntity( const float *rgflPos );
void CL_SetupPMove( playermove_t *pmove, local_state_t *from, usercmd_t *ucmd, qboolean runfuncs, double time );
int CL_TestLine( const vec3_t start, const vec3_t end, int flags ); int CL_TestLine( const vec3_t start, const vec3_t end, int flags );
pmtrace_t *CL_VisTraceLine( vec3_t start, vec3_t end, int flags ); pmtrace_t *CL_VisTraceLine( vec3_t start, vec3_t end, int flags );
pmtrace_t CL_TraceLine( vec3_t start, vec3_t end, int flags ); pmtrace_t CL_TraceLine( vec3_t start, vec3_t end, int flags );

Loading…
Cancel
Save