Another step towards QSG2 compliance.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2002-07-25 14:43:36 +00:00
parent 3c7d65a798
commit 587de27849
11 changed files with 255 additions and 210 deletions

View file

@ -36,30 +36,22 @@
#include "QF/zone.h"
/*
d*_t structures are on-disk representations
m*_t structures are in-memory
d*_t structures are on-disk representations
m*_t structures are in-memory
*/
// entity effects
// entity effects =============================================================
#define EF_BRIGHTFIELD 1
#define EF_MUZZLEFLASH 2
#define EF_BRIGHTLIGHT 4
#define EF_DIMLIGHT 8
#define EF_FLAG1 16
#define EF_FLAG2 32
#define EF_BLUE 64
#define EF_RED 128
#define EF_BRIGHTFIELD 1
#define EF_MUZZLEFLASH 2
#define EF_BRIGHTLIGHT 4
#define EF_DIMLIGHT 8
#define EF_FLAG1 16
#define EF_FLAG2 32
#define EF_BLUE 64
#define EF_RED 128
/*
==============================================================================
BRUSH MODELS
==============================================================================
*/
// BRUSH MODELS ===============================================================
typedef struct efrag_s
{
@ -70,9 +62,8 @@ typedef struct efrag_s
} efrag_t;
//
// in memory representation
//
// in memory representation ===================================================
// !!! if this is changed, it must be changed in asm_draw.h too !!!
typedef struct
{
@ -221,13 +212,7 @@ typedef struct hull_s
vec3_t clip_maxs;
} hull_t;
/*
==============================================================================
SPRITE MODELS
==============================================================================
*/
// SPRITE MODELS ==============================================================
// FIXME: shorten these?
typedef struct mspriteframe_s
@ -264,14 +249,8 @@ typedef struct
} msprite_t;
/*
==============================================================================
ALIAS MODELS
Alias models are position independent, so the cache manager can move them.
==============================================================================
*/
// ALIAS MODELS ===============================================================
// Alias models are position independent, so the cache manager can move them.
/* NOTE: the first three lines must match maliasgroupframedesc_t */
typedef struct
@ -349,22 +328,19 @@ extern trivertx_t *poseverts[MAXALIASFRAMES];
extern int aliasbboxmins[3];
extern int aliasbboxmaxs[3];
//===================================================================
//
// Whole model
//
// Whole model =======================================================
typedef enum {mod_brush, mod_sprite, mod_alias} modtype_t;
#define EF_ROCKET 1 // leave a trail
#define EF_GRENADE 2 // leave a trail
#define EF_GIB 4 // leave a trail
#define EF_ROTATE 8 // rotate (bonus items)
#define EF_TRACER 16 // green split trail
#define EF_ZOMGIB 32 // small blood trail
#define EF_TRACER2 64 // orange split trail + rotate
#define EF_TRACER3 128 // purple trail
#define EF_ROCKET 1 // leave a trail
#define EF_GRENADE 2 // leave a trail
#define EF_GIB 4 // leave a trail
#define EF_ROTATE 8 // rotate (bonus items)
#define EF_TRACER 16 // green split trail
#define EF_ZOMGIB 32 // small blood trail
#define EF_TRACER2 64 // orange split trail + rotate
#define EF_TRACER3 128 // purple trail
#define EF_GLOWTRAIL 4096 // glowcolor particle trail
typedef struct model_s
{
@ -444,7 +420,7 @@ typedef struct model_s
} model_t;
//============================================================================
// ============================================================================
void Mod_Init (void);
void Mod_Init_Cvars (void);
@ -463,7 +439,6 @@ void Mod_LoadLighting (lump_t *l);
int Mod_CalcFullbright (byte *in, byte *out, int pixels);
int Mod_Fullbright (byte * skin, int width, int height, char *name);
void *Mod_LoadAliasFrame (void *pin, int *posenum, maliasframedesc_t *frame,
int extra);
void *Mod_LoadAliasGroup (void *pin, int *posenum, maliasframedesc_t *frame,
@ -476,14 +451,12 @@ void Mod_FinalizeAliasModel (model_t *m, aliashdr_t *hdr);
void Mod_SpriteLoadTexture (mspriteframe_t *pspriteframe, int framenum);
extern struct cvar_s *gl_mesh_cache;
extern struct cvar_s *gl_subdivide_size;
extern model_t *loadmodel;
extern char loadname[32];
extern byte *mod_base;
extern byte mod_novis[MAX_MAP_LEAFS / 8];
extern int mod_lightmap_bytes;
#endif // _MODEL_H

View file

@ -51,6 +51,7 @@ extern void (*R_SlightBloodTrail) (struct entity_s *ent);
extern void (*R_WizTrail) (struct entity_s *ent);
extern void (*R_FlameTrail) (struct entity_s *ent);
extern void (*R_VoorTrail) (struct entity_s *ent);
extern void (*R_GlowTrail) (struct entity_s *ent);
extern void (*R_RunParticleEffect) (const vec3_t org, const vec3_t dir,
int color, int count);

View file

@ -449,12 +449,13 @@ R_TeleportSplash_QF (const vec3_t org)
// l = r_maxparticles - numparticles;
// }
for (i = -16; i < 16; i += 4) {
dir[1] = i * 8;
for (j = -16; j < 16; j += 4) {
dir[0] = j * 8;
for (k = -24; k < 32; k += 4) {
dir[2] = k * 8;
for (k = -24; k < 32; k += 4) {
dir[2] = k * 8;
for (i = -16; i < 16; i += 4) {
dir[1] = i * 8;
for (j = -16; j < 16; j += 4) {
dir[0] = j * 8;
VectorCopy (dir, pdir);
VectorNormalize (pdir);
@ -729,6 +730,36 @@ R_VoorTrail_QF (entity_t *ent)
}
}
void
R_GlowTrail_QF (entity_t *ent)
{
float maxlen;
float dist = 3.0, len = 0.0;
int rnd;
vec3_t org, subtract, vec;
if (numparticles >= r_maxparticles)
return;
VectorSubtract (ent->origin, ent->old_origin, vec);
maxlen = VectorNormalize (vec);
VectorScale (vec, (maxlen - dist), subtract);
while (len < maxlen) {
rnd = rand ();
org[0] = ent->old_origin[0] + ((rnd >> 12) & 7) * (5.0/7.0) - 2.5;
org[1] = ent->old_origin[1] + ((rnd >> 9) & 7) * (5.0/7.0) - 2.5;
org[2] = ent->old_origin[2] + ((rnd >> 6) & 7) * (5.0/7.0) - 2.5;
// particle_new (pt_smoke, part_tex_dot, org, 1.0, vec3_origin,
// FIXME: DESPAIR r_realtime + 2.0, ent->glowcolor, 1.0, 0.0);
if (numparticles >= r_maxparticles)
break;
len += dist;
VectorAdd (ent->old_origin, subtract, ent->old_origin);
}
}
void
R_ParticleExplosion_EE (const vec3_t org)
{
@ -756,12 +787,12 @@ R_TeleportSplash_EE (const vec3_t org)
// l = r_maxparticles - numparticles;
// }
for (i = -16; i < 16; i += 4) {
dir[1] = i * 8;
for (j = -16; j < 16; j += 4) {
dir[0] = j * 8;
for (k = -24; k < 32; k += 4) {
dir[2] = k * 8;
for (k = -24; k < 32; k += 4) {
dir[2] = k * 8;
for (i = -16; i < 16; i += 4) {
dir[1] = i * 8;
for (j = -16; j < 16; j += 4) {
dir[0] = j * 8;
rnd = rand ();
porg[0] = org[0] + i + (rnd & 3);
@ -1016,12 +1047,13 @@ R_TeleportSplash_ID (const vec3_t org)
// l = r_maxparticles - numparticles;
// }
for (i = -16; i < 16; i += 4) {
dir[1] = i * 8;
for (j = -16; j < 16; j += 4) {
dir[0] = j * 8;
for (k = -24; k < 32; k += 4) {
dir[2] = k * 8;
for (k = -24; k < 32; k += 4) {
dir[2] = k * 8;
for (i = -16; i < 16; i += 4) {
dir[1] = i * 8;
for (j = -16; j < 16; j += 4) {
dir[0] = j * 8;
VectorCopy (dir, pdir);
VectorNormalize (pdir);
@ -1537,6 +1569,7 @@ r_particles_style_f (cvar_t *var)
R_WizTrail = R_WizTrail_QF;
R_FlameTrail = R_FlameTrail_QF;
R_VoorTrail = R_VoorTrail_QF;
R_GlowTrail = R_GlowTrail_QF;
} else {
R_BlobExplosion = R_BlobExplosion_ID;
R_ParticleExplosion = R_ParticleExplosion_ID;
@ -1561,6 +1594,7 @@ r_particles_style_f (cvar_t *var)
R_WizTrail = R_WizTrail_ID;
R_FlameTrail = R_FlameTrail_ID;
R_VoorTrail = R_VoorTrail_ID;
R_GlowTrail = R_GlowTrail_QF;
}
}
}

View file

@ -51,6 +51,7 @@ void (*R_SlightBloodTrail) (struct entity_s *ent);
void (*R_WizTrail) (struct entity_s *ent);
void (*R_FlameTrail) (struct entity_s *ent);
void (*R_VoorTrail) (struct entity_s *ent);
void (*R_GlowTrail) (struct entity_s *ent);
void (*R_RunParticleEffect) (vec3_t org, vec3_t dir, int color, int count);
void (*R_BloodPuffEffect) (vec3_t org, int count);
void (*R_GunshotEffect) (vec3_t org, int count);

View file

@ -34,24 +34,47 @@
#define PROTOCOL_VERSION 15
// if the high bit of the servercmd is set, the low bits are fast update flags:
#define U_MOREBITS (1<<0)
#define U_ORIGIN1 (1<<1)
#define U_ORIGIN2 (1<<2)
#define U_ORIGIN3 (1<<3)
#define U_ANGLE2 (1<<4)
#define U_NOLERP (1<<5) // don't interpolate movement
#define U_FRAME (1<<6)
#define U_SIGNAL (1<<7) // just differentiates from other updates
#define U_MOREBITS (1<<0)
#define U_ORIGIN1 (1<<1)
#define U_ORIGIN2 (1<<2)
#define U_ORIGIN3 (1<<3)
#define U_ANGLE2 (1<<4)
#define U_NOLERP (1<<5) // don't interpolate movement
#define U_FRAME (1<<6)
#define U_SIGNAL (1<<7) // just differentiates from other updates
// svc_update can pass all of the fast update bits, plus more
#define U_ANGLE1 (1<<8)
#define U_ANGLE3 (1<<9)
#define U_MODEL (1<<10)
#define U_COLORMAP (1<<11)
#define U_SKIN (1<<12)
#define U_EFFECTS (1<<13)
#define U_ANGLE1 (1<<8)
#define U_ANGLE3 (1<<9)
#define U_MODEL (1<<10)
#define U_COLORMAP (1<<11)
#define U_SKIN (1<<12)
#define U_EFFECTS (1<<13)
#define U_LONGENTITY (1<<14)
// QSG Protocol Extensions (Version 2) ========================================
// Network definitions for the engine
#define U_EXTEND1 (1<<15)
#define U_DELTA (1<<16) // no data, while this is set the entity is delta compressed (uses previous frame as a baseline, meaning only things that have changed from the previous frame are sent, except for the forced full update every half second)
#define U_ALPHA (1<<17) // 1 byte, 0.0-1.0 = 0-255 (Unsent if 1)
#define U_SCALE (1<<18) // 1 byte, scale / 16 positive, (Unsent if 1)
#define U_EFFECTS2 (1<<19) // 1 byte, .effects & 0xFF00
#define U_GLOWSIZE (1<<20) // 1 byte, float/8.0, signed. Unsent if 1
#define U_GLOWCOLOR (1<<21) // 1 byte, palette index, default, 254.
#define U_COLORMOD (1<<22) // 1 byte, rrrgggbb. Model tinting
#define U_EXTEND2 (1<<23) // Another byte to follow
#define U_GLOWTRAIL (1<<24) // Leave U_GLOW* trail
#define U_VIEWMODEL (1<<25) // Attach model to view (relative). Owner only
#define U_FRAME2 (1<<26) // 1 byte .frame & 0xFF00 (second byte)
#define U_UNUSED27 (1<<27) // future expansion
#define U_UNUSED28 (1<<28) // future expansion
#define U_UNUSED29 (1<<29) // future expansion
#define U_UNUSED30 (1<<30) // future expansion
#define U_EXTEND3 (1<<31) // another byte to follow, future expansion
// QSG 2 End ==================================================================
#define SU_VIEWHEIGHT (1<<0)
#define SU_IDEALPITCH (1<<1)
@ -61,7 +84,7 @@
#define SU_VELOCITY1 (1<<5)
#define SU_VELOCITY2 (1<<6)
#define SU_VELOCITY3 (1<<7)
//define SU_AIMENT (1<<8) AVAILABLE BIT
//#define SU_AIMENT (1<<8) AVAILABLE BIT
#define SU_ITEMS (1<<9)
#define SU_ONGROUND (1<<10) // no data follows, the bit is it
#define SU_INWATER (1<<11) // no data follows, the bit is it
@ -74,11 +97,9 @@
#define SND_ATTENUATION (1<<1) // a byte
#define SND_LOOPING (1<<2) // a long
// defaults for clientinfo messages
#define DEFAULT_VIEWHEIGHT 22
// game types sent by serverinfo
// these determine which intermission screen plays
#define GAME_COOP 0
@ -89,9 +110,8 @@
// also related to svc_strings[] in cl_parse
//==================
//
// server to client
//
// server to client ===========================================================
#define svc_bad 0
#define svc_nop 1
#define svc_disconnect 2
@ -106,9 +126,9 @@
#define svc_setangle 10 // [angle3] set the view angle to this absolute value
#define svc_serverinfo 11 // [long] version
// [string] signon string
// [string]..[0]model cache
// [string]...[0]sounds cache
// [string] signon string
// [string]..[0]model cache
// [string]...[0]sounds cache
#define svc_lightstyle 12 // [byte] [string]
#define svc_updatename 13 // [byte] [string]
#define svc_updatefrags 14 // [byte] [short]
@ -119,7 +139,7 @@
#define svc_damage 19
#define svc_spawnstatic 20
// svc_spawnbinary 21
// svc_spawnbinary 21
#define svc_spawnbaseline 22
#define svc_temp_entity 23
@ -142,19 +162,16 @@
#define svc_cutscene 34
//
// client to server
//
// client to server ===========================================================
#define clc_bad 0
#define clc_nop 1
#define clc_disconnect 2
#define clc_move 3 // [usercmd_t]
#define clc_stringcmd 4 // [string] message
#define clc_stringcmd 4 // [string] message
// temp entity events =========================================================
//
// temp entity events
//
#define TE_SPIKE 0
#define TE_SUPERSPIKE 1
#define TE_GUNSHOT 2
@ -167,12 +184,12 @@
#define TE_LIGHTNING3 9
#define TE_LAVASPLASH 10
#define TE_TELEPORT 11
#define TE_BLOOD 12
#define TE_LIGHTNINGBLOOD 13
#define TE_EXPLOSION2 16
// PGM 01/21/97
#define TE_BEAM 17
// PGM 01/21/97
#define TE_EXPLOSION2 12
#define TE_BEAM 13 // PGM 01/21/97
#define TE_EXPLOSION3 16
#define TE_LIGHTNING4NEH 17
// ============================================================================
#define MAX_CLIENTS 16

View file

@ -629,6 +629,8 @@ CL_RelinkEntities (void)
R_FlameTrail (ent);
else if (ent->model->flags & EF_TRACER3)
R_VoorTrail (ent);
else if (ent->model->flags & EF_GLOWTRAIL)
R_GlowTrail (ent);
state->forcelink = false;

View file

@ -470,6 +470,48 @@ CL_ParseUpdate (int bits)
if (bits & U_NOLERP)
forcelink = true;
// QSG Start
#if 0
if (bits & U_ALPHA)
state->alpha = MSG_ReadByte (net_message);
else
state->alpha = state.baseline.alpha;
if (bits & U_SCALE)
state->scale = MSG_ReadByte (net_message);
else
state->scale = state.baseline.scale;
if (bits & U_EFFECTS2)
state->effects = (state->effects & 0xFF) |
(MSG_ReadByte (net_message) << 8);
if (bits & U_GLOWSIZE)
state->glow_size = MSG_ReadByte (net_message);
else
state->glow_size = state.baseline.glow_size;
if (bits & U_GLOWCOLOR)
state->glow_color = MSG_ReadByte (net_message);
else
state->glow_color = state.baseline.glow_color;
if (bits & U_COLORMOD)
state->colormod = MSG_ReadByte (net_message);
else
state->colormod = state.baseline.colormod;
if (!(bits & U_EXTEND2))
return;
if (bits & U_GLOWTRAIL)
state->effects |= EF_GLOWTRAIL;
if (bits & U_FRAME2)
to->frame = (to->frame & 0xFF) | (MSG_ReadByte (net_message) << 8);
#endif
// QSG End
if (forcelink) { // didn't have an update last message
VectorCopy (state->msg_origins[0], state->msg_origins[1]);
VectorCopy (state->msg_origins[0], ent->origin);
@ -623,8 +665,16 @@ CL_ParseStatic (void)
ent->frame = state.baseline.frame;
ent->colormap = vid.colormap8;
ent->skinnum = state.baseline.skin;
// FIXME: need to get colormod from baseline
ent->colormod[0] = ent->colormod[1] = ent->colormod[2] = 1.0;
if (state.baseline.colormod == 255) {
ent->colormod[0] = ent->colormod[1] = ent->colormod[2] = 1.0;
} else {
ent->colormod[0] = ((float) ((state.baseline.colormod >> 5) & 7)) *
(1.0 / 7.0);
ent->colormod[1] = ((float) ((state.baseline.colormod >> 2) & 7)) *
(1.0 / 7.0);
ent->colormod[2] = ((float) (state.baseline.colormod & 3)) *
(1.0 / 3.0);
}
ent->colormod[3] = state.baseline.alpha / 255.0;
ent->scale = state.baseline.scale / 16.0;

View file

@ -217,18 +217,10 @@ CL_ParseTEnt (void)
byte type;
dlight_t *dl;
int colorStart, colorLength;
int cnt = -1;
explosion_t *ex;
vec3_t pos;
vec3_t col, pos;
type = MSG_ReadByte (net_message);
//XXX FIXME this is to get around an nq/qw protocol collision
if (1) {
if (type == TE_BLOOD)
type = TE_EXPLOSION2;
else if (type == TE_LIGHTNINGBLOOD)
type = TE_BEAM;
}
switch (type) {
case TE_WIZSPIKE: // spike hitting wall
MSG_ReadCoordV (net_message, pos);
@ -262,7 +254,7 @@ CL_ParseTEnt (void)
}
break;
case TE_SUPERSPIKE: // super spike hitting wall
case TE_SUPERSPIKE: // super spike hitting wall
MSG_ReadCoordV (net_message, pos);
R_SuperSpikeEffect (pos);
@ -294,9 +286,9 @@ CL_ParseTEnt (void)
dl->radius = 350;
dl->die = cl.time + 0.5;
dl->decay = 300;
dl->color[0] = 0.86;
dl->color[1] = 0.31;
dl->color[2] = 0.24;
dl->color[0] = 1.0;
dl->color[1] = 0.5;
dl->color[2] = 0.25;
}
// sound
@ -312,24 +304,27 @@ CL_ParseTEnt (void)
case TE_TAREXPLOSION: // tarbaby explosion
MSG_ReadCoordV (net_message, pos);
R_BlobExplosion (pos);
S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
break;
case TE_LIGHTNING1: // lightning bolts
case TE_LIGHTNING1: // lightning bolts
CL_ParseBeam (cl_mod_bolt);
break;
case TE_LIGHTNING2: // lightning bolts
case TE_LIGHTNING2: // lightning bolts
CL_ParseBeam (cl_mod_bolt2);
break;
case TE_LIGHTNING3: // lightning bolts
case TE_LIGHTNING3: // lightning bolts
CL_ParseBeam (cl_mod_bolt3);
break;
case TE_LIGHTNING4NEH: // Nehahra lightning
CL_ParseBeam (Mod_ForName (MSG_ReadString (net_message), true));
break;
// PGM 01/21/97
case TE_BEAM: // grappling hook beam
case TE_BEAM: // grappling hook beam
CL_ParseBeam (Mod_ForName ("progs/beam.mdl", true));
break;
// PGM 01/21/97
@ -344,7 +339,7 @@ CL_ParseTEnt (void)
R_TeleportSplash (pos);
break;
case TE_EXPLOSION2: // color mapped explosion
case TE_EXPLOSION2: // color mapped explosion
MSG_ReadCoordV (net_message, pos);
colorStart = MSG_ReadByte (net_message);
colorLength = MSG_ReadByte (net_message);
@ -357,12 +352,25 @@ CL_ParseTEnt (void)
dl->radius = 350;
dl->die = cl.time + 0.5;
dl->decay = 300;
dl->color[0] = vid_basepal[(colorStart + (rand() % colorLength)) *
3] * (1.0 / 255.0);
dl->color[1] = vid_basepal[(colorStart + (rand() % colorLength)) *
3 + 1] * (1.0 / 255.0);
dl->color[2] = vid_basepal[(colorStart + (rand() % colorLength)) *
3 + 2] * (1.0 / 255.0);
colorStart = (colorStart + (rand() % colorLength)) * 3;
dl->color[0] = vid_basepal[colorStart] * (1.0 / 255.0);
dl->color[1] = vid_basepal[colorStart + 1] * (1.0 / 255.0);
dl->color[2] = vid_basepal[colorStart + 2] * (1.0 / 255.0);
break;
case TE_EXPLOSION3: // Nehahra colored light explosion
MSG_ReadCoordV (net_message, pos);
MSG_ReadCoordV (net_message, col); // OUCH!
R_ParticleExplosion (pos);
S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
dl = R_AllocDlight (0);
if (dl) {
VectorCopy (pos, dl->origin);
dl->radius = 350;
dl->die = cl.time + 0.5;
dl->decay = 300;
VectorCopy (col, dl->color);
}
break;
case TE_GUNSHOT: // bullet hitting wall
@ -370,30 +378,6 @@ CL_ParseTEnt (void)
R_GunshotEffect (pos, 20);
break;
case TE_BLOOD: // bullet hitting body
cnt = MSG_ReadByte (net_message) * 20;
MSG_ReadCoordV (net_message, pos);
R_BloodPuffEffect (pos, cnt);
break;
case TE_LIGHTNINGBLOOD: // lightning hitting body
MSG_ReadCoordV (net_message, pos);
// light
dl = R_AllocDlight (0);
if (dl) {
VectorCopy (pos, dl->origin);
dl->radius = 150;
dl->die = cl.time + 0.1;
dl->decay = 200;
dl->color[0] = 0.25;
dl->color[1] = 0.40;
dl->color[2] = 0.65;
}
R_LightningBloodEffect (pos);
break;
default:
Sys_Error ("CL_ParseTEnt: bad type");
}

View file

@ -36,13 +36,13 @@
#define QW_CHECK_HASH 0x5157
//=========================================
// =========================================
#define PORT_CLIENT "27001"
#define PORT_MASTER 27000
#define PORT_SERVER 27500
//=========================================
// =========================================
// out of band message id bytes
@ -69,9 +69,8 @@
// also related to svc_strings[] in cl_parse
//==================
//
// server to client
//
// server to client ===========================================================
#define svc_bad 0
#define svc_nop 1
#define svc_disconnect 2
@ -105,8 +104,7 @@
#define svc_updateentertime 37 // [byte] [float]
#define svc_updatestatlong 38 // [byte] [long]
#define svc_muzzleflash 39 // [short] entity
#define svc_updateuserinfo 40 // [byte] slot [long] uid
// [string] userinfo
#define svc_updateuserinfo 40 // [byte] slot [long] uid [string] userinfo
#define svc_download 41 // [short] size [size bytes]
#define svc_playerinfo 42 // variable
#define svc_nails 43 // [byte] num [48 bits] xyzpy 12 12 12 4 8
@ -121,12 +119,8 @@
#define svc_serverinfo 52 // serverinfo
#define svc_updatepl 53 // [byte] [byte]
// client to server ===========================================================
//==============================================
//
// client to server
//
#define clc_bad 0
#define clc_nop 1
//define clc_doublemove 2
@ -136,8 +130,7 @@
#define clc_tmove 6 // teleport request, spectator only
#define clc_upload 7 // teleport request, spectator only
//==============================================
// ==============================================
// playerinfo flags from server
// playerinfo always sends: playernum, flags, origin[] and framenumber
@ -165,7 +158,7 @@
#define PF_COLORMOD (1<<5)
#define PF_FRAME2 (1<<6)
//==============================================
// ==============================================
// if the high bit of the client to server byte is set, the low bits are
// client move cmd bits
@ -179,7 +172,7 @@
#define CM_IMPULSE (1<<6)
#define CM_ANGLE2 (1<<7)
//==============================================
// ==============================================
// the first 16 bits of a packetentities update holds 9 bits
// of entity number and 7 bits of flags
@ -200,8 +193,7 @@
#define U_EFFECTS (1<<5)
#define U_SOLID (1<<6) // the entity should be solid for prediction
///////////////////////////////////////////////////////////////////////////
// QSG Protocol Extensions (Version 2)
// QSG Protocol Extensions (Version 2) ========================================
// Network definitions for the engine
#define U_EXTEND1 (1<<7)
@ -224,7 +216,7 @@
#define U_UNUSED30 (1<<30) // future expansion
#define U_EXTEND3 (1<<31) // another byte to follow, future expansion
//==============================================
// ============================================================================
// a sound with no channel is a local only sound
// the sound field has bits 0-2: channel, 3-12: entity
@ -237,9 +229,9 @@
#define PRINT_HIGH 2
#define PRINT_CHAT 3 // also go to chat buffer
//
// temp entity events
//
// temp entity events =========================================================
#define TE_SPIKE 0
#define TE_SUPERSPIKE 1
#define TE_GUNSHOT 2
@ -255,18 +247,9 @@
#define TE_BLOOD 12
#define TE_LIGHTNINGBLOOD 13
#define TE_EXPLOSION2 16
// PGM 01/21/97
#define TE_BEAM 17
// PGM 01/21/97
#define TE_BEAM 17 // PGM 01/21/97
/*
==========================================================
ELEMENTS COMMUNICATED ACROSS THE NET
==========================================================
*/
// ELEMENTS COMMUNICATED ACROSS THE NET =======================================
#define MAX_CLIENTS 32

View file

@ -545,6 +545,8 @@ CL_LinkPacketEntities (void)
R_FlameTrail (*ent);
else if (model->flags & EF_TRACER3)
R_VoorTrail (*ent);
else if (model->flags & EF_GLOWTRAIL)
R_GlowTrail (*ent);
}
}

View file

@ -328,7 +328,7 @@ CL_ParseTEnt (void)
}
break;
case TE_SUPERSPIKE: // super spike hitting wall
case TE_SUPERSPIKE: // super spike hitting wall
MSG_ReadCoordV (net_message, pos);
R_SuperSpikeEffect (pos);
@ -377,27 +377,27 @@ CL_ParseTEnt (void)
ex->ent.model = cl_spr_explod;
break;
case TE_TAREXPLOSION: // tarbaby explosion
case TE_TAREXPLOSION: // tarbaby explosion
MSG_ReadCoordV (net_message, pos);
R_BlobExplosion (pos);
S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
break;
case TE_LIGHTNING1: // lightning bolts
case TE_LIGHTNING1: // lightning bolts
CL_ParseBeam (cl_mod_bolt);
break;
case TE_LIGHTNING2: // lightning bolts
case TE_LIGHTNING2: // lightning bolts
CL_ParseBeam (cl_mod_bolt2);
break;
case TE_LIGHTNING3: // lightning bolts
case TE_LIGHTNING3: // lightning bolts
CL_ParseBeam (cl_mod_bolt3);
break;
// PGM 01/21/97
case TE_BEAM: // grappling hook beam
case TE_BEAM: // grappling hook beam
CL_ParseBeam (Mod_ForName ("progs/beam.mdl", true));
break;
// PGM 01/21/97
@ -412,7 +412,7 @@ CL_ParseTEnt (void)
R_TeleportSplash (pos);
break;
case TE_EXPLOSION2: // color mapped explosion
case TE_EXPLOSION2: // color mapped explosion
MSG_ReadCoordV (net_message, pos);
colorStart = MSG_ReadByte (net_message);
colorLength = MSG_ReadByte (net_message);
@ -425,27 +425,25 @@ CL_ParseTEnt (void)
dl->radius = 350;
dl->die = cl.time + 0.5;
dl->decay = 300;
dl->color[0] = vid_basepal[(colorStart + (rand() % colorLength)) *
3] * (1.0 / 255.0);
dl->color[1] = vid_basepal[(colorStart + (rand() % colorLength)) *
3 + 1] * (1.0 / 255.0);
dl->color[2] = vid_basepal[(colorStart + (rand() % colorLength)) *
3 + 2] * (1.0 / 255.0);
colorStart = (colorStart + (rand() % colorLength)) * 3;
dl->color[0] = vid_basepal[colorStart] * (1.0 / 255.0);
dl->color[1] = vid_basepal[colorStart + 1] * (1.0 / 255.0);
dl->color[2] = vid_basepal[colorStart + 2] * (1.0 / 255.0);
break;
case TE_GUNSHOT: // bullet hitting wall
case TE_GUNSHOT: // bullet hitting wall
cnt = MSG_ReadByte (net_message) * 20;
MSG_ReadCoordV (net_message, pos);
R_GunshotEffect (pos, cnt);
break;
case TE_BLOOD: // bullet hitting body
case TE_BLOOD: // bullet hitting body
cnt = MSG_ReadByte (net_message) * 20;
MSG_ReadCoordV (net_message, pos);
R_BloodPuffEffect (pos, cnt);
break;
case TE_LIGHTNINGBLOOD: // lightning hitting body
case TE_LIGHTNINGBLOOD: // lightning hitting body
MSG_ReadCoordV (net_message, pos);
// light