Misc fixes+cleanups.
r_loadlit 2 will now use a few more cpu cores to get the job done, if it can. Fixes the menu background shader that I broke. Shader parser accepts cvars in more places. d3d+gl now share common conwidth calcs code, fixing d3d issues. d3d supports more backend features (no more gun in walls). show_fps calcs the framerate itself, so is more accurate in regard to frame times, regardless of how much I break other stuff. Now attempts to sleep a little between frames, to reduce cpu load and electricity (important on laptops maybe). cl_netfps will now default to 100.Enabling independant physics by default. The framerate defaults to a max 500, to avoid too many issues with too small time deltas. You can still set it higher if you wish. Enable voice chat by default (sorry moodles!). git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3668 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
8e8758f053
commit
5d25e9991f
18 changed files with 447 additions and 308 deletions
|
@ -1199,7 +1199,8 @@ void SCR_StringXY(char *str, float x, float y)
|
|||
void SCR_DrawFPS (void)
|
||||
{
|
||||
extern cvar_t show_fps;
|
||||
static double lastframetime;
|
||||
static double lastupdatetime;
|
||||
static double lastsystemtime;
|
||||
double t;
|
||||
extern int fps_count;
|
||||
static float lastfps;
|
||||
|
@ -1209,16 +1210,20 @@ void SCR_DrawFPS (void)
|
|||
int sfps, frame;
|
||||
qboolean usemsecs = false;
|
||||
|
||||
float frametime;
|
||||
|
||||
if (!show_fps.ival)
|
||||
return;
|
||||
|
||||
t = Sys_DoubleTime();
|
||||
if ((t - lastframetime) >= 1.0)
|
||||
if ((t - lastupdatetime) >= 1.0)
|
||||
{
|
||||
lastfps = fps_count/(t - lastframetime);
|
||||
lastfps = fps_count/(t - lastupdatetime);
|
||||
fps_count = 0;
|
||||
lastframetime = t;
|
||||
lastupdatetime = t;
|
||||
}
|
||||
frametime = t - lastsystemtime;
|
||||
lastsystemtime = t;
|
||||
|
||||
sfps = show_fps.ival;
|
||||
if (sfps < 0)
|
||||
|
@ -1230,39 +1235,39 @@ void SCR_DrawFPS (void)
|
|||
switch (sfps)
|
||||
{
|
||||
case 2: // lowest FPS, highest MS encountered
|
||||
if (lastfps > 1/host_frametime)
|
||||
if (lastfps > 1/frametime)
|
||||
{
|
||||
lastfps = 1/host_frametime;
|
||||
lastfps = 1/frametime;
|
||||
fps_count = 0;
|
||||
lastframetime = t;
|
||||
lastupdatetime = t;
|
||||
}
|
||||
break;
|
||||
case 3: // highest FPS, lowest MS encountered
|
||||
if (lastfps < 1/host_frametime)
|
||||
if (lastfps < 1/frametime)
|
||||
{
|
||||
lastfps = 1/host_frametime;
|
||||
lastfps = 1/frametime;
|
||||
fps_count = 0;
|
||||
lastframetime = t;
|
||||
lastupdatetime = t;
|
||||
}
|
||||
break;
|
||||
case 4: // immediate FPS/MS
|
||||
lastfps = 1/host_frametime;
|
||||
lastframetime = t;
|
||||
lastfps = 1/frametime;
|
||||
lastupdatetime = t;
|
||||
break;
|
||||
#ifdef GLQUAKE
|
||||
case 5:
|
||||
if (qrenderer == QR_OPENGL)
|
||||
GLR_FrameTimeGraph((int)(1000.0*2*host_frametime));
|
||||
GLR_FrameTimeGraph((int)(1000.0*2*frametime));
|
||||
break;
|
||||
case 7:
|
||||
if (qrenderer == QR_OPENGL)
|
||||
GLR_FrameTimeGraph((int)(1000.0*1*host_frametime));
|
||||
GLR_FrameTimeGraph((int)(1000.0*1*frametime));
|
||||
break;
|
||||
#endif
|
||||
case 6:
|
||||
{
|
||||
float mean, deviation;
|
||||
deviationtimes[deviationframe++&63] = host_frametime*1000;
|
||||
deviationtimes[deviationframe++&63] = frametime*1000;
|
||||
mean = 0;
|
||||
for (frame = 0; frame < 64; frame++)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue