From db02af84840247f865209d7d628f2d4a44d01827 Mon Sep 17 00:00:00 2001 From: vortex Date: Wed, 14 Apr 2010 15:04:28 +0000 Subject: [PATCH] DP_CSQC_SETPAUSE (clientside pause that only works in local games, similar to pause set when console is active or main menu is popped up), does not stop sounds git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10080 d7cf8633-e32d-0410-b094-e92efae38249 --- client.h | 1 + clvm_cmds.c | 12 +++++++++++- host.c | 4 ++-- svvm_cmds.c | 2 ++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/client.h b/client.h index 3c4ce0a6..f9485cc0 100644 --- a/client.h +++ b/client.h @@ -943,6 +943,7 @@ typedef struct client_state_s 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 diff --git a/clvm_cmds.c b/clvm_cmds.c index e7764629..07e6a13f 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -1147,6 +1147,16 @@ static void VM_CL_pointparticles (void) CL_ParticleEffect(i, n, f, f, v, v, NULL, prog->argc >= 5 ? (int)PRVM_G_FLOAT(OFS_PARM4) : 0); } +//#531 void(float pause) setpause +static void VM_CL_setpause(void) +{ + VM_SAFEPARMCOUNT(1, VM_CL_setpause); + if ((int)PRVM_G_FLOAT(OFS_PARM0) != 0) + cl.csqc_paused = true; + else + cl.csqc_paused = false; +} + //#342 string(float keynum) getkeybind (EXT_CSQC) static void VM_CL_getkeybind (void) { @@ -4380,7 +4390,7 @@ VM_CL_SpawnParticle, // #527 float(vector org, vector vel, [float theme]) part VM_CL_SpawnParticleDelayed, // #528 float(vector org, vector vel, float delay, float collisiondelay, [float theme]) delayedparticle (DP_CSQC_SPAWNPARTICLE) VM_loadfromdata, // #529 VM_loadfromfile, // #530 -NULL, // #531 +VM_CL_setpause, // #531 float(float ispaused) setpause = #531 (DP_CSQC_SETPAUSE) VM_log, // #532 NULL, // #533 NULL, // #534 diff --git a/host.c b/host.c index 2865afd0..c9355237 100644 --- a/host.c +++ b/host.c @@ -809,7 +809,7 @@ void Host_Main(void) sv.frametime = advancetime * slowmo.value; if (host_framerate.value) sv.frametime = host_framerate.value; - if (sv.paused || (cl.islocalgame && (key_dest != key_game || key_consoleactive))) + if (sv.paused || (cl.islocalgame && (key_dest != key_game || key_consoleactive || cl.csqc_paused))) sv.frametime = 0; // setup the VM frame @@ -900,7 +900,7 @@ void Host_Main(void) if (host_framerate.value) clframetime = host_framerate.value; - if (cl.paused || (cl.islocalgame && (key_dest != key_game || key_consoleactive))) + if (cl.paused || (cl.islocalgame && (key_dest != key_game || key_consoleactive || cl.csqc_paused))) clframetime = 0; if (cls.timedemo) diff --git a/svvm_cmds.c b/svvm_cmds.c index 4caefa3a..13d56f5f 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -23,6 +23,8 @@ char *vm_sv_extensions = "DP_CSQC_ENTITYTRANSPARENTSORTING_OFFSET " "DP_CSQC_MULTIFRAME_INTERPOLATION " "DP_CSQC_SPAWNPARTICLE " +"DP_CSQC_QUERYRENDERENTITY " +"DP_CSQC_SETPAUSE " "DP_EF_ADDITIVE " "DP_EF_BLUE " "DP_EF_DOUBLESIDED " -- 2.39.2