]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host.c
sys_usetimegettime is now initialized at a place where it shouldn't crash anymore...
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index 94947a92457683f5af9bbbcafc13e55c4b224b2d..5d570becb6c0d0231bcef2af9ae83a7354405a44 100644 (file)
--- a/host.c
+++ b/host.c
@@ -19,8 +19,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 // host.c -- coordinates spawning and killing of local servers
 
-#include "quakedef.h"
 #include <time.h>
+#include "quakedef.h"
+#include "cl_video.h"
 
 /*
 
@@ -143,8 +144,6 @@ void Host_Error (char *error, ...)
        }
        inerror = true;
        
-       SCR_EndLoadingPlaque ();                // reenable screen updates
-
        va_start (argptr,error);
        vsprintf (hosterrorstring,error,argptr);
        va_end (argptr);
@@ -202,8 +201,8 @@ void        Host_FindMaxClients (void)
                        svs.maxclients = 8;
        }
 
-       // BloodBath doesn't support single player games
-       if (gamemode == GAME_BLOODBATH && svs.maxclients < 4)
+       // Transfusion doesn't support single player games
+       if (gamemode == GAME_TRANSFUSION && svs.maxclients < 4)
                svs.maxclients = 4;
 
        if (svs.maxclients < 1)
@@ -359,7 +358,7 @@ void Host_ClientCommands (char *fmt, ...)
        va_start (argptr,fmt);
        vsprintf (string, fmt,argptr);
        va_end (argptr);
-       
+
        MSG_WriteByte (&host_client->message, svc_stufftext);
        MSG_WriteString (&host_client->message, string);
 }
@@ -537,7 +536,7 @@ qboolean Host_FilterTime (double time)
                Cvar_SetValue("host_minfps", 10.0f);
        if (host_maxfps.value < host_minfps.value)
                Cvar_SetValue("host_maxfps", host_minfps.value);
-       if (cl_avidemo.value < 0.1f)
+       if (cl_avidemo.value < 0.1f && cl_avidemo.value != 0.0f)
                Cvar_SetValue("cl_avidemo", 0.0f);
 
        // check if framerate is too high
@@ -549,8 +548,9 @@ qboolean Host_FilterTime (double time)
        }
        else if (!cls.timedemo)
        {
+               // default to sys_ticrate (server framerate - presumably low) unless we're the active window and either connected to a server or playing a video
                timecap = sys_ticrate.value;
-               if (cls.state == ca_connected)
+               if (vid_activewindow && (cls.state == ca_connected || cl_videoplaying))
                        timecap = 1.0 / host_maxfps.value;
 
                if ((realtime - oldrealtime) < timecap)
@@ -571,11 +571,7 @@ qboolean Host_FilterTime (double time)
        if (host_framerate.value > 0)
                host_frametime = host_framerate.value;
        else if (cl_avidemo.value >= 0.1f)
-       {
-               // don't allow really short frames
-               //if (host_frametime > (1.0 / cl_avidemo.value))
-                       host_frametime = (1.0 / cl_avidemo.value);
-       }
+               host_frametime = (1.0 / cl_avidemo.value);
        else
        {
                // don't allow really short frames
@@ -630,7 +626,6 @@ void Host_ServerFrame (void)
                sv.frametime = 0;
        frametimetotal = 0;
        lastservertime = realtime;
-//     pr_global_struct->frametime = host_frametime;
 
 // set the time and clear the general datagram
        SV_ClearDatagram ();
@@ -723,6 +718,8 @@ void _Host_Frame (float time)
 
        ui_update();
 
+       CL_VideoFrame();
+
 // update video
        if (host_speeds.integer)
                time1 = Sys_DoubleTime ();
@@ -820,7 +817,6 @@ void Host_Init (void)
                developer.value = 1;
        }
 
-       Memory_Init ();
        Cmd_Init ();
        Memory_Init_Commands();
        R_Modules_Init();
@@ -839,7 +835,7 @@ void Host_Init (void)
        NET_Init ();
        SV_Init ();
 
-       Con_Printf ("Exe: "__TIME__" "__DATE__"\n");
+       Con_Printf ("Builddate: %s\n", buildstring);
 
        if (cls.state != ca_dedicated)
        {
@@ -891,9 +887,6 @@ void Host_Shutdown(void)
        }
        isdown = true;
 
-// keep Con_Printf from trying to update the screen
-//     scr_disabled_for_loading = true;
-
        Host_WriteConfiguration (); 
 
        CDAudio_Shutdown ();