Go to the documentation of this file.
52 #define MAX_PROJECTILES 64
53 projectile_t cl_projectiles[MAX_PROJECTILES];
55 void CL_ClearProjectiles (
void)
59 for (
i = 0;
i < MAX_PROJECTILES;
i++) {
62 cl_projectiles[
i].present =
false;
73 void CL_ParseProjectiles (
void)
90 pr.origin[0] = ( ( bits[0] + ((bits[1]&15)<<8) ) <<1) - 4096;
91 pr.origin[1] = ( ( (bits[1]>>4) + (bits[2]<<4) ) <<1) - 4096;
92 pr.origin[2] = ( ( bits[3] + ((bits[4]&15)<<8) ) <<1) - 4096;
107 pr.oldorigin[0] = ( ( bits[0] + ((bits[1]&15)<<8) ) <<1) - 4096;
108 pr.oldorigin[1] = ( ( (bits[1]>>4) + (bits[2]<<4) ) <<1) - 4096;
109 pr.oldorigin[2] = ( ( bits[3] + ((bits[4]&15)<<8) ) <<1) - 4096;
116 pr.angles[0] = 360*bits[0]/256;
117 pr.angles[1] = 360*bits[1]/256;
118 pr.modelindex = bits[2];
128 for (
j = 0;
j < MAX_PROJECTILES;
j++) {
129 if (cl_projectiles[
j].modelindex) {
130 if (cl_projectiles[
j].num == pr.num) {
133 VectorCopy(cl_projectiles[
j].origin, pr.oldorigin);
134 cl_projectiles[
j] = pr;
142 if (
j == MAX_PROJECTILES) {
143 if (lastempty != -1) {
144 cl_projectiles[lastempty] = pr;
156 void CL_AddProjectiles (
void)
162 memset (&ent, 0,
sizeof(ent));
164 for (
i=0, pr=cl_projectiles ;
i < MAX_PROJECTILES ;
i++, pr++)
167 if (pr->modelindex < 1)
177 for (
j=0 ;
j<3 ;
j++)
180 (pr->origin[
j] - pr->oldorigin[
j]);
226 for (
i=0 ;
i<32 ;
i++)
393 int oldindex, oldnum;
409 oldnum = oldstate->
number;
425 while (oldnum < newnum)
438 oldnum = oldstate->
number;
446 if (oldnum != newnum)
456 oldnum = oldstate->
number;
461 if (oldnum == newnum)
474 oldnum = oldstate->
number;
490 while (oldnum != 99999)
503 oldnum = oldstate->
number;
528 memset (state, 0,
sizeof(*state));
628 if (statbits & (1<<
i) )
672 CL_ClearProjectiles();
702 Com_Printf (
"Delta from invalid frame (not supposed to happen!).\n");
711 Com_Printf (
"Delta parse_entities too old.\n");
742 if (cmd == svc_packetentities2)
743 CL_ParseProjectiles();
798 p = strchr(model,
'/');
805 strcpy(model,
"male");
847 unsigned int effects, renderfx;
853 autoanim = 2*
cl.
time/1000;
855 memset (&ent, 0,
sizeof(ent));
868 ent.
frame = autoanim & 1;
870 ent.
frame = 2 + (autoanim & 1);
872 ent.
frame = autoanim;
920 for (
i=0 ;
i<3 ;
i++)
955 if(!strncmp((
char *)ent.
skin,
"players/male", 12))
960 else if(!strncmp((
char *)ent.
skin,
"players/female", 14))
965 else if(!strncmp((
char *)ent.
skin,
"players/cyborg", 14))
990 ent.
flags = renderfx;
996 ent.
angles[1] = autorotate;
1018 for (
i=0 ;
i<3 ;
i++)
1216 else if (effects &
EF_GIB)
1228 else if (effects &
EF_BFG)
1230 static int bfg_lightramp[6] = {300, 400, 600, 300, 150, 75};
1239 i = bfg_lightramp[s1->
frame];
1248 i = (rand()%100) + 100;
1345 memset (&gun, 0,
sizeof(gun));
1355 for (
i=0 ;
i<3 ;
i++)
1394 float lerp, backlerp;
1421 backlerp = 1.0 - lerp;
1422 for (
i=0 ;
i<3 ;
i++)
1436 for (
i=0 ;
i<3 ;
i++)
1445 for (
i=0 ;
i<3 ;
i++)
1450 for (
i=0 ;
i<3 ;
i++)
1454 for (
i=0 ;
i<3 ;
i++)
1463 for (
i=0 ;
i<4 ;
i++)
1512 CL_AddProjectiles ();
struct image_s *(* RegisterSkin)(char *name)
void SCR_EndLoadingPlaque(void)
void CL_BlasterTrail(vec3_t start, vec3_t end)
frame_t frames[UPDATE_BACKUP]
#define RF_SHELL_HALF_DAM
void CL_AddEntities(void)
void CL_DiminishingTrail(vec3_t start, vec3_t end, centity_t *old, int flags)
#define PMF_NO_PREDICTION
int MSG_ReadShort(sizebuf_t *msg_read)
#define PS_M_DELTA_ANGLES
void CL_FlagTrail(vec3_t start, vec3_t end, float color)
int CL_ParseEntityBits(unsigned *bits)
just for protocol profiling
void CL_TeleporterParticles(entity_state_t *ent)
void CL_DeltaEntity(frame_t *frame, int newnum, entity_state_t *old, int bits)
void CL_AddViewWeapon(player_state_t *ps, player_state_t *ops)
void CL_Tracker_Shell(vec3_t origin)
void CL_BfgParticles(entity_t *ent)
struct model_s * gun_model
void CL_ParsePlayerstate(frame_t *oldframe, frame_t *newframe)
void CL_CalcViewValues(void)
byte areabits[MAX_MAP_AREAS/8]
clientinfo_t clientinfo[MAX_CLIENTS]
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
struct model_s * model_draw[MAX_MODELS]
void CL_TagTrail(vec3_t start, vec3_t end, float color)
void CL_TrackerTrail(vec3_t start, vec3_t end, int particleColor)
#define EF_BLUEHYPERBLASTER
float LerpAngle(float a2, float a1, float frac)
void CL_IonripperTrail(vec3_t start, vec3_t ent)
void CL_AddLightStyles(void)
int MSG_ReadByte(sizebuf_t *msg_read)
void CL_AddPacketEntities(frame_t *frame)
struct model_s * S_RegisterSexedModel(entity_state_t *ent, char *base)
void Com_Error(int code, char *fmt,...)
#define MAX_CLIENTWEAPONMODELS
#define EF_SPINNINGLIGHTS
clientinfo_t baseclientinfo
struct model_s *(* RegisterModel)(char *name)
float MSG_ReadCoord(sizebuf_t *msg_read)
unsigned predicted_step_time
void CL_GetEntitySoundOrigin(int ent, vec3_t org)
player_state_t playerstate
void V_AddEntity(entity_t *ent)
#define MAX_PARSE_ENTITIES
entity_state_t cl_parse_entities[MAX_PARSE_ENTITIES]
struct model_s * weaponmodel[MAX_CLIENTWEAPONMODELS]
void CL_CheckPredictionError(void)
int MSG_ReadLong(sizebuf_t *msg_read)
struct model_s * cl_mod_powerscreen
void MSG_ReadData(sizebuf_t *msg_read, void *data, int len)
float MSG_ReadAngle16(sizebuf_t *msg_read)
void VectorMA(vec3_t veca, float scale, vec3_t vecb, vec3_t vecc)
void CL_TrapParticles(entity_t *ent)
char configstrings[MAX_CONFIGSTRINGS][MAX_QPATH]
void CL_FireEntityEvents(frame_t *frame)
void CL_ParsePacketEntities(frame_t *oldframe, frame_t *newframe)
void MSG_ReadPos(sizebuf_t *msg_read, vec3_t pos)
void Com_Printf(char *fmt,...)
void CL_BlasterTrail2(vec3_t start, vec3_t end)
int Q_strcasecmp(char *s1, char *s2)
float MSG_ReadAngle(sizebuf_t *msg_read)
void CL_RocketTrail(vec3_t start, vec3_t end, centity_t *old)
void CL_AddParticles(void)
void CL_EntityEvent(entity_state_t *ent)
centity_t cl_entities[MAX_EDICTS]
int MSG_ReadChar(sizebuf_t *msg_read)
void CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits)
void Com_sprintf(char *dest, int size, char *fmt,...)
int Developer_searchpath(int who)
void V_AddLight(vec3_t org, float intensity, float r, float g, float b)
void CL_FlyEffect(centity_t *ent, vec3_t origin)