double host_frametime;
double host_realframetime; // LordHavoc: the real frametime, before slowmo and clamping are applied (used for console scrolling)
-double host_time;
double realtime; // without any filtering or bounding
double oldrealtime; // last frame run
int host_framecount;
================
*/
char hosterrorstring[4096];
-extern qboolean hostloopactive;
void Host_Error (char *error, ...)
{
va_list argptr;
}
inerror = true;
- SCR_EndLoadingPlaque (); // reenable screen updates
+// SCR_EndLoadingPlaque (); // reenable screen updates
va_start (argptr,error);
vsprintf (hosterrorstring,error,argptr);
Cvar_RegisterVariable (&timeformat);
Host_FindMaxClients ();
-
- host_time = 1.0; // so a think at time 0 won't get called
}
*/
void Host_WriteConfiguration (void)
{
- FILE *f;
+ QFile *f;
// dedicated servers initialize the host but don't parse and set the
// config.cfg cvars
if (host_initialized & !isDedicated)
{
- f = fopen (va("%s/config.cfg",com_gamedir), "w");
+ f = Qopen (va("%s/config.cfg",com_gamedir), "w");
if (!f)
{
Con_Printf ("Couldn't write config.cfg.\n");
Key_WriteBindings (f);
Cvar_WriteVariables (f);
- fclose (f);
+ Qclose (f);
}
}
CL_Disconnect ();
// flush any pending messages - like the score!!!
- start = Sys_FloatTime();
+ start = Sys_DoubleTime();
do
{
count = 0;
}
}
}
- if ((Sys_FloatTime() - start) > 3.0)
+ if ((Sys_DoubleTime() - start) > 3.0)
break;
}
while (count);
host_frametime = (1.0 / host_minfps.value);
}
- host_frametime *= slowmo.value;
- cl.frametime = host_frametime;
+ cl.frametime = host_frametime = bound(0, host_frametime * slowmo.value, 0.1f); // LordHavoc: the QC code relies on no less than 10fps
return true;
}
if (!sv.active)
CL_SendCmd ();
- host_time += host_frametime;
-
// fetch results from server
if (cls.state == ca_connected)
CL_ReadFromServer ();
// update video
if (host_speeds.value)
- time1 = Sys_FloatTime ();
+ time1 = Sys_DoubleTime ();
SCR_UpdateScreen ();
if (host_speeds.value)
- time2 = Sys_FloatTime ();
+ time2 = Sys_DoubleTime ();
// update audio
if (cls.signon == SIGNONS)
if (host_speeds.value)
{
pass1 = (time1 - time3)*1000000;
- time3 = Sys_FloatTime ();
+ time3 = Sys_DoubleTime ();
pass2 = (time2 - time1)*1000000;
pass3 = (time3 - time2)*1000000;
Con_Printf ("%6ius total %6ius server %6ius gfx %6ius snd\n",
return;
}
- time1 = Sys_FloatTime ();
+ time1 = Sys_DoubleTime ();
_Host_Frame (time);
- time2 = Sys_FloatTime ();
+ time2 = Sys_DoubleTime ();
timetotal += time2 - time1;
timecount++;
//============================================================================
-void Render_Init();
+void Render_Init(void);
/*
====================
Host_Init
====================
*/
-void Host_Init ()
+void Host_Init (void)
{
int i;
/*
Con_Printf ("Exe: "__TIME__" "__DATE__"\n");
Con_Printf ("%4.1f megabyte heap\n",host_parms.memsize/(1024*1024.0));
- R_InitTextures (); // needed even for dedicated servers
-
if (cls.state != ca_dedicated)
{
- Palette_Init("gfx/palette.lmp");
+ VID_InitCvars();
+
+ Gamma_Init();
+
+ Palette_Init();
#ifndef _WIN32 // on non win32, mouse comes before video for security reasons
IN_Init ();