================
*/
char hosterrorstring[4096];
-extern qboolean hostloopactive;
void Host_Error (char *error, ...)
{
va_list argptr;
*/
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);
return false;
}
- host_realframetime = host_frametime = realtime - oldrealtime; // LordHavoc: copy into host_realframetime as well
+ // LordHavoc: copy into host_realframetime as well
+ host_realframetime = host_frametime = realtime - oldrealtime;
oldrealtime = realtime;
if (cls.timedemo)
- return true; // disable time effects
+ {
+ // disable time effects
+ cl.frametime = host_frametime;
+ return true;
+ }
if (host_framerate.value > 0)
host_frametime = host_framerate.value;
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;
}
// 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;
/*
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 ();