]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
added svc_trailparticles and svc_pointparticles, these are written by the trailpartic...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 18 Feb 2007 12:57:43 +0000 (12:57 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 18 Feb 2007 12:57:43 +0000 (12:57 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6855 d7cf8633-e32d-0410-b094-e92efae38249

cl_parse.c
protocol.h
svvm_cmds.c

index ef9805b25bc9a020b6b08e8cd0dcfad125790af8..b33fd7e71b7fb84fc44b0bdf114670cc829f5973 100644 (file)
@@ -2367,6 +2367,33 @@ void CL_ParseTempEntity(void)
        }
 }
 
+void CL_ParseTrailParticles(void)
+{
+       int entityindex;
+       int effectindex;
+       vec3_t start, end;
+       entityindex = (unsigned short)MSG_ReadShort();
+       if (entityindex >= MAX_EDICTS)
+               entityindex = 0;
+       if (entityindex >= cl.max_entities)
+               CL_ExpandEntities(entityindex);
+       effectindex = (unsigned short)MSG_ReadShort();
+       MSG_ReadVector(start, cls.protocol);
+       MSG_ReadVector(end, cls.protocol);
+       CL_ParticleEffect(effectindex, VectorDistance(start, end), start, end, vec3_origin, vec3_origin, entityindex > 0 ? cl.entities + entityindex : NULL, 0);
+}
+
+void CL_ParsePointParticles(void)
+{
+       int effectindex, count;
+       vec3_t origin, velocity;
+       effectindex = (unsigned short)MSG_ReadShort();
+       MSG_ReadVector(origin, cls.protocol);
+       MSG_ReadVector(velocity, cls.protocol);
+       count = (unsigned short)MSG_ReadShort();
+       CL_ParticleEffect(effectindex, count, origin, origin, velocity, velocity, NULL, 0);
+}
+
 // look for anything interesting like player IP addresses or ping reports
 qboolean CL_ExaminePrintString(const char *text)
 {
@@ -3313,6 +3340,12 @@ void CL_ParseServerMessage(void)
                        case svc_downloaddata:
                                CL_ParseDownload();
                                break;
+                       case svc_trailparticles:
+                               CL_ParseTrailParticles();
+                               break;
+                       case svc_pointparticles:
+                               CL_ParsePointParticles();
+                               break;
                        }
                }
        }
index 350bdb60bfc3d40224e6c5ca7bc716a810ad93b4..00f25a8946cb8537698441b45563ae200b198898 100644 (file)
@@ -224,7 +224,7 @@ void Protocol_Names(char *buffer, size_t buffersize);
 #define        svc_hidelmp                     36              // [string] slotname
 #define        svc_skybox                      37              // [string] skyname
 
-// LordHavoc: my svc_ range, 50-59
+// LordHavoc: my svc_ range, 50-69
 #define svc_downloaddata       50              // [int] start [short] size
 #define svc_updatestatubyte    51              // [byte] stat [byte] value
 #define svc_effect                     52              // [vector] org [byte] modelindex [byte] startframe [byte] framecount [byte] framerate
@@ -236,6 +236,8 @@ void Protocol_Names(char *buffer, size_t buffersize);
 #define svc_entities           57              // [int] deltaframe [int] thisframe [float vector] eye [variable length] entitydata
 #define svc_csqcentities       58              // [short] entnum [variable length] entitydata ... [short] 0x0000
 #define        svc_spawnstaticsound2   59      // [coord3] [short] samp [byte] vol [byte] aten
+#define svc_trailparticles     60              // [short] entnum [short] effectnum [vector] start [vector] end
+#define svc_pointparticles     61              // [short] effectnum [vector] start [vector] end [short] count
 
 //
 // client to server
index e58daf81dd99d3cbaf42a050c9b80d602934fbd4..74634725f688cc1a731e0c102e4b8cc80e1b5649 100644 (file)
@@ -8,19 +8,19 @@ cvar_t sv_aim = {CVAR_SAVE, "sv_aim", "2", "maximum cosine angle for quake's ver
 
 char *vm_sv_extensions =
 "BX_WAL_SUPPORT "
-"DP_CON_EXPANDCVAR "
-"DP_CON_ALIASPARAMETERS "
 "DP_BUTTONCHAT "
 "DP_BUTTONUSE "
 "DP_CL_LOADSKY "
+"DP_CON_ALIASPARAMETERS "
+"DP_CON_EXPANDCVAR "
 "DP_CON_SET "
 "DP_CON_SETA "
 "DP_CON_STARTMAP "
 "DP_EF_ADDITIVE "
 "DP_EF_BLUE "
+"DP_EF_DOUBLESIDED "
 "DP_EF_FLAME "
 "DP_EF_FULLBRIGHT "
-"DP_EF_DOUBLESIDED "
 "DP_EF_NODEPTHTEST "
 "DP_EF_NODRAW "
 "DP_EF_NOSHADOW "
@@ -59,7 +59,7 @@ char *vm_sv_extensions =
 "DP_QC_FINDCHAINFLOAT "
 "DP_QC_FINDFLAGS "
 "DP_QC_FINDFLOAT "
-"DP_QC_FS_SEARCH " // Black: same as in the menu qc
+"DP_QC_FS_SEARCH "
 "DP_QC_GETLIGHT "
 "DP_QC_GETSURFACE "
 "DP_QC_GETTAGINFO "
@@ -70,11 +70,11 @@ char *vm_sv_extensions =
 "DP_QC_STRFTIME "
 "DP_QC_STRINGBUFFERS "
 "DP_QC_STRINGCOLORFUNCTIONS "
-"DP_QC_UNLIMITEDTEMPSTRINGS "
 "DP_QC_TRACEBOX "
 "DP_QC_TRACETOSS "
 "DP_QC_TRACE_MOVETYPE_HITMODEL "
 "DP_QC_TRACE_MOVETYPE_WORLDONLY "
+"DP_QC_UNLIMITEDTEMPSTRINGS "
 "DP_QC_VECTORVECTORS "
 "DP_QUAKE2_MODEL "
 "DP_QUAKE2_SPRITE "
@@ -126,11 +126,11 @@ char *vm_sv_extensions =
 "KRIMZON_SV_PARSECLIENTCOMMAND "
 "NEH_CMD_PLAY2 "
 "NEH_RESTOREGAME "
+"NEXUIZ_PLAYERMODEL "
 "NXQ_GFX_LETTERBOX "
 "PRYDON_CLIENTCURSOR "
 "TENEBRAE_GFX_DLIGHTS "
 "TW_SV_STEPCONTROL "
-"NEXUIZ_PLAYERMODEL "
 ;
 
 /*
@@ -2517,6 +2517,30 @@ void PF_edict_num (void)
        VM_RETURN_EDICT(PRVM_EDICT_NUM((int)PRVM_G_FLOAT(OFS_PARM0)));
 }
 
+// #336 void(entity ent, float effectnum, vector start, vector end) trailparticles (EXT_CSQC)
+static void VM_SV_trailparticles (void)
+{
+       VM_SAFEPARMCOUNT(4, VM_SV_trailparticles);
+
+       MSG_WriteByte(&sv.datagram, svc_trailparticles);
+       MSG_WriteShort(&sv.datagram, PRVM_G_EDICTNUM(OFS_PARM0));
+       MSG_WriteShort(&sv.datagram, (int)PRVM_G_FLOAT(OFS_PARM1));
+       MSG_WriteVector(&sv.datagram, PRVM_G_VECTOR(OFS_PARM2), sv.protocol);
+       MSG_WriteVector(&sv.datagram, PRVM_G_VECTOR(OFS_PARM3), sv.protocol);
+}
+
+//#337 void(float effectnum, vector origin, vector dir, float count) pointparticles (EXT_CSQC)
+static void VM_SV_pointparticles (void)
+{
+       VM_SAFEPARMCOUNT(4, VM_SV_pointparticles);
+
+       MSG_WriteByte(&sv.datagram, svc_pointparticles);
+       MSG_WriteShort(&sv.datagram, (int)PRVM_G_FLOAT(OFS_PARM0));
+       MSG_WriteVector(&sv.datagram, PRVM_G_VECTOR(OFS_PARM1), sv.protocol);
+       MSG_WriteVector(&sv.datagram, PRVM_G_VECTOR(OFS_PARM2), sv.protocol);
+       MSG_WriteShort(&sv.datagram, bound(0, (int)PRVM_G_FLOAT(OFS_PARM3), 65535));
+}
+
 prvm_builtin_t vm_sv_builtins[] = {
 NULL,                                          // #0
 PF_makevectors,                                // #1 void(vector ang) makevectors
@@ -2677,8 +2701,8 @@ NULL,                                             // #332
 NULL,                                          // #333
 NULL,                                          // #334
 NULL,                                          // #335
-NULL,                                          // #336
-NULL,                                          // #337
+VM_SV_trailparticles,          // #336 void(entity ent, float effectnum, vector start, vector end) trailparticles (EXT_CSQC)
+VM_SV_pointparticles,          // #337 void(float effectnum, vector origin [, vector dir, float count]) pointparticles (EXT_CSQC)
 NULL,                                          // #338
 VM_print,                                      // #339 void(string, ...) print (DP_SV_PRINT)
 e10,                                           // #340-349