DP_CSQC_SETPAUSE (clientside pause that only works in local games, similar to pause...
authorvortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 14 Apr 2010 15:04:28 +0000 (15:04 +0000)
committervortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 14 Apr 2010 15:04:28 +0000 (15:04 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10080 d7cf8633-e32d-0410-b094-e92efae38249

client.h
clvm_cmds.c
host.c
svvm_cmds.c

index 3c4ce0a..f9485cc 100644 (file)
--- 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
index e776462..07e6a13 100644 (file)
@@ -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 2865afd..c935523 100644 (file)
--- 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)
index 4caefa3..13d56f5 100644 (file)
@@ -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 "