04 Jul 2009
This commit is contained in:
parent
484f41f4a6
commit
06a8901a0b
|
@ -334,7 +334,7 @@ void CL_ParseFrame( sizebuf_t *msg )
|
|||
else cl.frame.valid = true; // valid delta parse
|
||||
}
|
||||
|
||||
cl.refdef.lerpfrac = CL_LerpPoint2 ();
|
||||
cl.refdef.lerpfrac = CL_LerpPoint ();
|
||||
|
||||
// clamp time
|
||||
cl.time = bound( cl.frame.servertime - cl.serverframetime, cl.time, cl.frame.servertime );
|
||||
|
|
|
@ -391,7 +391,7 @@ void CL_PredictMovement (void)
|
|||
if( step > 63 && step < 160 )
|
||||
{
|
||||
cl.predicted_step = step;
|
||||
cl.predicted_step_time = host.realtime - host.frametime * 500;
|
||||
cl.predicted_step_time = cls.realtime - cls.frametime * 500;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,9 @@ bool Cmd_GetMapList( const char *s, char *completedname, int length )
|
|||
|
||||
if( com.stricmp( ext, "bsp" )) continue;
|
||||
com.strncpy( message, "^1error^7", sizeof( message ));
|
||||
if( WAD_Check( t->filenames[i] ) == 1 )
|
||||
wad = WAD_Open( t->filenames[i], "rb" );
|
||||
else wad = NULL;
|
||||
|
||||
if( wad )
|
||||
{
|
||||
|
@ -75,8 +77,8 @@ bool Cmd_GetMapList( const char *s, char *completedname, int length )
|
|||
|
||||
switch( ver )
|
||||
{
|
||||
case 39: com.strncpy((char *)buf, "Xash 3D", sizeof(buf)); break;
|
||||
default: com.strncpy((char *)buf, "??", sizeof(buf)); break;
|
||||
case 39: com.strncpy( buf, "Xash 3D", sizeof( buf )); break;
|
||||
default: com.strncpy( buf, "??", sizeof( buf )); break;
|
||||
}
|
||||
Msg( "%16s (%s) ^3%s^7\n", matchbuf, buf, message );
|
||||
nummaps++;
|
||||
|
@ -135,7 +137,6 @@ bool Cmd_GetFontList( const char *s, char *completedname, int length )
|
|||
completedname[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -180,7 +181,6 @@ bool Cmd_GetDemoList( const char *s, char *completedname, int length )
|
|||
completedname[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -323,33 +323,11 @@ Returns false if the time is too short to run a frame
|
|||
*/
|
||||
bool Host_FilterTime( double time )
|
||||
{
|
||||
double timecap, timeleft;
|
||||
|
||||
host.realtime += time;
|
||||
|
||||
if( timescale->value < 0.0f )
|
||||
Cvar_SetValue( "timescale", 0.0f );
|
||||
if( host_minfps->integer < 10 )
|
||||
Cvar_SetValue( "host_minfps", 10.0f );
|
||||
if( host_maxfps->integer < host_minfps->integer )
|
||||
Cvar_SetValue( "host_maxfps", host_minfps->integer );
|
||||
if( host.realtime - host.oldrealtime < 1.0 / host_maxfps->value )
|
||||
return false; // framerate is too high
|
||||
|
||||
// check if framerate is too high
|
||||
// default to sys_ticrate (server framerate - presumably low) unless we have a good reason to run faster
|
||||
timecap = host_ticrate->value;
|
||||
if( host.state == HOST_FRAME )
|
||||
timecap = 1.0 / host_maxfps->integer;
|
||||
|
||||
timeleft = host.oldrealtime + timecap - host.realtime;
|
||||
if( timeleft > 0 )
|
||||
{
|
||||
// don't totally hog the CPU
|
||||
if( timeleft >= 0.02 )
|
||||
Sys_Sleep( 1 );
|
||||
return false;
|
||||
}
|
||||
|
||||
// LordHavoc: copy into host_realframetime as well
|
||||
host.realframetime = host.frametime = host.realtime - host.oldrealtime;
|
||||
host.oldrealtime = host.realtime;
|
||||
|
||||
|
@ -358,14 +336,12 @@ bool Host_FilterTime( double time )
|
|||
host.frametime = host_framerate->value;
|
||||
}
|
||||
else
|
||||
{
|
||||
// don't allow really short frames
|
||||
if( host.frametime > (1.0 / host_minfps->value ))
|
||||
host.frametime = (1.0 / host_minfps->value);
|
||||
{ // don't allow really long or short frames
|
||||
if( host.frametime > 0.1f )
|
||||
host.frametime = 0.1f;
|
||||
if( host.frametime < 0.001f )
|
||||
host.frametime = 0.001f;
|
||||
}
|
||||
|
||||
host.frametime = bound( 0, host.frametime * timescale->value, 0.1f );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -386,7 +362,7 @@ void Host_Frame( double time )
|
|||
return;
|
||||
|
||||
Host_EventLoop (); // process all system events
|
||||
Cbuf_Execute (); // execure commands
|
||||
Cbuf_Execute (); // execute commands
|
||||
|
||||
SV_Frame ( time ); // server frame
|
||||
CL_Frame ( time ); // client frame
|
||||
|
|
|
@ -1771,5 +1771,5 @@ void SV_Physics( void )
|
|||
// decrement svgame.globals->numEntities if the highest number entities died
|
||||
for( ; EDICT_NUM( svgame.globals->numEntities - 1)->free; svgame.globals->numEntities-- );
|
||||
|
||||
if( !sv_playersonly->integer ) sv.time += sv.frametime;
|
||||
// if( !sv_playersonly->integer ) sv.time += sv.frametime;
|
||||
}
|
|
@ -1850,7 +1850,7 @@ static void RB_DrawLine( int color, int numpoints, const float *points, const in
|
|||
VectorSet( p1, points[i*3+0], points[i*3+1], points[i*3+2] );
|
||||
if( r_physbdebug->integer == 1 ) ConvertPositionToGame( p1 );
|
||||
|
||||
pglColor4ubv( (byte *)color );
|
||||
pglColor4fv( UnpackRGBA( color ));
|
||||
pglVertex3fv( p0 );
|
||||
pglVertex3fv( p1 );
|
||||
|
||||
|
|
Reference in New Issue