vkQuake2 doxygen  1.0 dev
cl_ents.c File Reference
#include "client.h"

Go to the source code of this file.

Functions

int CL_ParseEntityBits (unsigned *bits)
 just for protocol profiling More...
 
void CL_ParseDelta (entity_state_t *from, entity_state_t *to, int number, int bits)
 
void CL_DeltaEntity (frame_t *frame, int newnum, entity_state_t *old, int bits)
 
void CL_ParsePacketEntities (frame_t *oldframe, frame_t *newframe)
 
void CL_ParsePlayerstate (frame_t *oldframe, frame_t *newframe)
 
void CL_FireEntityEvents (frame_t *frame)
 
void CL_ParseFrame (void)
 
struct model_sS_RegisterSexedModel (entity_state_t *ent, char *base)
 
int Developer_searchpath (int who)
 
void CL_AddPacketEntities (frame_t *frame)
 
void CL_AddViewWeapon (player_state_t *ps, player_state_t *ops)
 
void CL_CalcViewValues (void)
 
void CL_AddEntities (void)
 
void CL_GetEntitySoundOrigin (int ent, vec3_t org)
 

Variables

struct model_scl_mod_powerscreen
 
int vidref_val
 
int bitcounts [32]
 

Function Documentation

◆ CL_AddEntities()

void CL_AddEntities ( void  )

Definition at line 1477 of file cl_ents.c.

1478 {
1479  if (cls.state != ca_active)
1480  return;
1481 
1482  if (cl.time > cl.frame.servertime)
1483  {
1484  if (cl_showclamp->value)
1485  Com_Printf ("high clamp %i\n", cl.time - cl.frame.servertime);
1487  cl.lerpfrac = 1.0;
1488  }
1489  else if (cl.time < cl.frame.servertime - 100)
1490  {
1491  if (cl_showclamp->value)
1492  Com_Printf ("low clamp %i\n", cl.frame.servertime-100 - cl.time);
1493  cl.time = cl.frame.servertime - 100;
1494  cl.lerpfrac = 0;
1495  }
1496  else
1497  cl.lerpfrac = 1.0 - (cl.frame.servertime - cl.time) * 0.01;
1498 
1499  if (cl_timedemo->value)
1500  cl.lerpfrac = 1.0;
1501 
1502 // CL_AddPacketEntities (&cl.frame);
1503 // CL_AddTEnts ();
1504 // CL_AddParticles ();
1505 // CL_AddDLights ();
1506 // CL_AddLightStyles ();
1507 
1508  CL_CalcViewValues ();
1509  // PMM - moved this here so the heat beam has the right values for the vieworg, and can lock the beam to the gun
1511 #if 0
1512  CL_AddProjectiles ();
1513 #endif
1514  CL_AddTEnts ();
1515  CL_AddParticles ();
1516  CL_AddDLights ();
1517  CL_AddLightStyles ();
1518 }

Referenced by V_RenderView().

◆ CL_AddPacketEntities()

void CL_AddPacketEntities ( frame_t frame)

Definition at line 837 of file cl_ents.c.

838 {
839  entity_t ent;
840  entity_state_t *s1;
841  float autorotate;
842  int i;
843  int pnum;
844  centity_t *cent;
845  int autoanim;
846  clientinfo_t *ci;
847  unsigned int effects, renderfx;
848 
849  // bonus items rotate at a fixed rate
850  autorotate = anglemod(cl.time/10);
851 
852  // brush models can auto animate their frames
853  autoanim = 2*cl.time/1000;
854 
855  memset (&ent, 0, sizeof(ent));
856 
857  for (pnum = 0 ; pnum<frame->num_entities ; pnum++)
858  {
859  s1 = &cl_parse_entities[(frame->parse_entities+pnum)&(MAX_PARSE_ENTITIES-1)];
860 
861  cent = &cl_entities[s1->number];
862 
863  effects = s1->effects;
864  renderfx = s1->renderfx;
865 
866  // set frame
867  if (effects & EF_ANIM01)
868  ent.frame = autoanim & 1;
869  else if (effects & EF_ANIM23)
870  ent.frame = 2 + (autoanim & 1);
871  else if (effects & EF_ANIM_ALL)
872  ent.frame = autoanim;
873  else if (effects & EF_ANIM_ALLFAST)
874  ent.frame = cl.time / 100;
875  else
876  ent.frame = s1->frame;
877 
878  // quad and pent can do different things on client
879  if (effects & EF_PENT)
880  {
881  effects &= ~EF_PENT;
882  effects |= EF_COLOR_SHELL;
883  renderfx |= RF_SHELL_RED;
884  }
885 
886  if (effects & EF_QUAD)
887  {
888  effects &= ~EF_QUAD;
889  effects |= EF_COLOR_SHELL;
890  renderfx |= RF_SHELL_BLUE;
891  }
892 //======
893 // PMM
894  if (effects & EF_DOUBLE)
895  {
896  effects &= ~EF_DOUBLE;
897  effects |= EF_COLOR_SHELL;
898  renderfx |= RF_SHELL_DOUBLE;
899  }
900 
901  if (effects & EF_HALF_DAMAGE)
902  {
903  effects &= ~EF_HALF_DAMAGE;
904  effects |= EF_COLOR_SHELL;
905  renderfx |= RF_SHELL_HALF_DAM;
906  }
907 // pmm
908 //======
909  ent.oldframe = cent->prev.frame;
910  ent.backlerp = 1.0 - cl.lerpfrac;
911 
912  if (renderfx & (RF_FRAMELERP|RF_BEAM))
913  { // step origin discretely, because the frames
914  // do the animation properly
915  VectorCopy (cent->current.origin, ent.origin);
916  VectorCopy (cent->current.old_origin, ent.oldorigin);
917  }
918  else
919  { // interpolate origin
920  for (i=0 ; i<3 ; i++)
921  {
922  ent.origin[i] = ent.oldorigin[i] = cent->prev.origin[i] + cl.lerpfrac *
923  (cent->current.origin[i] - cent->prev.origin[i]);
924  }
925  }
926 
927  // create a new entity
928 
929  // tweak the color of beams
930  if ( renderfx & RF_BEAM )
931  { // the four beam colors are encoded in 32 bits of skinnum (hack)
932  ent.alpha = 0.30;
933  ent.skinnum = (s1->skinnum >> ((rand() % 4)*8)) & 0xff;
934  ent.model = NULL;
935  }
936  else
937  {
938  // set skin
939  if (s1->modelindex == 255)
940  { // use custom player skin
941  ent.skinnum = 0;
942  ci = &cl.clientinfo[s1->skinnum & 0xff];
943  ent.skin = ci->skin;
944  ent.model = ci->model;
945  if (!ent.skin || !ent.model)
946  {
947  ent.skin = cl.baseclientinfo.skin;
949  }
950 
951 //============
952 //PGM
953  if (renderfx & RF_USE_DISGUISE)
954  {
955  if(!strncmp((char *)ent.skin, "players/male", 12))
956  {
957  ent.skin = re.RegisterSkin ("players/male/disguise.pcx");
958  ent.model = re.RegisterModel ("players/male/tris.md2");
959  }
960  else if(!strncmp((char *)ent.skin, "players/female", 14))
961  {
962  ent.skin = re.RegisterSkin ("players/female/disguise.pcx");
963  ent.model = re.RegisterModel ("players/female/tris.md2");
964  }
965  else if(!strncmp((char *)ent.skin, "players/cyborg", 14))
966  {
967  ent.skin = re.RegisterSkin ("players/cyborg/disguise.pcx");
968  ent.model = re.RegisterModel ("players/cyborg/tris.md2");
969  }
970  }
971 //PGM
972 //============
973  }
974  else
975  {
976  ent.skinnum = s1->skinnum;
977  ent.skin = NULL;
978  ent.model = cl.model_draw[s1->modelindex];
979  }
980  }
981 
982  // only used for black hole model right now, FIXME: do better
983  if (renderfx == RF_TRANSLUCENT)
984  ent.alpha = 0.70;
985 
986  // render effects (fullbright, translucent, etc)
987  if ((effects & EF_COLOR_SHELL))
988  ent.flags = 0; // renderfx go on color shell entity
989  else
990  ent.flags = renderfx;
991 
992  // calculate angles
993  if (effects & EF_ROTATE)
994  { // some bonus items auto-rotate
995  ent.angles[0] = 0;
996  ent.angles[1] = autorotate;
997  ent.angles[2] = 0;
998  }
999  // RAFAEL
1000  else if (effects & EF_SPINNINGLIGHTS)
1001  {
1002  ent.angles[0] = 0;
1003  ent.angles[1] = anglemod(cl.time/2) + s1->angles[1];
1004  ent.angles[2] = 180;
1005  {
1006  vec3_t forward;
1007  vec3_t start;
1008 
1009  AngleVectors (ent.angles, forward, NULL, NULL);
1010  VectorMA (ent.origin, 64, forward, start);
1011  V_AddLight (start, 100, 1, 0, 0);
1012  }
1013  }
1014  else
1015  { // interpolate angles
1016  float a1, a2;
1017 
1018  for (i=0 ; i<3 ; i++)
1019  {
1020  a1 = cent->current.angles[i];
1021  a2 = cent->prev.angles[i];
1022  ent.angles[i] = LerpAngle (a2, a1, cl.lerpfrac);
1023  }
1024  }
1025 
1026  if (s1->number == cl.playernum+1)
1027  {
1028  ent.flags |= RF_VIEWERMODEL; // only draw from mirrors
1029  // FIXME: still pass to refresh
1030 
1031  if (effects & EF_FLAG1)
1032  V_AddLight (ent.origin, 225, 1.0, 0.1, 0.1);
1033  else if (effects & EF_FLAG2)
1034  V_AddLight (ent.origin, 225, 0.1, 0.1, 1.0);
1035  else if (effects & EF_TAGTRAIL) //PGM
1036  V_AddLight (ent.origin, 225, 1.0, 1.0, 0.0); //PGM
1037  else if (effects & EF_TRACKERTRAIL) //PGM
1038  V_AddLight (ent.origin, 225, -1.0, -1.0, -1.0); //PGM
1039 
1040  continue;
1041  }
1042 
1043  // if set to invisible, skip
1044  if (!s1->modelindex)
1045  continue;
1046 
1047  if (effects & EF_BFG)
1048  {
1049  ent.flags |= RF_TRANSLUCENT;
1050  ent.alpha = 0.30;
1051  }
1052 
1053  // RAFAEL
1054  if (effects & EF_PLASMA)
1055  {
1056  ent.flags |= RF_TRANSLUCENT;
1057  ent.alpha = 0.6;
1058  }
1059 
1060  if (effects & EF_SPHERETRANS)
1061  {
1062  ent.flags |= RF_TRANSLUCENT;
1063  // PMM - *sigh* yet more EF overloading
1064  if (effects & EF_TRACKERTRAIL)
1065  ent.alpha = 0.6;
1066  else
1067  ent.alpha = 0.3;
1068  }
1069 //pmm
1070 
1071  // add to refresh list
1072  V_AddEntity (&ent);
1073 
1074 
1075  // color shells generate a seperate entity for the main model
1076  if (effects & EF_COLOR_SHELL)
1077  {
1078  // PMM - at this point, all of the shells have been handled
1079  // if we're in the rogue pack, set up the custom mixing, otherwise just
1080  // keep going
1081 // if(Developer_searchpath(2) == 2)
1082 // {
1083  // all of the solo colors are fine. we need to catch any of the combinations that look bad
1084  // (double & half) and turn them into the appropriate color, and make double/quad something special
1085  if (renderfx & RF_SHELL_HALF_DAM)
1086  {
1087  if(Developer_searchpath(2) == 2)
1088  {
1089  // ditch the half damage shell if any of red, blue, or double are on
1090  if (renderfx & (RF_SHELL_RED|RF_SHELL_BLUE|RF_SHELL_DOUBLE))
1091  renderfx &= ~RF_SHELL_HALF_DAM;
1092  }
1093  }
1094 
1095  if (renderfx & RF_SHELL_DOUBLE)
1096  {
1097  if(Developer_searchpath(2) == 2)
1098  {
1099  // lose the yellow shell if we have a red, blue, or green shell
1100  if (renderfx & (RF_SHELL_RED|RF_SHELL_BLUE|RF_SHELL_GREEN))
1101  renderfx &= ~RF_SHELL_DOUBLE;
1102  // if we have a red shell, turn it to purple by adding blue
1103  if (renderfx & RF_SHELL_RED)
1104  renderfx |= RF_SHELL_BLUE;
1105  // if we have a blue shell (and not a red shell), turn it to cyan by adding green
1106  else if (renderfx & RF_SHELL_BLUE)
1107  // go to green if it's on already, otherwise do cyan (flash green)
1108  if (renderfx & RF_SHELL_GREEN)
1109  renderfx &= ~RF_SHELL_BLUE;
1110  else
1111  renderfx |= RF_SHELL_GREEN;
1112  }
1113  }
1114 // }
1115  // pmm
1116  ent.flags = renderfx | RF_TRANSLUCENT;
1117  ent.alpha = 0.30;
1118  V_AddEntity (&ent);
1119  }
1120 
1121  ent.skin = NULL; // never use a custom skin on others
1122  ent.skinnum = 0;
1123  ent.flags = 0;
1124  ent.alpha = 0;
1125 
1126  // duplicate for linked models
1127  if (s1->modelindex2)
1128  {
1129  if (s1->modelindex2 == 255)
1130  { // custom weapon
1131  ci = &cl.clientinfo[s1->skinnum & 0xff];
1132  i = (s1->skinnum >> 8); // 0 is default weapon model
1133  if (!cl_vwep->value || i > MAX_CLIENTWEAPONMODELS - 1)
1134  i = 0;
1135  ent.model = ci->weaponmodel[i];
1136  if (!ent.model) {
1137  if (i != 0)
1138  ent.model = ci->weaponmodel[0];
1139  if (!ent.model)
1141  }
1142  }
1143  else
1144  ent.model = cl.model_draw[s1->modelindex2];
1145 
1146  // PMM - check for the defender sphere shell .. make it translucent
1147  // replaces the previous version which used the high bit on modelindex2 to determine transparency
1148  if (!Q_strcasecmp (cl.configstrings[CS_MODELS+(s1->modelindex2)], "models/items/shell/tris.md2"))
1149  {
1150  ent.alpha = 0.32;
1151  ent.flags = RF_TRANSLUCENT;
1152  }
1153  // pmm
1154 
1155  V_AddEntity (&ent);
1156 
1157  //PGM - make sure these get reset.
1158  ent.flags = 0;
1159  ent.alpha = 0;
1160  //PGM
1161  }
1162  if (s1->modelindex3)
1163  {
1164  ent.model = cl.model_draw[s1->modelindex3];
1165  V_AddEntity (&ent);
1166  }
1167  if (s1->modelindex4)
1168  {
1169  ent.model = cl.model_draw[s1->modelindex4];
1170  V_AddEntity (&ent);
1171  }
1172 
1173  if ( effects & EF_POWERSCREEN )
1174  {
1175  ent.model = cl_mod_powerscreen;
1176  ent.oldframe = 0;
1177  ent.frame = 0;
1178  ent.flags |= (RF_TRANSLUCENT | RF_SHELL_GREEN);
1179  ent.alpha = 0.30;
1180  V_AddEntity (&ent);
1181  }
1182 
1183  // add automatic particle trails
1184  if ( (effects&~EF_ROTATE) )
1185  {
1186  if (effects & EF_ROCKET)
1187  {
1188  CL_RocketTrail (cent->lerp_origin, ent.origin, cent);
1189  V_AddLight (ent.origin, 200, 1, 1, 0);
1190  }
1191  // PGM - Do not reorder EF_BLASTER and EF_HYPERBLASTER.
1192  // EF_BLASTER | EF_TRACKER is a special case for EF_BLASTER2... Cheese!
1193  else if (effects & EF_BLASTER)
1194  {
1195 // CL_BlasterTrail (cent->lerp_origin, ent.origin);
1196 //PGM
1197  if (effects & EF_TRACKER) // lame... problematic?
1198  {
1199  CL_BlasterTrail2 (cent->lerp_origin, ent.origin);
1200  V_AddLight (ent.origin, 200, 0, 1, 0);
1201  }
1202  else
1203  {
1204  CL_BlasterTrail (cent->lerp_origin, ent.origin);
1205  V_AddLight (ent.origin, 200, 1, 1, 0);
1206  }
1207 //PGM
1208  }
1209  else if (effects & EF_HYPERBLASTER)
1210  {
1211  if (effects & EF_TRACKER) // PGM overloaded for blaster2.
1212  V_AddLight (ent.origin, 200, 0, 1, 0); // PGM
1213  else // PGM
1214  V_AddLight (ent.origin, 200, 1, 1, 0);
1215  }
1216  else if (effects & EF_GIB)
1217  {
1218  CL_DiminishingTrail (cent->lerp_origin, ent.origin, cent, effects);
1219  }
1220  else if (effects & EF_GRENADE)
1221  {
1222  CL_DiminishingTrail (cent->lerp_origin, ent.origin, cent, effects);
1223  }
1224  else if (effects & EF_FLIES)
1225  {
1226  CL_FlyEffect (cent, ent.origin);
1227  }
1228  else if (effects & EF_BFG)
1229  {
1230  static int bfg_lightramp[6] = {300, 400, 600, 300, 150, 75};
1231 
1232  if (effects & EF_ANIM_ALLFAST)
1233  {
1234  CL_BfgParticles (&ent);
1235  i = 200;
1236  }
1237  else
1238  {
1239  i = bfg_lightramp[s1->frame];
1240  }
1241  V_AddLight (ent.origin, i, 0, 1, 0);
1242  }
1243  // RAFAEL
1244  else if (effects & EF_TRAP)
1245  {
1246  ent.origin[2] += 32;
1247  CL_TrapParticles (&ent);
1248  i = (rand()%100) + 100;
1249  V_AddLight (ent.origin, i, 1, 0.8, 0.1);
1250  }
1251  else if (effects & EF_FLAG1)
1252  {
1253  CL_FlagTrail (cent->lerp_origin, ent.origin, 242);
1254  V_AddLight (ent.origin, 225, 1, 0.1, 0.1);
1255  }
1256  else if (effects & EF_FLAG2)
1257  {
1258  CL_FlagTrail (cent->lerp_origin, ent.origin, 115);
1259  V_AddLight (ent.origin, 225, 0.1, 0.1, 1);
1260  }
1261 //======
1262 //ROGUE
1263  else if (effects & EF_TAGTRAIL)
1264  {
1265  CL_TagTrail (cent->lerp_origin, ent.origin, 220);
1266  V_AddLight (ent.origin, 225, 1.0, 1.0, 0.0);
1267  }
1268  else if (effects & EF_TRACKERTRAIL)
1269  {
1270  if (effects & EF_TRACKER)
1271  {
1272  float intensity;
1273 
1274  intensity = 50 + (500 * (sin(cl.time/500.0) + 1.0));
1275  // FIXME - check out this effect in rendition
1276  if(vidref_val == VIDREF_GL)
1277  V_AddLight (ent.origin, intensity, -1.0, -1.0, -1.0);
1278  else
1279  V_AddLight (ent.origin, -1.0 * intensity, 1.0, 1.0, 1.0);
1280  }
1281  else
1282  {
1283  CL_Tracker_Shell (cent->lerp_origin);
1284  V_AddLight (ent.origin, 155, -1.0, -1.0, -1.0);
1285  }
1286  }
1287  else if (effects & EF_TRACKER)
1288  {
1289  CL_TrackerTrail (cent->lerp_origin, ent.origin, 0);
1290  // FIXME - check out this effect in rendition
1291  if(vidref_val == VIDREF_GL)
1292  V_AddLight (ent.origin, 200, -1, -1, -1);
1293  else
1294  V_AddLight (ent.origin, -200, 1, 1, 1);
1295  }
1296 //ROGUE
1297 //======
1298  // RAFAEL
1299  else if (effects & EF_GREENGIB)
1300  {
1301  CL_DiminishingTrail (cent->lerp_origin, ent.origin, cent, effects);
1302  }
1303  // RAFAEL
1304  else if (effects & EF_IONRIPPER)
1305  {
1306  CL_IonripperTrail (cent->lerp_origin, ent.origin);
1307  V_AddLight (ent.origin, 100, 1, 0.5, 0.5);
1308  }
1309  // RAFAEL
1310  else if (effects & EF_BLUEHYPERBLASTER)
1311  {
1312  V_AddLight (ent.origin, 200, 0, 0, 1);
1313  }
1314  // RAFAEL
1315  else if (effects & EF_PLASMA)
1316  {
1317  if (effects & EF_ANIM_ALLFAST)
1318  {
1319  CL_BlasterTrail (cent->lerp_origin, ent.origin);
1320  }
1321  V_AddLight (ent.origin, 130, 1, 0.5, 0.5);
1322  }
1323  }
1324 
1325  VectorCopy (ent.origin, cent->lerp_origin);
1326  }
1327 }

Referenced by CL_AddEntities().

◆ CL_AddViewWeapon()

void CL_AddViewWeapon ( player_state_t ps,
player_state_t ops 
)

Definition at line 1336 of file cl_ents.c.

1337 {
1338  entity_t gun; // view model
1339  int i;
1340 
1341  // allow the gun to be completely removed
1342  if (!cl_gun->value)
1343  return;
1344 
1345  memset (&gun, 0, sizeof(gun));
1346 
1347  if (gun_model)
1348  gun.model = gun_model; // development tool
1349  else
1350  gun.model = cl.model_draw[ps->gunindex];
1351  if (!gun.model)
1352  return;
1353 
1354  // set up gun position
1355  for (i=0 ; i<3 ; i++)
1356  {
1357  gun.origin[i] = cl.refdef.vieworg[i] + ops->gunoffset[i]
1358  + cl.lerpfrac * (ps->gunoffset[i] - ops->gunoffset[i]);
1359  gun.angles[i] = cl.refdef.viewangles[i] + LerpAngle (ops->gunangles[i],
1360  ps->gunangles[i], cl.lerpfrac);
1361  }
1362 
1363  if (gun_frame)
1364  {
1365  gun.frame = gun_frame; // development tool
1366  gun.oldframe = gun_frame; // development tool
1367  }
1368  else
1369  {
1370  gun.frame = ps->gunframe;
1371  if (gun.frame == 0)
1372  gun.oldframe = 0; // just changed weapons, don't lerp from old
1373  else
1374  gun.oldframe = ops->gunframe;
1375  }
1376 
1378  gun.backlerp = 1.0 - cl.lerpfrac;
1379  VectorCopy (gun.origin, gun.oldorigin); // don't lerp at all
1380  V_AddEntity (&gun);
1381 }

Referenced by CL_CalcViewValues().

◆ CL_CalcViewValues()

void CL_CalcViewValues ( void  )

Definition at line 1391 of file cl_ents.c.

1392 {
1393  int i;
1394  float lerp, backlerp;
1395  centity_t *ent;
1396  frame_t *oldframe;
1397  player_state_t *ps, *ops;
1398 
1399  // find the previous frame to interpolate from
1400  ps = &cl.frame.playerstate;
1401  i = (cl.frame.serverframe - 1) & UPDATE_MASK;
1402  oldframe = &cl.frames[i];
1403  if (oldframe->serverframe != cl.frame.serverframe-1 || !oldframe->valid)
1404  oldframe = &cl.frame; // previous frame was dropped or involid
1405  ops = &oldframe->playerstate;
1406 
1407  // see if the player entity was teleported this frame
1408  if ( abs(ops->pmove.origin[0] - ps->pmove.origin[0]) > 256*8
1409  || abs(ops->pmove.origin[1] - ps->pmove.origin[1]) > 256*8
1410  || abs(ops->pmove.origin[2] - ps->pmove.origin[2]) > 256*8)
1411  ops = ps; // don't interpolate
1412 
1413  ent = &cl_entities[cl.playernum+1];
1414  lerp = cl.lerpfrac;
1415 
1416  // calculate the origin
1418  { // use predicted values
1419  unsigned delta;
1420 
1421  backlerp = 1.0 - lerp;
1422  for (i=0 ; i<3 ; i++)
1423  {
1425  + cl.lerpfrac * (ps->viewoffset[i] - ops->viewoffset[i])
1426  - backlerp * cl.prediction_error[i];
1427  }
1428 
1429  // smooth out stair climbing
1430  delta = cls.realtime - cl.predicted_step_time;
1431  if (delta < 100)
1432  cl.refdef.vieworg[2] -= cl.predicted_step * (100 - delta) * 0.01;
1433  }
1434  else
1435  { // just use interpolated values
1436  for (i=0 ; i<3 ; i++)
1437  cl.refdef.vieworg[i] = ops->pmove.origin[i]*0.125 + ops->viewoffset[i]
1438  + lerp * (ps->pmove.origin[i]*0.125 + ps->viewoffset[i]
1439  - (ops->pmove.origin[i]*0.125 + ops->viewoffset[i]) );
1440  }
1441 
1442  // if not running a demo or on a locked frame, add the local angle movement
1444  { // use predicted values
1445  for (i=0 ; i<3 ; i++)
1447  }
1448  else
1449  { // just use interpolated values
1450  for (i=0 ; i<3 ; i++)
1451  cl.refdef.viewangles[i] = LerpAngle (ops->viewangles[i], ps->viewangles[i], lerp);
1452  }
1453 
1454  for (i=0 ; i<3 ; i++)
1455  cl.refdef.viewangles[i] += LerpAngle (ops->kick_angles[i], ps->kick_angles[i], lerp);
1456 
1458 
1459  // interpolate field of view
1460  cl.refdef.fov_x = ops->fov + lerp * (ps->fov - ops->fov);
1461 
1462  // don't interpolate blend color
1463  for (i=0 ; i<4 ; i++)
1464  cl.refdef.blend[i] = ps->blend[i];
1465 
1466  // add the weapon
1467  CL_AddViewWeapon (ps, ops);
1468 }

Referenced by CL_AddEntities().

◆ CL_DeltaEntity()

void CL_DeltaEntity ( frame_t frame,
int  newnum,
entity_state_t old,
int  bits 
)

Definition at line 327 of file cl_ents.c.

328 {
329  centity_t *ent;
330  entity_state_t *state;
331 
332  ent = &cl_entities[newnum];
333 
335  cl.parse_entities++;
336  frame->num_entities++;
337 
338  CL_ParseDelta (old, state, newnum, bits);
339 
340  // some data changes will force no lerping
341  if (state->modelindex != ent->current.modelindex
342  || state->modelindex2 != ent->current.modelindex2
343  || state->modelindex3 != ent->current.modelindex3
344  || state->modelindex4 != ent->current.modelindex4
345  || fabs(state->origin[0] - ent->current.origin[0]) > 512
346  || fabs(state->origin[1] - ent->current.origin[1]) > 512
347  || fabs(state->origin[2] - ent->current.origin[2]) > 512
348  || state->event == EV_PLAYER_TELEPORT
349  || state->event == EV_OTHER_TELEPORT
350  )
351  {
352  ent->serverframe = -99;
353  }
354 
355  if (ent->serverframe != cl.frame.serverframe - 1)
356  { // wasn't in last update, so initialize some things
357  ent->trailcount = 1024; // for diminishing rocket / grenade trails
358  // duplicate the current state so lerping doesn't hurt anything
359  ent->prev = *state;
360  if (state->event == EV_OTHER_TELEPORT)
361  {
362  VectorCopy (state->origin, ent->prev.origin);
363  VectorCopy (state->origin, ent->lerp_origin);
364  }
365  else
366  {
367  VectorCopy (state->old_origin, ent->prev.origin);
368  VectorCopy (state->old_origin, ent->lerp_origin);
369  }
370  }
371  else
372  { // shuffle the last state to previous
373  ent->prev = ent->current;
374  }
375 
377  ent->current = *state;
378 }

Referenced by CL_ParsePacketEntities().

◆ CL_FireEntityEvents()

void CL_FireEntityEvents ( frame_t frame)

Definition at line 639 of file cl_ents.c.

640 {
641  entity_state_t *s1;
642  int pnum, num;
643 
644  for (pnum = 0 ; pnum<frame->num_entities ; pnum++)
645  {
646  num = (frame->parse_entities + pnum)&(MAX_PARSE_ENTITIES-1);
647  s1 = &cl_parse_entities[num];
648  if (s1->event)
649  CL_EntityEvent (s1);
650 
651  // EF_TELEPORTER acts like an event, but is not cleared each frame
652  if (s1->effects & EF_TELEPORTER)
654  }
655 }

Referenced by CL_ParseFrame().

◆ CL_GetEntitySoundOrigin()

void CL_GetEntitySoundOrigin ( int  ent,
vec3_t  org 
)

Definition at line 1529 of file cl_ents.c.

1530 {
1531  centity_t *old;
1532 
1533  if (ent < 0 || ent >= MAX_EDICTS)
1534  Com_Error (ERR_DROP, "CL_GetEntitySoundOrigin: bad ent");
1535  old = &cl_entities[ent];
1536  VectorCopy (old->lerp_origin, org);
1537 
1538  // FIXME: bmodel issues...
1539 }

Referenced by S_Spatialize().

◆ CL_ParseDelta()

void CL_ParseDelta ( entity_state_t from,
entity_state_t to,
int  number,
int  bits 
)

Definition at line 247 of file cl_ents.c.

248 {
249  // set everything to the state we are delta'ing from
250  *to = *from;
251 
252  VectorCopy (from->origin, to->old_origin);
253  to->number = number;
254 
255  if (bits & U_MODEL)
257  if (bits & U_MODEL2)
259  if (bits & U_MODEL3)
261  if (bits & U_MODEL4)
263 
264  if (bits & U_FRAME8)
265  to->frame = MSG_ReadByte (&net_message);
266  if (bits & U_FRAME16)
268 
269  if ((bits & U_SKIN8) && (bits & U_SKIN16)) //used for laser colors
271  else if (bits & U_SKIN8)
273  else if (bits & U_SKIN16)
275 
276  if ( (bits & (U_EFFECTS8|U_EFFECTS16)) == (U_EFFECTS8|U_EFFECTS16) )
278  else if (bits & U_EFFECTS8)
280  else if (bits & U_EFFECTS16)
282 
283  if ( (bits & (U_RENDERFX8|U_RENDERFX16)) == (U_RENDERFX8|U_RENDERFX16) )
285  else if (bits & U_RENDERFX8)
287  else if (bits & U_RENDERFX16)
289 
290  if (bits & U_ORIGIN1)
291  to->origin[0] = MSG_ReadCoord (&net_message);
292  if (bits & U_ORIGIN2)
293  to->origin[1] = MSG_ReadCoord (&net_message);
294  if (bits & U_ORIGIN3)
295  to->origin[2] = MSG_ReadCoord (&net_message);
296 
297  if (bits & U_ANGLE1)
298  to->angles[0] = MSG_ReadAngle(&net_message);
299  if (bits & U_ANGLE2)
300  to->angles[1] = MSG_ReadAngle(&net_message);
301  if (bits & U_ANGLE3)
302  to->angles[2] = MSG_ReadAngle(&net_message);
303 
304  if (bits & U_OLDORIGIN)
306 
307  if (bits & U_SOUND)
308  to->sound = MSG_ReadByte (&net_message);
309 
310  if (bits & U_EVENT)
311  to->event = MSG_ReadByte (&net_message);
312  else
313  to->event = 0;
314 
315  if (bits & U_SOLID)
317 }

Referenced by CL_DeltaEntity(), and CL_ParseBaseline().

◆ CL_ParseEntityBits()

int CL_ParseEntityBits ( unsigned *  bits)

just for protocol profiling

Definition at line 202 of file cl_ents.c.

203 {
204  unsigned b, total;
205  int i;
206  int number;
207 
208  total = MSG_ReadByte (&net_message);
209  if (total & U_MOREBITS1)
210  {
211  b = MSG_ReadByte (&net_message);
212  total |= b<<8;
213  }
214  if (total & U_MOREBITS2)
215  {
216  b = MSG_ReadByte (&net_message);
217  total |= b<<16;
218  }
219  if (total & U_MOREBITS3)
220  {
221  b = MSG_ReadByte (&net_message);
222  total |= b<<24;
223  }
224 
225  // count the bits for net profiling
226  for (i=0 ; i<32 ; i++)
227  if (total&(1<<i))
228  bitcounts[i]++;
229 
230  if (total & U_NUMBER16)
231  number = MSG_ReadShort (&net_message);
232  else
233  number = MSG_ReadByte (&net_message);
234 
235  *bits = total;
236 
237  return number;
238 }

Referenced by CL_ParseBaseline(), and CL_ParsePacketEntities().

◆ CL_ParseFrame()

void CL_ParseFrame ( void  )

Definition at line 663 of file cl_ents.c.

664 {
665  int cmd;
666  int len;
667  frame_t *old;
668 
669  memset (&cl.frame, 0, sizeof(cl.frame));
670 
671 #if 0
672  CL_ClearProjectiles(); // clear projectiles for new frame
673 #endif
674 
678 
679  // BIG HACK to let old demos continue to work
680  if (cls.serverProtocol != 26)
682 
683  if (cl_shownet->value == 3)
684  Com_Printf (" frame:%i delta:%i\n", cl.frame.serverframe,
686 
687  // If the frame is delta compressed from data that we
688  // no longer have available, we must suck up the rest of
689  // the frame, but not use it, then ask for a non-compressed
690  // message
691  if (cl.frame.deltaframe <= 0)
692  {
693  cl.frame.valid = true; // uncompressed frame
694  old = NULL;
695  cls.demowaiting = false; // we can start recording now
696  }
697  else
698  {
700  if (!old->valid)
701  { // should never happen
702  Com_Printf ("Delta from invalid frame (not supposed to happen!).\n");
703  }
704  if (old->serverframe != cl.frame.deltaframe)
705  { // The frame that the server did the delta from
706  // is too old, so we can't reconstruct it properly.
707  Com_Printf ("Delta frame too old.\n");
708  }
709  else if (cl.parse_entities - old->parse_entities > MAX_PARSE_ENTITIES-128)
710  {
711  Com_Printf ("Delta parse_entities too old.\n");
712  }
713  else
714  cl.frame.valid = true; // valid delta parse
715  }
716 
717  // clamp time
718  if (cl.time > cl.frame.servertime)
720  else if (cl.time < cl.frame.servertime - 100)
721  cl.time = cl.frame.servertime - 100;
722 
723  // read areabits
724  len = MSG_ReadByte (&net_message);
726 
727  // read playerinfo
728  cmd = MSG_ReadByte (&net_message);
729  SHOWNET(svc_strings[cmd]);
730  if (cmd != svc_playerinfo)
731  Com_Error (ERR_DROP, "CL_ParseFrame: not playerinfo");
732  CL_ParsePlayerstate (old, &cl.frame);
733 
734  // read packet entities
735  cmd = MSG_ReadByte (&net_message);
736  SHOWNET(svc_strings[cmd]);
737  if (cmd != svc_packetentities)
738  Com_Error (ERR_DROP, "CL_ParseFrame: not packetentities");
740 
741 #if 0
742  if (cmd == svc_packetentities2)
743  CL_ParseProjectiles();
744 #endif
745 
746  // save the frame off in the backup array for later delta comparisons
748 
749  if (cl.frame.valid)
750  {
751  // getting a valid frame message ends the connection process
752  if (cls.state != ca_active)
753  {
754  cls.state = ca_active;
755  cl.force_refdef = true;
761  && cl.refresh_prepped)
762  SCR_EndLoadingPlaque (); // get rid of loading plaque
763  }
764  cl.sound_prepped = true; // can start mixing ambient sounds
765 
766  // fire entity events
769  }
770 }

Referenced by CL_ParseServerMessage().

◆ CL_ParsePacketEntities()

void CL_ParsePacketEntities ( frame_t oldframe,
frame_t newframe 
)

Definition at line 388 of file cl_ents.c.

389 {
390  int newnum;
391  int bits;
392  entity_state_t *oldstate = NULL;
393  int oldindex, oldnum;
394 
395  newframe->parse_entities = cl.parse_entities;
396  newframe->num_entities = 0;
397 
398  // delta from the entities present in oldframe
399  oldindex = 0;
400  if (!oldframe)
401  oldnum = 99999;
402  else
403  {
404  if (oldindex >= oldframe->num_entities)
405  oldnum = 99999;
406  else
407  {
408  oldstate = &cl_parse_entities[(oldframe->parse_entities+oldindex) & (MAX_PARSE_ENTITIES-1)];
409  oldnum = oldstate->number;
410  }
411  }
412 
413  while (1)
414  {
415  newnum = CL_ParseEntityBits (&bits);
416  if (newnum >= MAX_EDICTS)
417  Com_Error (ERR_DROP,"CL_ParsePacketEntities: bad number:%i", newnum);
418 
420  Com_Error (ERR_DROP,"CL_ParsePacketEntities: end of message");
421 
422  if (!newnum)
423  break;
424 
425  while (oldnum < newnum)
426  { // one or more entities from the old packet are unchanged
427  if (cl_shownet->value == 3)
428  Com_Printf (" unchanged: %i\n", oldnum);
429  CL_DeltaEntity (newframe, oldnum, oldstate, 0);
430 
431  oldindex++;
432 
433  if (oldindex >= oldframe->num_entities)
434  oldnum = 99999;
435  else
436  {
437  oldstate = &cl_parse_entities[(oldframe->parse_entities+oldindex) & (MAX_PARSE_ENTITIES-1)];
438  oldnum = oldstate->number;
439  }
440  }
441 
442  if (bits & U_REMOVE)
443  { // the entity present in oldframe is not in the current frame
444  if (cl_shownet->value == 3)
445  Com_Printf (" remove: %i\n", newnum);
446  if (oldnum != newnum)
447  Com_Printf ("U_REMOVE: oldnum != newnum\n");
448 
449  oldindex++;
450 
451  if (oldindex >= oldframe->num_entities)
452  oldnum = 99999;
453  else
454  {
455  oldstate = &cl_parse_entities[(oldframe->parse_entities+oldindex) & (MAX_PARSE_ENTITIES-1)];
456  oldnum = oldstate->number;
457  }
458  continue;
459  }
460 
461  if (oldnum == newnum)
462  { // delta from previous state
463  if (cl_shownet->value == 3)
464  Com_Printf (" delta: %i\n", newnum);
465  CL_DeltaEntity (newframe, newnum, oldstate, bits);
466 
467  oldindex++;
468 
469  if (oldindex >= oldframe->num_entities)
470  oldnum = 99999;
471  else
472  {
473  oldstate = &cl_parse_entities[(oldframe->parse_entities+oldindex) & (MAX_PARSE_ENTITIES-1)];
474  oldnum = oldstate->number;
475  }
476  continue;
477  }
478 
479  if (oldnum > newnum)
480  { // delta from baseline
481  if (cl_shownet->value == 3)
482  Com_Printf (" baseline: %i\n", newnum);
483  CL_DeltaEntity (newframe, newnum, &cl_entities[newnum].baseline, bits);
484  continue;
485  }
486 
487  }
488 
489  // any remaining entities in the old frame are copied over
490  while (oldnum != 99999)
491  { // one or more entities from the old packet are unchanged
492  if (cl_shownet->value == 3)
493  Com_Printf (" unchanged: %i\n", oldnum);
494  CL_DeltaEntity (newframe, oldnum, oldstate, 0);
495 
496  oldindex++;
497 
498  if (oldindex >= oldframe->num_entities)
499  oldnum = 99999;
500  else
501  {
502  oldstate = &cl_parse_entities[(oldframe->parse_entities+oldindex) & (MAX_PARSE_ENTITIES-1)];
503  oldnum = oldstate->number;
504  }
505  }
506 }

Referenced by CL_ParseFrame().

◆ CL_ParsePlayerstate()

void CL_ParsePlayerstate ( frame_t oldframe,
frame_t newframe 
)

Definition at line 515 of file cl_ents.c.

516 {
517  int flags;
518  player_state_t *state;
519  int i;
520  int statbits;
521 
522  state = &newframe->playerstate;
523 
524  // clear to old value before delta parsing
525  if (oldframe)
526  *state = oldframe->playerstate;
527  else
528  memset (state, 0, sizeof(*state));
529 
530  flags = MSG_ReadShort (&net_message);
531 
532  //
533  // parse the pmove_state_t
534  //
535  if (flags & PS_M_TYPE)
537 
538  if (flags & PS_M_ORIGIN)
539  {
540  state->pmove.origin[0] = MSG_ReadShort (&net_message);
541  state->pmove.origin[1] = MSG_ReadShort (&net_message);
542  state->pmove.origin[2] = MSG_ReadShort (&net_message);
543  }
544 
545  if (flags & PS_M_VELOCITY)
546  {
547  state->pmove.velocity[0] = MSG_ReadShort (&net_message);
548  state->pmove.velocity[1] = MSG_ReadShort (&net_message);
549  state->pmove.velocity[2] = MSG_ReadShort (&net_message);
550  }
551 
552  if (flags & PS_M_TIME)
554 
555  if (flags & PS_M_FLAGS)
557 
558  if (flags & PS_M_GRAVITY)
560 
561  if (flags & PS_M_DELTA_ANGLES)
562  {
566  }
567 
568  if (cl.attractloop)
569  state->pmove.pm_type = PM_FREEZE; // demo playback
570 
571  //
572  // parse the rest of the player_state_t
573  //
574  if (flags & PS_VIEWOFFSET)
575  {
576  state->viewoffset[0] = MSG_ReadChar (&net_message) * 0.25;
577  state->viewoffset[1] = MSG_ReadChar (&net_message) * 0.25;
578  state->viewoffset[2] = MSG_ReadChar (&net_message) * 0.25;
579  }
580 
581  if (flags & PS_VIEWANGLES)
582  {
583  state->viewangles[0] = MSG_ReadAngle16 (&net_message);
584  state->viewangles[1] = MSG_ReadAngle16 (&net_message);
585  state->viewangles[2] = MSG_ReadAngle16 (&net_message);
586  }
587 
588  if (flags & PS_KICKANGLES)
589  {
590  state->kick_angles[0] = MSG_ReadChar (&net_message) * 0.25;
591  state->kick_angles[1] = MSG_ReadChar (&net_message) * 0.25;
592  state->kick_angles[2] = MSG_ReadChar (&net_message) * 0.25;
593  }
594 
595  if (flags & PS_WEAPONINDEX)
596  {
597  state->gunindex = MSG_ReadByte (&net_message);
598  }
599 
600  if (flags & PS_WEAPONFRAME)
601  {
602  state->gunframe = MSG_ReadByte (&net_message);
603  state->gunoffset[0] = MSG_ReadChar (&net_message)*0.25;
604  state->gunoffset[1] = MSG_ReadChar (&net_message)*0.25;
605  state->gunoffset[2] = MSG_ReadChar (&net_message)*0.25;
606  state->gunangles[0] = MSG_ReadChar (&net_message)*0.25;
607  state->gunangles[1] = MSG_ReadChar (&net_message)*0.25;
608  state->gunangles[2] = MSG_ReadChar (&net_message)*0.25;
609  }
610 
611  if (flags & PS_BLEND)
612  {
613  state->blend[0] = MSG_ReadByte (&net_message)/255.0;
614  state->blend[1] = MSG_ReadByte (&net_message)/255.0;
615  state->blend[2] = MSG_ReadByte (&net_message)/255.0;
616  state->blend[3] = MSG_ReadByte (&net_message)/255.0;
617  }
618 
619  if (flags & PS_FOV)
620  state->fov = MSG_ReadByte (&net_message);
621 
622  if (flags & PS_RDFLAGS)
623  state->rdflags = MSG_ReadByte (&net_message);
624 
625  // parse stats
626  statbits = MSG_ReadLong (&net_message);
627  for (i=0 ; i<MAX_STATS ; i++)
628  if (statbits & (1<<i) )
629  state->stats[i] = MSG_ReadShort(&net_message);
630 }

Referenced by CL_ParseFrame().

◆ Developer_searchpath()

int Developer_searchpath ( int  who)

Definition at line 159 of file files.c.

160 {
161 
162  int ch;
163  // PMM - warning removal
164 // char *start;
165  searchpath_t *search;
166 
167  if (who == 1) // xatrix
168  ch = 'x';
169  else if (who == 2)
170  ch = 'r';
171 
172  for (search = fs_searchpaths ; search ; search = search->next)
173  {
174  if (strstr (search->filename, "xatrix"))
175  return 1;
176 
177  if (strstr (search->filename, "rogue"))
178  return 2;
179 /*
180  start = strchr (search->filename, ch);
181 
182  if (start == NULL)
183  continue;
184 
185  if (strcmp (start ,"xatrix") == 0)
186  return (1);
187 */
188  }
189  return (0);
190 
191 }

Referenced by CL_AddPacketEntities().

◆ S_RegisterSexedModel()

struct model_s* S_RegisterSexedModel ( entity_state_t ent,
char *  base 
)

Definition at line 780 of file cl_ents.c.

781 {
782  int n;
783  char *p;
784  struct model_s *mdl;
785  char model[MAX_QPATH];
786  char buffer[MAX_QPATH];
787 
788  // determine what model the client is using
789  model[0] = 0;
790  n = CS_PLAYERSKINS + ent->number - 1;
791  if (cl.configstrings[n][0])
792  {
793  p = strchr(cl.configstrings[n], '\\');
794  if (p)
795  {
796  p += 1;
797  strcpy(model, p);
798  p = strchr(model, '/');
799  if (p)
800  *p = 0;
801  }
802  }
803  // if we can't figure it out, they're male
804  if (!model[0])
805  strcpy(model, "male");
806 
807  Com_sprintf (buffer, sizeof(buffer), "players/%s/%s", model, base+1);
808  mdl = re.RegisterModel(buffer);
809  if (!mdl) {
810  // not found, try default weapon model
811  Com_sprintf (buffer, sizeof(buffer), "players/%s/weapon.md2", model);
812  mdl = re.RegisterModel(buffer);
813  if (!mdl) {
814  // no, revert to the male model
815  Com_sprintf (buffer, sizeof(buffer), "players/%s/%s", "male", base+1);
816  mdl = re.RegisterModel(buffer);
817  if (!mdl) {
818  // last try, default male weapon.md2
819  Com_sprintf (buffer, sizeof(buffer), "players/male/weapon.md2");
820  mdl = re.RegisterModel(buffer);
821  }
822  }
823  }
824 
825  return mdl;
826 }

Variable Documentation

◆ bitcounts

int bitcounts[32]

Definition at line 201 of file cl_ents.c.

Referenced by CL_ParseEntityBits().

◆ cl_mod_powerscreen

struct model_s* cl_mod_powerscreen

Definition at line 107 of file cl_tent.c.

Referenced by CL_AddPacketEntities(), and CL_RegisterTEntModels().

◆ vidref_val

int vidref_val
entity_state_s::old_origin
vec3_t old_origin
Definition: q_shared.h:1151
RF_TRANSLUCENT
#define RF_TRANSLUCENT
Definition: q_shared.h:604
refexport_t::RegisterSkin
struct image_s *(* RegisterSkin)(char *name)
Definition: ref.h:159
EF_TELEPORTER
#define EF_TELEPORTER
Definition: q_shared.h:578
refdef_t::vieworg
float vieworg[3]
Definition: ref.h:106
SCR_EndLoadingPlaque
void SCR_EndLoadingPlaque(void)
Definition: cl_scrn.c:590
EF_TAGTRAIL
#define EF_TAGTRAIL
Definition: q_shared.h:593
RF_SHELL_RED
#define RF_SHELL_RED
Definition: q_shared.h:609
client_state_t::predicted_origin
vec3_t predicted_origin
Definition: client.h:112
entity_s::skin
struct image_s * skin
Definition: ref.h:75
searchpath_s::filename
char filename[MAX_OSPATH]
Definition: files.c:78
player_state_t::gunframe
int gunframe
Definition: q_shared.h:1188
client_state_t::servercount
int servercount
Definition: client.h:154
EF_GREENGIB
#define EF_GREENGIB
Definition: q_shared.h:583
MAX_QPATH
#define MAX_QPATH
Definition: q_shared.h:80
entity_s::origin
float origin[3]
Definition: ref.h:57
entity_s::model
struct model_s * model
Definition: ref.h:51
entity_state_s::modelindex4
int modelindex4
Definition: q_shared.h:1153
CL_BlasterTrail
void CL_BlasterTrail(vec3_t start, vec3_t end)
Definition: cl_fx.c:1284
entity_state_s::solid
int solid
Definition: q_shared.h:1158
U_ANGLE2
#define U_ANGLE2
Definition: qcommon.h:317
U_MOREBITS3
#define U_MOREBITS3
Definition: qcommon.h:341
client_state_t::frames
frame_t frames[UPDATE_BACKUP]
Definition: client.h:118
RF_MINLIGHT
#define RF_MINLIGHT
Definition: q_shared.h:599
EF_DOUBLE
#define EF_DOUBLE
Definition: q_shared.h:591
U_ANGLE1
#define U_ANGLE1
Definition: qcommon.h:327
RF_SHELL_HALF_DAM
#define RF_SHELL_HALF_DAM
Definition: q_shared.h:616
client_state_t::attractloop
qboolean attractloop
Definition: client.h:153
entity_state_s::frame
int frame
Definition: q_shared.h:1154
PS_M_ORIGIN
#define PS_M_ORIGIN
Definition: qcommon.h:268
client_state_t::v_forward
vec3_t v_forward
Definition: client.h:133
EV_PLAYER_TELEPORT
@ EV_PLAYER_TELEPORT
Definition: q_shared.h:1137
CL_DiminishingTrail
void CL_DiminishingTrail(vec3_t start, vec3_t end, centity_t *old, int flags)
Definition: cl_fx.c:1435
EF_IONRIPPER
#define EF_IONRIPPER
Definition: q_shared.h:582
EF_FLAG2
#define EF_FLAG2
Definition: q_shared.h:580
PS_M_FLAGS
#define PS_M_FLAGS
Definition: qcommon.h:271
EF_TRACKERTRAIL
#define EF_TRACKERTRAIL
Definition: q_shared.h:595
client_state_t::v_up
vec3_t v_up
Definition: client.h:133
RF_SHELL_GREEN
#define RF_SHELL_GREEN
Definition: q_shared.h:610
EF_QUAD
#define EF_QUAD
Definition: q_shared.h:576
PMF_NO_PREDICTION
#define PMF_NO_PREDICTION
Definition: q_shared.h:487
entity_state_s::renderfx
int renderfx
Definition: q_shared.h:1157
MSG_ReadShort
int MSG_ReadShort(sizebuf_t *msg_read)
Definition: common.c:716
PM_FREEZE
@ PM_FREEZE
Definition: q_shared.h:477
net_message
sizebuf_t net_message
Definition: net_chan.c:82
player_state_t::gunangles
vec3_t gunangles
Definition: q_shared.h:1185
entity_state_s
Definition: q_shared.h:1145
cl_shownet
cvar_t * cl_shownet
Definition: cl_main.c:56
U_ORIGIN1
#define U_ORIGIN1
Definition: qcommon.h:315
EF_FLIES
#define EF_FLIES
Definition: q_shared.h:575
frame_t::parse_entities
int parse_entities
Definition: client.h:52
entity_state_s::origin
vec3_t origin
Definition: q_shared.h:1149
PS_M_VELOCITY
#define PS_M_VELOCITY
Definition: qcommon.h:269
PS_M_DELTA_ANGLES
#define PS_M_DELTA_ANGLES
Definition: qcommon.h:273
player_state_t::gunoffset
vec3_t gunoffset
Definition: q_shared.h:1186
client_state_t::prediction_error
vec3_t prediction_error
Definition: client.h:114
CL_FlagTrail
void CL_FlagTrail(vec3_t start, vec3_t end, float color)
Definition: cl_fx.c:1385
EF_ANIM01
#define EF_ANIM01
Definition: q_shared.h:571
CL_ParseEntityBits
int CL_ParseEntityBits(unsigned *bits)
just for protocol profiling
Definition: cl_ents.c:202
client_state_t::predicted_angles
vec3_t predicted_angles
Definition: client.h:113
U_RENDERFX8
#define U_RENDERFX8
Definition: qcommon.h:329
sizebuf_s::readcount
int readcount
Definition: qcommon.h:99
U_OLDORIGIN
#define U_OLDORIGIN
Definition: qcommon.h:344
CS_MODELS
#define CS_MODELS
Definition: q_shared.h:1112
CL_TeleporterParticles
void CL_TeleporterParticles(entity_state_t *ent)
Definition: cl_fx.c:1033
client_static_t::disable_servercount
int disable_servercount
Definition: client.h:215
entity_s::skinnum
int skinnum
Definition: ref.h:70
pmove_state_t::gravity
short gravity
Definition: q_shared.h:502
i
int i
Definition: q_shared.c:305
CL_DeltaEntity
void CL_DeltaEntity(frame_t *frame, int newnum, entity_state_t *old, int bits)
Definition: cl_ents.c:327
frame_t::num_entities
int num_entities
Definition: client.h:51
ca_active
@ ca_active
Definition: client.h:189
vidref_val
int vidref_val
Definition: cl_ents.c:28
PS_KICKANGLES
#define PS_KICKANGLES
Definition: qcommon.h:277
U_MODEL
#define U_MODEL
Definition: qcommon.h:328
CL_AddViewWeapon
void CL_AddViewWeapon(player_state_t *ps, player_state_t *ops)
Definition: cl_ents.c:1336
CL_Tracker_Shell
void CL_Tracker_Shell(vec3_t origin)
Definition: cl_newfx.c:898
buffer
GLenum GLfloat * buffer
Definition: qgl_win.c:151
EF_BFG
#define EF_BFG
Definition: q_shared.h:568
model_s
Definition: r_model.h:171
entity_state_s::event
int event
Definition: q_shared.h:1162
svc_playerinfo
@ svc_playerinfo
Definition: qcommon.h:243
PS_RDFLAGS
#define PS_RDFLAGS
Definition: qcommon.h:282
entity_s::flags
int flags
Definition: ref.h:76
pmove_state_t::velocity
short velocity[3]
Definition: q_shared.h:499
client_state_t::refdef
refdef_t refdef
Definition: client.h:131
player_state_t::fov
float fov
Definition: q_shared.h:1192
PS_M_TIME
#define PS_M_TIME
Definition: qcommon.h:270
EF_PENT
#define EF_PENT
Definition: q_shared.h:577
CL_BfgParticles
void CL_BfgParticles(entity_t *ent)
Definition: cl_fx.c:1925
cl_gun
cvar_t * cl_gun
Definition: cl_main.c:49
gun_model
struct model_s * gun_model
Definition: cl_view.c:29
EF_TRACKER
#define EF_TRACKER
Definition: q_shared.h:590
player_state_t::rdflags
int rdflags
Definition: q_shared.h:1194
U_MODEL2
#define U_MODEL2
Definition: qcommon.h:338
CL_ParsePlayerstate
void CL_ParsePlayerstate(frame_t *oldframe, frame_t *newframe)
Definition: cl_ents.c:515
entity_state_s::modelindex3
int modelindex3
Definition: q_shared.h:1153
CL_CalcViewValues
void CL_CalcViewValues(void)
Definition: cl_ents.c:1391
anglemod
float anglemod(float a)
Definition: q_shared.c:293
client_state_t::force_refdef
qboolean force_refdef
Definition: client.h:100
PS_WEAPONINDEX
#define PS_WEAPONINDEX
Definition: qcommon.h:280
frame_t::areabits
byte areabits[MAX_MAP_AREAS/8]
Definition: client.h:49
intensity
cvar_t * intensity
Definition: gl_image.c:31
CL_AddTEnts
void CL_AddTEnts(void)
Definition: cl_tent.c:1738
entity_state_s::effects
unsigned int effects
Definition: q_shared.h:1156
client_state_t::clientinfo
clientinfo_t clientinfo[MAX_CLIENTS]
Definition: client.h:169
bitcounts
int bitcounts[32]
Definition: cl_ents.c:201
EF_GRENADE
#define EF_GRENADE
Definition: q_shared.h:566
entity_state_s::sound
int sound
Definition: q_shared.h:1161
EF_COLOR_SHELL
#define EF_COLOR_SHELL
Definition: q_shared.h:569
U_ANGLE3
#define U_ANGLE3
Definition: qcommon.h:318
centity_t::lerp_origin
vec3_t lerp_origin
Definition: client.h:64
AngleVectors
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
Definition: q_shared.c:93
U_SOUND
#define U_SOUND
Definition: qcommon.h:346
RF_WEAPONMODEL
#define RF_WEAPONMODEL
Definition: q_shared.h:601
searchpath_s::next
struct searchpath_s * next
Definition: files.c:80
RF_BEAM
#define RF_BEAM
Definition: q_shared.h:606
EF_FLAG1
#define EF_FLAG1
Definition: q_shared.h:579
SHOWNET
void SHOWNET(char *s)
Definition: cl_parse.c:650
MAX_STATS
#define MAX_STATS
Definition: q_shared.h:1020
searchpath_s
Definition: files.c:76
clientinfo_t::model
struct model_s * model
Definition: client.h:78
EF_ROCKET
#define EF_ROCKET
Definition: q_shared.h:565
entity_s::alpha
float alpha
Definition: ref.h:73
client_state_t::model_draw
struct model_s * model_draw[MAX_MODELS]
Definition: client.h:163
pmove_state_t::pm_type
pmtype_t pm_type
Definition: q_shared.h:496
U_EVENT
#define U_EVENT
Definition: qcommon.h:320
VIDREF_GL
#define VIDREF_GL
Definition: q_shared.h:1203
centity_t
Definition: client.h:55
client_static_t::demowaiting
qboolean demowaiting
Definition: client.h:238
U_EFFECTS16
#define U_EFFECTS16
Definition: qcommon.h:337
U_ORIGIN2
#define U_ORIGIN2
Definition: qcommon.h:316
player_state_t::viewangles
vec3_t viewangles
Definition: q_shared.h:1180
forward
static vec3_t forward
Definition: p_view.c:29
RF_DEPTHHACK
#define RF_DEPTHHACK
Definition: q_shared.h:603
EF_BLASTER
#define EF_BLASTER
Definition: q_shared.h:564
player_state_t::pmove
pmove_state_t pmove
Definition: q_shared.h:1176
CL_TagTrail
void CL_TagTrail(vec3_t start, vec3_t end, float color)
Definition: cl_newfx.c:1107
CL_TrackerTrail
void CL_TrackerTrail(vec3_t start, vec3_t end, int particleColor)
Definition: cl_newfx.c:844
U_EFFECTS8
#define U_EFFECTS8
Definition: qcommon.h:330
U_MOREBITS1
#define U_MOREBITS1
Definition: qcommon.h:322
player_state_t::kick_angles
vec3_t kick_angles
Definition: q_shared.h:1182
player_state_t::viewoffset
vec3_t viewoffset
Definition: q_shared.h:1181
U_MODEL4
#define U_MODEL4
Definition: qcommon.h:340
player_state_t::blend
float blend[4]
Definition: q_shared.h:1190
RF_VIEWERMODEL
#define RF_VIEWERMODEL
Definition: q_shared.h:600
EF_BLUEHYPERBLASTER
#define EF_BLUEHYPERBLASTER
Definition: q_shared.h:584
client_state_t::refresh_prepped
qboolean refresh_prepped
Definition: client.h:98
CS_PLAYERSKINS
#define CS_PLAYERSKINS
Definition: q_shared.h:1117
EF_GIB
#define EF_GIB
Definition: q_shared.h:563
LerpAngle
float LerpAngle(float a2, float a1, float frac)
Definition: q_shared.c:283
centity_t::trailcount
int trailcount
Definition: client.h:63
entity_s::oldframe
int oldframe
Definition: ref.h:64
client_state_t::lerpfrac
float lerpfrac
Definition: client.h:129
CL_IonripperTrail
void CL_IonripperTrail(vec3_t start, vec3_t ent)
Definition: cl_fx.c:1704
RF_SHELL_DOUBLE
#define RF_SHELL_DOUBLE
Definition: q_shared.h:615
gun_frame
int gun_frame
Definition: cl_view.c:28
U_FRAME16
#define U_FRAME16
Definition: qcommon.h:335
cvar_s::value
float value
Definition: q_shared.h:331
entity_s::backlerp
float backlerp
Definition: ref.h:69
CL_AddLightStyles
void CL_AddLightStyles(void)
Definition: cl_fx.c:114
MSG_ReadByte
int MSG_ReadByte(sizebuf_t *msg_read)
Definition: common.c:703
U_SKIN8
#define U_SKIN8
Definition: qcommon.h:334
EF_ROTATE
#define EF_ROTATE
Definition: q_shared.h:562
frame_t::valid
qboolean valid
Definition: client.h:45
CL_AddPacketEntities
void CL_AddPacketEntities(frame_t *frame)
Definition: cl_ents.c:837
U_RENDERFX16
#define U_RENDERFX16
Definition: qcommon.h:336
pmove_state_t::delta_angles
short delta_angles[3]
Definition: q_shared.h:503
refdef_t::blend
float blend[4]
Definition: ref.h:108
EF_TRAP
#define EF_TRAP
Definition: q_shared.h:587
frame_t::serverframe
int serverframe
Definition: client.h:46
EF_ANIM_ALLFAST
#define EF_ANIM_ALLFAST
Definition: q_shared.h:574
client_static_t::serverProtocol
int serverProtocol
Definition: client.h:225
PS_M_TYPE
#define PS_M_TYPE
Definition: qcommon.h:267
U_MOREBITS2
#define U_MOREBITS2
Definition: qcommon.h:331
entity_state_s::number
int number
Definition: q_shared.h:1147
NULL
#define NULL
Definition: q_shared.h:67
client_state_t::frame
frame_t frame
Definition: client.h:116
EF_SPHERETRANS
#define EF_SPHERETRANS
Definition: q_shared.h:592
EV_OTHER_TELEPORT
@ EV_OTHER_TELEPORT
Definition: q_shared.h:1138
cl_vwep
cvar_t * cl_vwep
Definition: cl_main.c:88
Com_Error
void Com_Error(int code, char *fmt,...)
Definition: common.c:181
client_state_t::playernum
int playernum
Definition: client.h:156
client_state_t::predicted_step
float predicted_step
Definition: client.h:109
U_REMOVE
#define U_REMOVE
Definition: qcommon.h:321
MAX_CLIENTWEAPONMODELS
#define MAX_CLIENTWEAPONMODELS
Definition: client.h:69
EF_SPINNINGLIGHTS
#define EF_SPINNINGLIGHTS
Definition: q_shared.h:585
client_state_t::baseclientinfo
clientinfo_t baseclientinfo
Definition: client.h:170
PM_DEAD
@ PM_DEAD
Definition: q_shared.h:475
client_state_t::time
int time
Definition: client.h:127
cl_showclamp
cvar_t * cl_showclamp
Definition: cl_main.c:58
refexport_t::RegisterModel
struct model_s *(* RegisterModel)(char *name)
Definition: ref.h:158
ERR_DROP
#define ERR_DROP
Definition: qcommon.h:744
MSG_ReadCoord
float MSG_ReadCoord(sizebuf_t *msg_read)
Definition: common.c:813
client_state_t::predicted_step_time
unsigned predicted_step_time
Definition: client.h:110
EF_PLASMA
#define EF_PLASMA
Definition: q_shared.h:586
MAX_EDICTS
#define MAX_EDICTS
Definition: q_shared.h:87
clientinfo_t::skin
struct image_s * skin
Definition: client.h:75
EF_POWERSCREEN
#define EF_POWERSCREEN
Definition: q_shared.h:570
re
refexport_t re
Definition: vid_dll.c:32
frame_t::playerstate
player_state_t playerstate
Definition: client.h:50
entity_state_s::skinnum
int skinnum
Definition: q_shared.h:1155
V_AddEntity
void V_AddEntity(entity_t *ent)
Definition: cl_view.c:79
MAX_PARSE_ENTITIES
#define MAX_PARSE_ENTITIES
Definition: client.h:312
entity_s::frame
int frame
Definition: ref.h:58
U_SKIN16
#define U_SKIN16
Definition: qcommon.h:345
client_state_t::v_right
vec3_t v_right
Definition: client.h:133
cl_parse_entities
entity_state_t cl_parse_entities[MAX_PARSE_ENTITIES]
Definition: cl_main.c:95
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:165
clientinfo_t::weaponmodel
struct model_s * weaponmodel[MAX_CLIENTWEAPONMODELS]
Definition: client.h:79
centity_t::serverframe
int serverframe
Definition: client.h:61
CL_CheckPredictionError
void CL_CheckPredictionError(void)
Definition: cl_pred.c:29
client_state_t::parse_entities
int parse_entities
Definition: client.h:102
MSG_ReadLong
int MSG_ReadLong(sizebuf_t *msg_read)
Definition: common.c:731
client_state_t::sound_prepped
qboolean sound_prepped
Definition: client.h:99
cl_mod_powerscreen
struct model_s * cl_mod_powerscreen
Definition: cl_tent.c:107
CL_AddDLights
void CL_AddDLights(void)
Definition: cl_fx.c:812
fs_searchpaths
searchpath_t * fs_searchpaths
Definition: files.c:83
client_static_t::state
connstate_t state
Definition: client.h:204
svc_strings
char * svc_strings[256]
Definition: cl_parse.c:24
cl_timedemo
cvar_t * cl_timedemo
Definition: cl_main.c:61
entity_s
Definition: ref.h:49
clientinfo_t
Definition: client.h:71
MSG_ReadData
void MSG_ReadData(sizebuf_t *msg_read, void *data, int len)
Definition: common.c:874
MSG_ReadAngle16
float MSG_ReadAngle16(sizebuf_t *msg_read)
Definition: common.c:830
VectorMA
void VectorMA(vec3_t veca, float scale, vec3_t vecb, vec3_t vecc)
Definition: q_shared.c:719
EF_ANIM23
#define EF_ANIM23
Definition: q_shared.h:572
cl_predict
cvar_t * cl_predict
Definition: cl_main.c:46
refdef_t::fov_x
float fov_x
Definition: ref.h:105
CL_TrapParticles
void CL_TrapParticles(entity_t *ent)
Definition: cl_fx.c:1998
entity_state_s::modelindex
int modelindex
Definition: q_shared.h:1152
entity_state_s::modelindex2
int modelindex2
Definition: q_shared.h:1153
client_state_t::configstrings
char configstrings[MAX_CONFIGSTRINGS][MAX_QPATH]
Definition: client.h:158
CL_FireEntityEvents
void CL_FireEntityEvents(frame_t *frame)
Definition: cl_ents.c:639
sizebuf_s::cursize
int cursize
Definition: qcommon.h:98
U_FRAME8
#define U_FRAME8
Definition: qcommon.h:319
svc_packetentities
@ svc_packetentities
Definition: qcommon.h:244
frame_t::deltaframe
int deltaframe
Definition: client.h:48
CL_ParsePacketEntities
void CL_ParsePacketEntities(frame_t *oldframe, frame_t *newframe)
Definition: cl_ents.c:388
MSG_ReadPos
void MSG_ReadPos(sizebuf_t *msg_read, vec3_t pos)
Definition: common.c:818
pmove_state_t::origin
short origin[3]
Definition: q_shared.h:498
RF_SHELL_BLUE
#define RF_SHELL_BLUE
Definition: q_shared.h:611
U_NUMBER16
#define U_NUMBER16
Definition: qcommon.h:325
RF_FRAMELERP
#define RF_FRAMELERP
Definition: q_shared.h:605
Com_Printf
void Com_Printf(char *fmt,...)
Definition: common.c:104
player_state_t
Definition: q_shared.h:1174
centity_t::current
entity_state_t current
Definition: client.h:58
CL_BlasterTrail2
void CL_BlasterTrail2(vec3_t start, vec3_t end)
Definition: cl_newfx.c:1280
refdef_t::viewangles
float viewangles[3]
Definition: ref.h:107
Q_strcasecmp
int Q_strcasecmp(char *s1, char *s2)
Definition: q_shared.c:1216
MSG_ReadAngle
float MSG_ReadAngle(sizebuf_t *msg_read)
Definition: common.c:825
cls
client_static_t cls
Definition: cl_main.c:90
EF_ANIM_ALL
#define EF_ANIM_ALL
Definition: q_shared.h:573
frame_t
Definition: client.h:43
PS_M_GRAVITY
#define PS_M_GRAVITY
Definition: qcommon.h:272
client_state_t::surpressCount
int surpressCount
Definition: client.h:117
CL_RocketTrail
void CL_RocketTrail(vec3_t start, vec3_t end, centity_t *old)
Definition: cl_fx.c:1556
PS_VIEWANGLES
#define PS_VIEWANGLES
Definition: qcommon.h:276
CL_AddParticles
void CL_AddParticles(void)
Definition: cl_fx.c:2190
CL_EntityEvent
void CL_EntityEvent(entity_state_t *ent)
Definition: cl_fx.c:2266
frame_t::servertime
int servertime
Definition: client.h:47
player_state_t::gunindex
int gunindex
Definition: q_shared.h:1187
UPDATE_MASK
#define UPDATE_MASK
Definition: qcommon.h:209
cl_entities
centity_t cl_entities[MAX_EDICTS]
Definition: cl_main.c:93
entity_state_s::angles
vec3_t angles
Definition: q_shared.h:1150
EF_HYPERBLASTER
#define EF_HYPERBLASTER
Definition: q_shared.h:567
cl
client_state_t cl
Definition: cl_main.c:91
MSG_ReadChar
int MSG_ReadChar(sizebuf_t *msg_read)
Definition: common.c:690
U_ORIGIN3
#define U_ORIGIN3
Definition: qcommon.h:326
PS_FOV
#define PS_FOV
Definition: qcommon.h:279
pmove_state_t::pm_flags
byte pm_flags
Definition: q_shared.h:500
U_SOLID
#define U_SOLID
Definition: qcommon.h:347
U_MODEL3
#define U_MODEL3
Definition: qcommon.h:339
centity_t::prev
entity_state_t prev
Definition: client.h:59
entity_s::oldorigin
float oldorigin[3]
Definition: ref.h:63
CL_ParseDelta
void CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits)
Definition: cl_ents.c:247
vec3_t
vec_t vec3_t[3]
Definition: q_shared.h:134
Com_sprintf
void Com_sprintf(char *dest, int size, char *fmt,...)
Definition: q_shared.c:1223
RF_USE_DISGUISE
#define RF_USE_DISGUISE
Definition: q_shared.h:617
PS_BLEND
#define PS_BLEND
Definition: qcommon.h:278
entity_s::angles
float angles[3]
Definition: ref.h:52
Developer_searchpath
int Developer_searchpath(int who)
Definition: files.c:159
pmove_state_t::pm_time
byte pm_time
Definition: q_shared.h:501
player_state_t::stats
short stats[MAX_STATS]
Definition: q_shared.h:1196
EF_HALF_DAMAGE
#define EF_HALF_DAMAGE
Definition: q_shared.h:594
PS_WEAPONFRAME
#define PS_WEAPONFRAME
Definition: qcommon.h:281
V_AddLight
void V_AddLight(vec3_t org, float intensity, float r, float g, float b)
Definition: cl_view.c:111
PS_VIEWOFFSET
#define PS_VIEWOFFSET
Definition: qcommon.h:275
CL_FlyEffect
void CL_FlyEffect(centity_t *ent, vec3_t origin)
Definition: cl_fx.c:1886
client_static_t::realtime
int realtime
Definition: client.h:208