]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host.c
copyentity builtin added
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index 292f5222687334b67d28db8b88ebde26929e3b29..c43533572a204ec70759ba00c9179bf98693cda4 100644 (file)
--- a/host.c
+++ b/host.c
@@ -51,7 +51,7 @@ client_t      *host_client;                   // current client
 jmp_buf        host_abortserver;
 
 byte           *host_basepal;
-byte           *host_colormap;
+//byte         *host_colormap;
 
 cvar_t host_framerate = {"host_framerate","0"};        // set for slow motion
 cvar_t host_speeds = {"host_speeds","0"};                      // set for running times
@@ -77,6 +77,8 @@ cvar_t        pausable = {"pausable","1"};
 
 cvar_t temp1 = {"temp1","0"};
 
+cvar_t timestamps = {"timestamps", "0", true};
+cvar_t timeformat = {"timeformat", "[%b %e %X] ", true};
 
 /*
 ================
@@ -227,6 +229,9 @@ void Host_InitLocal (void)
 
        Cvar_RegisterVariable (&temp1);
 
+       Cvar_RegisterVariable (&timestamps);
+       Cvar_RegisterVariable (&timeformat);
+
        Host_FindMaxClients ();
        
        host_time = 1.0;                // so a think at time 0 won't get called
@@ -487,8 +492,6 @@ void Host_ClearMemory (void)
 
 //============================================================================
 
-extern cvar_t maxfps;
-
 /*
 ===================
 Host_FilterTime
@@ -500,12 +503,8 @@ qboolean Host_FilterTime (float time)
 {
        realtime += time;
 
-       if (maxfps.value < 5) // LordHavoc: sanity checking
-               maxfps.value = 5;
-       if (maxfps.value > 1000) // LordHavoc: sanity checking
-               maxfps.value = 1000;
-       if (!cls.timedemo && realtime - oldrealtime < (1.0 / maxfps.value))
-               return false;           // framerate is too high
+//     if (!cls.timedemo && realtime - oldrealtime < (1.0 / 72.0))
+//             return false;           // framerate is too high
 
        host_frametime = (realtime - oldrealtime) * slowmo.value; // LordHavoc: slowmo cvar
        oldrealtime = realtime;
@@ -619,10 +618,17 @@ void Host_ServerFrame (void)
 
 #else
 
+double frametimetotal = 0, lastservertime = 0;
 void Host_ServerFrame (void)
 {
-// run the world state 
-       pr_global_struct->frametime = host_frametime;
+       frametimetotal += host_frametime;
+       // LordHavoc: cap server at sys_ticrate in listen games
+       if (!isDedicated && svs.maxclients > 1 && ((realtime - lastservertime) < sys_ticrate.value))
+               return;
+// run the world state
+       pr_global_struct->frametime = frametimetotal;
+       frametimetotal = 0;
+//     pr_global_struct->frametime = host_frametime;
 
 // set the time and clear the general datagram
        SV_ClearDatagram ();
@@ -900,9 +906,10 @@ void Host_Init (quakeparms_t *parms)
                host_basepal = (byte *)COM_LoadHunkFile ("gfx/palette.lmp", false);
                if (!host_basepal)
                        Sys_Error ("Couldn't load gfx/palette.lmp");
-               host_colormap = (byte *)COM_LoadHunkFile ("gfx/colormap.lmp", false);
-               if (!host_colormap)
-                       Sys_Error ("Couldn't load gfx/colormap.lmp");
+               host_basepal[765] = host_basepal[766] = host_basepal[767] = 0; // LordHavoc: force the transparent color to black
+//             host_colormap = (byte *)COM_LoadHunkFile ("gfx/colormap.lmp", false);
+//             if (!host_colormap)
+//                     Sys_Error ("Couldn't load gfx/colormap.lmp");
 
 #ifndef _WIN32 // on non win32, mouse comes before video for security reasons
                IN_Init ();
@@ -912,16 +919,7 @@ void Host_Init (quakeparms_t *parms)
                Draw_Init ();
                SCR_Init ();
                R_Init ();
-#ifndef        _WIN32
-       // on Win32, sound initialization has to come before video initialization, so we
-       // can put up a popup if the sound hardware is in use
                S_Init ();
-#else
-
-       // FIXME: doesn't use the new one-window approach yet
-               S_Init ();
-
-#endif // _WIN32
                CDAudio_Init ();
                Sbar_Init ();
                CL_Init ();