This removes some client/server-only code in the client/server frames.
This also cleans up the cl struct a bit by only having one source of
knowing if we should pause for both CSQC and opening the console or menu
These changes will help eventually move the client and server frame code
to their own functions (CL_Frame and SV_Frame respectively).
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12800
d7cf8633-e32d-0410-b094-
e92efae38249
if ((key_dest == key_game || key_dest == key_message) && !r_letterbox.value && !scr_loading)
Con_DrawNotify (); // only draw notify in game
+ if(cl.islocalgame)
+ {
+ if (key_dest != key_game || key_consoleactive)
+ host.paused = true;
+ else
+ host.paused = false;
+ }
+
if (cls.signon == SIGNONS)
{
SCR_DrawNet ();
float sensitivityscale;
csqc_vidvars_t csqc_vidvars; //[515]: these parms must be set to true by default
qboolean csqc_wantsmousemove;
- qboolean csqc_paused; // vortex: int because could be flags
struct model_s *csqc_model_precache[MAX_MODELS];
// local amount for smoothing stepups
static void VM_CL_setpause(prvm_prog_t *prog)
{
VM_SAFEPARMCOUNT(1, VM_CL_setpause);
- if ((int)PRVM_G_FLOAT(OFS_PARM0) != 0)
- cl.csqc_paused = true;
- else
- cl.csqc_paused = false;
+ if(cl.islocalgame)
+ {
+ if ((int)PRVM_G_FLOAT(OFS_PARM0) != 0)
+ host.paused = true;
+ else
+ host.paused = false;
+ }
}
//#343 void(float usecursor) setcursormode (DP_CSQC)
sv.frametime = advancetime * host_timescale.value;
if (host_framerate.value)
sv.frametime = host_framerate.value;
- if (sv.paused || (cl.islocalgame && (key_dest != key_game || key_consoleactive || cl.csqc_paused)))
+ if (sv.paused || host.paused)
sv.frametime = 0;
for (framecount = 0;framecount < framelimit && sv_timer > 0;framecount++)
if (host_framerate.value)
clframetime = host_framerate.value;
- if (cl.paused || (cl.islocalgame && (key_dest != key_game || key_consoleactive || cl.csqc_paused)))
+ if (cl.paused || host.paused)
clframetime = 0;
}
double realtime; // the accumulated mainloop time since application started (with filtering), without any slowmo or clamping
double dirtytime; // the main loop wall time for this frame, equal to Sys_DirtyTime() at the start of this host frame
qboolean restless; // don't sleep
+ qboolean paused; // global paused state, pauses both client and server
} host_t;
extern host_t host;
sv.frametime = advancetime * host_timescale.value;
if (host_framerate.value)
sv.frametime = host_framerate.value;
- if (sv.paused || (cl.islocalgame && (key_dest != key_game || key_consoleactive || cl.csqc_paused)))
+ if (sv.paused || host.paused)
sv.frametime = 0;
sv_timer -= advancetime;