mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 06:51:47 +00:00
Another step towards QSG2 compliance.
This commit is contained in:
parent
3c7d65a798
commit
587de27849
11 changed files with 255 additions and 210 deletions
|
@ -36,13 +36,11 @@
|
||||||
#include "QF/zone.h"
|
#include "QF/zone.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
d*_t structures are on-disk representations
|
d*_t structures are on-disk representations
|
||||||
m*_t structures are in-memory
|
m*_t structures are in-memory
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// entity effects
|
// entity effects =============================================================
|
||||||
|
|
||||||
#define EF_BRIGHTFIELD 1
|
#define EF_BRIGHTFIELD 1
|
||||||
#define EF_MUZZLEFLASH 2
|
#define EF_MUZZLEFLASH 2
|
||||||
|
@ -53,13 +51,7 @@ m*_t structures are in-memory
|
||||||
#define EF_BLUE 64
|
#define EF_BLUE 64
|
||||||
#define EF_RED 128
|
#define EF_RED 128
|
||||||
|
|
||||||
/*
|
// BRUSH MODELS ===============================================================
|
||||||
==============================================================================
|
|
||||||
|
|
||||||
BRUSH MODELS
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct efrag_s
|
typedef struct efrag_s
|
||||||
{
|
{
|
||||||
|
@ -70,9 +62,8 @@ typedef struct efrag_s
|
||||||
} efrag_t;
|
} efrag_t;
|
||||||
|
|
||||||
|
|
||||||
//
|
// in memory representation ===================================================
|
||||||
// in memory representation
|
|
||||||
//
|
|
||||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -221,13 +212,7 @@ typedef struct hull_s
|
||||||
vec3_t clip_maxs;
|
vec3_t clip_maxs;
|
||||||
} hull_t;
|
} hull_t;
|
||||||
|
|
||||||
/*
|
// SPRITE MODELS ==============================================================
|
||||||
==============================================================================
|
|
||||||
|
|
||||||
SPRITE MODELS
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
*/
|
|
||||||
|
|
||||||
// FIXME: shorten these?
|
// FIXME: shorten these?
|
||||||
typedef struct mspriteframe_s
|
typedef struct mspriteframe_s
|
||||||
|
@ -264,14 +249,8 @@ typedef struct
|
||||||
} msprite_t;
|
} 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 */
|
/* NOTE: the first three lines must match maliasgroupframedesc_t */
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@ -349,11 +328,7 @@ extern trivertx_t *poseverts[MAXALIASFRAMES];
|
||||||
extern int aliasbboxmins[3];
|
extern int aliasbboxmins[3];
|
||||||
extern int aliasbboxmaxs[3];
|
extern int aliasbboxmaxs[3];
|
||||||
|
|
||||||
//===================================================================
|
// Whole model =======================================================
|
||||||
|
|
||||||
//
|
|
||||||
// Whole model
|
|
||||||
//
|
|
||||||
|
|
||||||
typedef enum {mod_brush, mod_sprite, mod_alias} modtype_t;
|
typedef enum {mod_brush, mod_sprite, mod_alias} modtype_t;
|
||||||
|
|
||||||
|
@ -365,6 +340,7 @@ typedef enum {mod_brush, mod_sprite, mod_alias} modtype_t;
|
||||||
#define EF_ZOMGIB 32 // small blood trail
|
#define EF_ZOMGIB 32 // small blood trail
|
||||||
#define EF_TRACER2 64 // orange split trail + rotate
|
#define EF_TRACER2 64 // orange split trail + rotate
|
||||||
#define EF_TRACER3 128 // purple trail
|
#define EF_TRACER3 128 // purple trail
|
||||||
|
#define EF_GLOWTRAIL 4096 // glowcolor particle trail
|
||||||
|
|
||||||
typedef struct model_s
|
typedef struct model_s
|
||||||
{
|
{
|
||||||
|
@ -463,7 +439,6 @@ void Mod_LoadLighting (lump_t *l);
|
||||||
int Mod_CalcFullbright (byte *in, byte *out, int pixels);
|
int Mod_CalcFullbright (byte *in, byte *out, int pixels);
|
||||||
int Mod_Fullbright (byte * skin, int width, int height, char *name);
|
int Mod_Fullbright (byte * skin, int width, int height, char *name);
|
||||||
|
|
||||||
|
|
||||||
void *Mod_LoadAliasFrame (void *pin, int *posenum, maliasframedesc_t *frame,
|
void *Mod_LoadAliasFrame (void *pin, int *posenum, maliasframedesc_t *frame,
|
||||||
int extra);
|
int extra);
|
||||||
void *Mod_LoadAliasGroup (void *pin, int *posenum, maliasframedesc_t *frame,
|
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);
|
void Mod_SpriteLoadTexture (mspriteframe_t *pspriteframe, int framenum);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern struct cvar_s *gl_mesh_cache;
|
extern struct cvar_s *gl_mesh_cache;
|
||||||
extern struct cvar_s *gl_subdivide_size;
|
extern struct cvar_s *gl_subdivide_size;
|
||||||
extern model_t *loadmodel;
|
extern model_t *loadmodel;
|
||||||
extern char loadname[32];
|
extern char loadname[32];
|
||||||
extern byte *mod_base;
|
extern byte *mod_base;
|
||||||
extern byte mod_novis[MAX_MAP_LEAFS / 8];
|
extern byte mod_novis[MAX_MAP_LEAFS / 8];
|
||||||
|
|
||||||
extern int mod_lightmap_bytes;
|
extern int mod_lightmap_bytes;
|
||||||
|
|
||||||
#endif // _MODEL_H
|
#endif // _MODEL_H
|
||||||
|
|
|
@ -51,6 +51,7 @@ extern void (*R_SlightBloodTrail) (struct entity_s *ent);
|
||||||
extern void (*R_WizTrail) (struct entity_s *ent);
|
extern void (*R_WizTrail) (struct entity_s *ent);
|
||||||
extern void (*R_FlameTrail) (struct entity_s *ent);
|
extern void (*R_FlameTrail) (struct entity_s *ent);
|
||||||
extern void (*R_VoorTrail) (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,
|
extern void (*R_RunParticleEffect) (const vec3_t org, const vec3_t dir,
|
||||||
int color, int count);
|
int color, int count);
|
||||||
|
|
|
@ -449,12 +449,13 @@ R_TeleportSplash_QF (const vec3_t org)
|
||||||
// l = r_maxparticles - numparticles;
|
// l = r_maxparticles - numparticles;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
for (k = -24; k < 32; k += 4) {
|
||||||
|
dir[2] = k * 8;
|
||||||
for (i = -16; i < 16; i += 4) {
|
for (i = -16; i < 16; i += 4) {
|
||||||
dir[1] = i * 8;
|
dir[1] = i * 8;
|
||||||
for (j = -16; j < 16; j += 4) {
|
for (j = -16; j < 16; j += 4) {
|
||||||
dir[0] = j * 8;
|
dir[0] = j * 8;
|
||||||
for (k = -24; k < 32; k += 4) {
|
|
||||||
dir[2] = k * 8;
|
|
||||||
VectorCopy (dir, pdir);
|
VectorCopy (dir, pdir);
|
||||||
VectorNormalize (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
|
void
|
||||||
R_ParticleExplosion_EE (const vec3_t org)
|
R_ParticleExplosion_EE (const vec3_t org)
|
||||||
{
|
{
|
||||||
|
@ -756,12 +787,12 @@ R_TeleportSplash_EE (const vec3_t org)
|
||||||
// l = r_maxparticles - numparticles;
|
// l = r_maxparticles - numparticles;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
for (k = -24; k < 32; k += 4) {
|
||||||
|
dir[2] = k * 8;
|
||||||
for (i = -16; i < 16; i += 4) {
|
for (i = -16; i < 16; i += 4) {
|
||||||
dir[1] = i * 8;
|
dir[1] = i * 8;
|
||||||
for (j = -16; j < 16; j += 4) {
|
for (j = -16; j < 16; j += 4) {
|
||||||
dir[0] = j * 8;
|
dir[0] = j * 8;
|
||||||
for (k = -24; k < 32; k += 4) {
|
|
||||||
dir[2] = k * 8;
|
|
||||||
|
|
||||||
rnd = rand ();
|
rnd = rand ();
|
||||||
porg[0] = org[0] + i + (rnd & 3);
|
porg[0] = org[0] + i + (rnd & 3);
|
||||||
|
@ -1016,12 +1047,13 @@ R_TeleportSplash_ID (const vec3_t org)
|
||||||
// l = r_maxparticles - numparticles;
|
// l = r_maxparticles - numparticles;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
for (k = -24; k < 32; k += 4) {
|
||||||
|
dir[2] = k * 8;
|
||||||
for (i = -16; i < 16; i += 4) {
|
for (i = -16; i < 16; i += 4) {
|
||||||
dir[1] = i * 8;
|
dir[1] = i * 8;
|
||||||
for (j = -16; j < 16; j += 4) {
|
for (j = -16; j < 16; j += 4) {
|
||||||
dir[0] = j * 8;
|
dir[0] = j * 8;
|
||||||
for (k = -24; k < 32; k += 4) {
|
|
||||||
dir[2] = k * 8;
|
|
||||||
VectorCopy (dir, pdir);
|
VectorCopy (dir, pdir);
|
||||||
VectorNormalize (pdir);
|
VectorNormalize (pdir);
|
||||||
|
|
||||||
|
@ -1537,6 +1569,7 @@ r_particles_style_f (cvar_t *var)
|
||||||
R_WizTrail = R_WizTrail_QF;
|
R_WizTrail = R_WizTrail_QF;
|
||||||
R_FlameTrail = R_FlameTrail_QF;
|
R_FlameTrail = R_FlameTrail_QF;
|
||||||
R_VoorTrail = R_VoorTrail_QF;
|
R_VoorTrail = R_VoorTrail_QF;
|
||||||
|
R_GlowTrail = R_GlowTrail_QF;
|
||||||
} else {
|
} else {
|
||||||
R_BlobExplosion = R_BlobExplosion_ID;
|
R_BlobExplosion = R_BlobExplosion_ID;
|
||||||
R_ParticleExplosion = R_ParticleExplosion_ID;
|
R_ParticleExplosion = R_ParticleExplosion_ID;
|
||||||
|
@ -1561,6 +1594,7 @@ r_particles_style_f (cvar_t *var)
|
||||||
R_WizTrail = R_WizTrail_ID;
|
R_WizTrail = R_WizTrail_ID;
|
||||||
R_FlameTrail = R_FlameTrail_ID;
|
R_FlameTrail = R_FlameTrail_ID;
|
||||||
R_VoorTrail = R_VoorTrail_ID;
|
R_VoorTrail = R_VoorTrail_ID;
|
||||||
|
R_GlowTrail = R_GlowTrail_QF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,7 @@ void (*R_SlightBloodTrail) (struct entity_s *ent);
|
||||||
void (*R_WizTrail) (struct entity_s *ent);
|
void (*R_WizTrail) (struct entity_s *ent);
|
||||||
void (*R_FlameTrail) (struct entity_s *ent);
|
void (*R_FlameTrail) (struct entity_s *ent);
|
||||||
void (*R_VoorTrail) (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_RunParticleEffect) (vec3_t org, vec3_t dir, int color, int count);
|
||||||
void (*R_BloodPuffEffect) (vec3_t org, int count);
|
void (*R_BloodPuffEffect) (vec3_t org, int count);
|
||||||
void (*R_GunshotEffect) (vec3_t org, int count);
|
void (*R_GunshotEffect) (vec3_t org, int count);
|
||||||
|
|
|
@ -52,6 +52,29 @@
|
||||||
#define U_EFFECTS (1<<13)
|
#define U_EFFECTS (1<<13)
|
||||||
#define U_LONGENTITY (1<<14)
|
#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_VIEWHEIGHT (1<<0)
|
||||||
#define SU_IDEALPITCH (1<<1)
|
#define SU_IDEALPITCH (1<<1)
|
||||||
|
@ -61,7 +84,7 @@
|
||||||
#define SU_VELOCITY1 (1<<5)
|
#define SU_VELOCITY1 (1<<5)
|
||||||
#define SU_VELOCITY2 (1<<6)
|
#define SU_VELOCITY2 (1<<6)
|
||||||
#define SU_VELOCITY3 (1<<7)
|
#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_ITEMS (1<<9)
|
||||||
#define SU_ONGROUND (1<<10) // no data follows, the bit is it
|
#define SU_ONGROUND (1<<10) // no data follows, the bit is it
|
||||||
#define SU_INWATER (1<<11) // 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_ATTENUATION (1<<1) // a byte
|
||||||
#define SND_LOOPING (1<<2) // a long
|
#define SND_LOOPING (1<<2) // a long
|
||||||
|
|
||||||
|
|
||||||
// defaults for clientinfo messages
|
// defaults for clientinfo messages
|
||||||
#define DEFAULT_VIEWHEIGHT 22
|
#define DEFAULT_VIEWHEIGHT 22
|
||||||
|
|
||||||
|
|
||||||
// game types sent by serverinfo
|
// game types sent by serverinfo
|
||||||
// these determine which intermission screen plays
|
// these determine which intermission screen plays
|
||||||
#define GAME_COOP 0
|
#define GAME_COOP 0
|
||||||
|
@ -89,9 +110,8 @@
|
||||||
// also related to svc_strings[] in cl_parse
|
// also related to svc_strings[] in cl_parse
|
||||||
//==================
|
//==================
|
||||||
|
|
||||||
//
|
// server to client ===========================================================
|
||||||
// server to client
|
|
||||||
//
|
|
||||||
#define svc_bad 0
|
#define svc_bad 0
|
||||||
#define svc_nop 1
|
#define svc_nop 1
|
||||||
#define svc_disconnect 2
|
#define svc_disconnect 2
|
||||||
|
@ -142,19 +162,16 @@
|
||||||
|
|
||||||
#define svc_cutscene 34
|
#define svc_cutscene 34
|
||||||
|
|
||||||
//
|
// client to server ===========================================================
|
||||||
// client to server
|
|
||||||
//
|
|
||||||
#define clc_bad 0
|
#define clc_bad 0
|
||||||
#define clc_nop 1
|
#define clc_nop 1
|
||||||
#define clc_disconnect 2
|
#define clc_disconnect 2
|
||||||
#define clc_move 3 // [usercmd_t]
|
#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_SPIKE 0
|
||||||
#define TE_SUPERSPIKE 1
|
#define TE_SUPERSPIKE 1
|
||||||
#define TE_GUNSHOT 2
|
#define TE_GUNSHOT 2
|
||||||
|
@ -167,12 +184,12 @@
|
||||||
#define TE_LIGHTNING3 9
|
#define TE_LIGHTNING3 9
|
||||||
#define TE_LAVASPLASH 10
|
#define TE_LAVASPLASH 10
|
||||||
#define TE_TELEPORT 11
|
#define TE_TELEPORT 11
|
||||||
#define TE_BLOOD 12
|
#define TE_EXPLOSION2 12
|
||||||
#define TE_LIGHTNINGBLOOD 13
|
#define TE_BEAM 13 // PGM 01/21/97
|
||||||
#define TE_EXPLOSION2 16
|
#define TE_EXPLOSION3 16
|
||||||
// PGM 01/21/97
|
#define TE_LIGHTNING4NEH 17
|
||||||
#define TE_BEAM 17
|
|
||||||
// PGM 01/21/97
|
// ============================================================================
|
||||||
|
|
||||||
#define MAX_CLIENTS 16
|
#define MAX_CLIENTS 16
|
||||||
|
|
||||||
|
|
|
@ -629,6 +629,8 @@ CL_RelinkEntities (void)
|
||||||
R_FlameTrail (ent);
|
R_FlameTrail (ent);
|
||||||
else if (ent->model->flags & EF_TRACER3)
|
else if (ent->model->flags & EF_TRACER3)
|
||||||
R_VoorTrail (ent);
|
R_VoorTrail (ent);
|
||||||
|
else if (ent->model->flags & EF_GLOWTRAIL)
|
||||||
|
R_GlowTrail (ent);
|
||||||
|
|
||||||
state->forcelink = false;
|
state->forcelink = false;
|
||||||
|
|
||||||
|
|
|
@ -470,6 +470,48 @@ CL_ParseUpdate (int bits)
|
||||||
if (bits & U_NOLERP)
|
if (bits & U_NOLERP)
|
||||||
forcelink = true;
|
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
|
if (forcelink) { // didn't have an update last message
|
||||||
VectorCopy (state->msg_origins[0], state->msg_origins[1]);
|
VectorCopy (state->msg_origins[0], state->msg_origins[1]);
|
||||||
VectorCopy (state->msg_origins[0], ent->origin);
|
VectorCopy (state->msg_origins[0], ent->origin);
|
||||||
|
@ -623,8 +665,16 @@ CL_ParseStatic (void)
|
||||||
ent->frame = state.baseline.frame;
|
ent->frame = state.baseline.frame;
|
||||||
ent->colormap = vid.colormap8;
|
ent->colormap = vid.colormap8;
|
||||||
ent->skinnum = state.baseline.skin;
|
ent->skinnum = state.baseline.skin;
|
||||||
// FIXME: need to get colormod from baseline
|
if (state.baseline.colormod == 255) {
|
||||||
ent->colormod[0] = ent->colormod[1] = ent->colormod[2] = 1.0;
|
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->colormod[3] = state.baseline.alpha / 255.0;
|
||||||
ent->scale = state.baseline.scale / 16.0;
|
ent->scale = state.baseline.scale / 16.0;
|
||||||
|
|
||||||
|
|
|
@ -217,18 +217,10 @@ CL_ParseTEnt (void)
|
||||||
byte type;
|
byte type;
|
||||||
dlight_t *dl;
|
dlight_t *dl;
|
||||||
int colorStart, colorLength;
|
int colorStart, colorLength;
|
||||||
int cnt = -1;
|
|
||||||
explosion_t *ex;
|
explosion_t *ex;
|
||||||
vec3_t pos;
|
vec3_t col, pos;
|
||||||
|
|
||||||
type = MSG_ReadByte (net_message);
|
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) {
|
switch (type) {
|
||||||
case TE_WIZSPIKE: // spike hitting wall
|
case TE_WIZSPIKE: // spike hitting wall
|
||||||
MSG_ReadCoordV (net_message, pos);
|
MSG_ReadCoordV (net_message, pos);
|
||||||
|
@ -294,9 +286,9 @@ CL_ParseTEnt (void)
|
||||||
dl->radius = 350;
|
dl->radius = 350;
|
||||||
dl->die = cl.time + 0.5;
|
dl->die = cl.time + 0.5;
|
||||||
dl->decay = 300;
|
dl->decay = 300;
|
||||||
dl->color[0] = 0.86;
|
dl->color[0] = 1.0;
|
||||||
dl->color[1] = 0.31;
|
dl->color[1] = 0.5;
|
||||||
dl->color[2] = 0.24;
|
dl->color[2] = 0.25;
|
||||||
}
|
}
|
||||||
|
|
||||||
// sound
|
// sound
|
||||||
|
@ -312,7 +304,6 @@ CL_ParseTEnt (void)
|
||||||
case TE_TAREXPLOSION: // tarbaby explosion
|
case TE_TAREXPLOSION: // tarbaby explosion
|
||||||
MSG_ReadCoordV (net_message, pos);
|
MSG_ReadCoordV (net_message, pos);
|
||||||
R_BlobExplosion (pos);
|
R_BlobExplosion (pos);
|
||||||
|
|
||||||
S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
|
S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -328,6 +319,10 @@ CL_ParseTEnt (void)
|
||||||
CL_ParseBeam (cl_mod_bolt3);
|
CL_ParseBeam (cl_mod_bolt3);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case TE_LIGHTNING4NEH: // Nehahra lightning
|
||||||
|
CL_ParseBeam (Mod_ForName (MSG_ReadString (net_message), true));
|
||||||
|
break;
|
||||||
|
|
||||||
// PGM 01/21/97
|
// PGM 01/21/97
|
||||||
case TE_BEAM: // grappling hook beam
|
case TE_BEAM: // grappling hook beam
|
||||||
CL_ParseBeam (Mod_ForName ("progs/beam.mdl", true));
|
CL_ParseBeam (Mod_ForName ("progs/beam.mdl", true));
|
||||||
|
@ -357,12 +352,25 @@ CL_ParseTEnt (void)
|
||||||
dl->radius = 350;
|
dl->radius = 350;
|
||||||
dl->die = cl.time + 0.5;
|
dl->die = cl.time + 0.5;
|
||||||
dl->decay = 300;
|
dl->decay = 300;
|
||||||
dl->color[0] = vid_basepal[(colorStart + (rand() % colorLength)) *
|
colorStart = (colorStart + (rand() % colorLength)) * 3;
|
||||||
3] * (1.0 / 255.0);
|
dl->color[0] = vid_basepal[colorStart] * (1.0 / 255.0);
|
||||||
dl->color[1] = vid_basepal[(colorStart + (rand() % colorLength)) *
|
dl->color[1] = vid_basepal[colorStart + 1] * (1.0 / 255.0);
|
||||||
3 + 1] * (1.0 / 255.0);
|
dl->color[2] = vid_basepal[colorStart + 2] * (1.0 / 255.0);
|
||||||
dl->color[2] = vid_basepal[(colorStart + (rand() % colorLength)) *
|
break;
|
||||||
3 + 2] * (1.0 / 255.0);
|
|
||||||
|
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;
|
break;
|
||||||
|
|
||||||
case TE_GUNSHOT: // bullet hitting wall
|
case TE_GUNSHOT: // bullet hitting wall
|
||||||
|
@ -370,30 +378,6 @@ CL_ParseTEnt (void)
|
||||||
R_GunshotEffect (pos, 20);
|
R_GunshotEffect (pos, 20);
|
||||||
break;
|
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:
|
default:
|
||||||
Sys_Error ("CL_ParseTEnt: bad type");
|
Sys_Error ("CL_ParseTEnt: bad type");
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,9 +69,8 @@
|
||||||
// also related to svc_strings[] in cl_parse
|
// also related to svc_strings[] in cl_parse
|
||||||
//==================
|
//==================
|
||||||
|
|
||||||
//
|
// server to client ===========================================================
|
||||||
// server to client
|
|
||||||
//
|
|
||||||
#define svc_bad 0
|
#define svc_bad 0
|
||||||
#define svc_nop 1
|
#define svc_nop 1
|
||||||
#define svc_disconnect 2
|
#define svc_disconnect 2
|
||||||
|
@ -105,8 +104,7 @@
|
||||||
#define svc_updateentertime 37 // [byte] [float]
|
#define svc_updateentertime 37 // [byte] [float]
|
||||||
#define svc_updatestatlong 38 // [byte] [long]
|
#define svc_updatestatlong 38 // [byte] [long]
|
||||||
#define svc_muzzleflash 39 // [short] entity
|
#define svc_muzzleflash 39 // [short] entity
|
||||||
#define svc_updateuserinfo 40 // [byte] slot [long] uid
|
#define svc_updateuserinfo 40 // [byte] slot [long] uid [string] userinfo
|
||||||
// [string] userinfo
|
|
||||||
#define svc_download 41 // [short] size [size bytes]
|
#define svc_download 41 // [short] size [size bytes]
|
||||||
#define svc_playerinfo 42 // variable
|
#define svc_playerinfo 42 // variable
|
||||||
#define svc_nails 43 // [byte] num [48 bits] xyzpy 12 12 12 4 8
|
#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_serverinfo 52 // serverinfo
|
||||||
#define svc_updatepl 53 // [byte] [byte]
|
#define svc_updatepl 53 // [byte] [byte]
|
||||||
|
|
||||||
|
// client to server ===========================================================
|
||||||
|
|
||||||
//==============================================
|
|
||||||
|
|
||||||
//
|
|
||||||
// client to server
|
|
||||||
//
|
|
||||||
#define clc_bad 0
|
#define clc_bad 0
|
||||||
#define clc_nop 1
|
#define clc_nop 1
|
||||||
//define clc_doublemove 2
|
//define clc_doublemove 2
|
||||||
|
@ -136,7 +130,6 @@
|
||||||
#define clc_tmove 6 // teleport request, spectator only
|
#define clc_tmove 6 // teleport request, spectator only
|
||||||
#define clc_upload 7 // teleport request, spectator only
|
#define clc_upload 7 // teleport request, spectator only
|
||||||
|
|
||||||
|
|
||||||
// ==============================================
|
// ==============================================
|
||||||
|
|
||||||
// playerinfo flags from server
|
// playerinfo flags from server
|
||||||
|
@ -200,8 +193,7 @@
|
||||||
#define U_EFFECTS (1<<5)
|
#define U_EFFECTS (1<<5)
|
||||||
#define U_SOLID (1<<6) // the entity should be solid for prediction
|
#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
|
// Network definitions for the engine
|
||||||
|
|
||||||
#define U_EXTEND1 (1<<7)
|
#define U_EXTEND1 (1<<7)
|
||||||
|
@ -224,7 +216,7 @@
|
||||||
#define U_UNUSED30 (1<<30) // future expansion
|
#define U_UNUSED30 (1<<30) // future expansion
|
||||||
#define U_EXTEND3 (1<<31) // another byte to follow, future expansion
|
#define U_EXTEND3 (1<<31) // another byte to follow, future expansion
|
||||||
|
|
||||||
//==============================================
|
// ============================================================================
|
||||||
|
|
||||||
// a sound with no channel is a local only sound
|
// a sound with no channel is a local only sound
|
||||||
// the sound field has bits 0-2: channel, 3-12: entity
|
// the sound field has bits 0-2: channel, 3-12: entity
|
||||||
|
@ -237,9 +229,9 @@
|
||||||
#define PRINT_HIGH 2
|
#define PRINT_HIGH 2
|
||||||
#define PRINT_CHAT 3 // also go to chat buffer
|
#define PRINT_CHAT 3 // also go to chat buffer
|
||||||
|
|
||||||
//
|
|
||||||
// temp entity events
|
// temp entity events =========================================================
|
||||||
//
|
|
||||||
#define TE_SPIKE 0
|
#define TE_SPIKE 0
|
||||||
#define TE_SUPERSPIKE 1
|
#define TE_SUPERSPIKE 1
|
||||||
#define TE_GUNSHOT 2
|
#define TE_GUNSHOT 2
|
||||||
|
@ -255,18 +247,9 @@
|
||||||
#define TE_BLOOD 12
|
#define TE_BLOOD 12
|
||||||
#define TE_LIGHTNINGBLOOD 13
|
#define TE_LIGHTNINGBLOOD 13
|
||||||
#define TE_EXPLOSION2 16
|
#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
|
#define MAX_CLIENTS 32
|
||||||
|
|
||||||
|
|
|
@ -545,6 +545,8 @@ CL_LinkPacketEntities (void)
|
||||||
R_FlameTrail (*ent);
|
R_FlameTrail (*ent);
|
||||||
else if (model->flags & EF_TRACER3)
|
else if (model->flags & EF_TRACER3)
|
||||||
R_VoorTrail (*ent);
|
R_VoorTrail (*ent);
|
||||||
|
else if (model->flags & EF_GLOWTRAIL)
|
||||||
|
R_GlowTrail (*ent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -425,12 +425,10 @@ CL_ParseTEnt (void)
|
||||||
dl->radius = 350;
|
dl->radius = 350;
|
||||||
dl->die = cl.time + 0.5;
|
dl->die = cl.time + 0.5;
|
||||||
dl->decay = 300;
|
dl->decay = 300;
|
||||||
dl->color[0] = vid_basepal[(colorStart + (rand() % colorLength)) *
|
colorStart = (colorStart + (rand() % colorLength)) * 3;
|
||||||
3] * (1.0 / 255.0);
|
dl->color[0] = vid_basepal[colorStart] * (1.0 / 255.0);
|
||||||
dl->color[1] = vid_basepal[(colorStart + (rand() % colorLength)) *
|
dl->color[1] = vid_basepal[colorStart + 1] * (1.0 / 255.0);
|
||||||
3 + 1] * (1.0 / 255.0);
|
dl->color[2] = vid_basepal[colorStart + 2] * (1.0 / 255.0);
|
||||||
dl->color[2] = vid_basepal[(colorStart + (rand() % colorLength)) *
|
|
||||||
3 + 2] * (1.0 / 255.0);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TE_GUNSHOT: // bullet hitting wall
|
case TE_GUNSHOT: // bullet hitting wall
|
||||||
|
|
Loading…
Reference in a new issue