icculus quake2 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 1495 of file cl_ents.c.

1496 {
1497  if (cls.state != ca_active)
1498  return;
1499 
1500  if (cl.time > cl.frame.servertime)
1501  {
1502  if (cl_showclamp->value)
1503  Com_Printf ("high clamp %i\n", cl.time - cl.frame.servertime);
1505  cl.lerpfrac = 1.0;
1506  }
1507  else if (cl.time < cl.frame.servertime - 100)
1508  {
1509  if (cl_showclamp->value)
1510  Com_Printf ("low clamp %i\n", cl.frame.servertime-100 - cl.time);
1511  cl.time = cl.frame.servertime - 100;
1512  cl.lerpfrac = 0;
1513  }
1514  else
1515  cl.lerpfrac = 1.0 - (cl.frame.servertime - cl.time) * 0.01;
1516 
1517  if (cl_timedemo->value)
1518  cl.lerpfrac = 1.0;
1519 
1520 // CL_AddPacketEntities (&cl.frame);
1521 // CL_AddTEnts ();
1522 // CL_AddParticles ();
1523 // CL_AddDLights ();
1524 // CL_AddLightStyles ();
1525 
1526  CL_CalcViewValues ();
1527  // PMM - moved this here so the heat beam has the right values for the vieworg, and can lock the beam to the gun
1529 #if 0
1530  CL_AddProjectiles ();
1531 #endif
1532  CL_AddTEnts ();
1533  CL_AddParticles ();
1534  CL_AddDLights ();
1535  CL_AddLightStyles ();
1536 }

Referenced by V_RenderView().

◆ CL_AddPacketEntities()

void CL_AddPacketEntities ( frame_t frame)

Definition at line 850 of file cl_ents.c.

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

Referenced by CL_AddEntities().

◆ CL_AddViewWeapon()

void CL_AddViewWeapon ( player_state_t ps,
player_state_t ops 
)

Definition at line 1350 of file cl_ents.c.

1351 {
1352  entity_t gun; // view model
1353  int i;
1354 
1355  // allow the gun to be completely removed
1356  if (!cl_gun->value)
1357  return;
1358 
1359  // don't draw gun if in wide angle view
1360  if (ps->fov > 90)
1361  return;
1362 
1363  memset (&gun, 0, sizeof(gun));
1364 
1365  if (gun_model)
1366  gun.model = gun_model; // development tool
1367  else
1368  gun.model = cl.model_draw[ps->gunindex];
1369  if (!gun.model)
1370  return;
1371 
1372  // set up gun position
1373  for (i=0 ; i<3 ; i++)
1374  {
1375  gun.origin[i] = cl.refdef.vieworg[i] + ops->gunoffset[i]
1376  + cl.lerpfrac * (ps->gunoffset[i] - ops->gunoffset[i]);
1377  gun.angles[i] = cl.refdef.viewangles[i] + LerpAngle (ops->gunangles[i],
1378  ps->gunangles[i], cl.lerpfrac);
1379  }
1380 
1381  if (gun_frame)
1382  {
1383  gun.frame = gun_frame; // development tool
1384  gun.oldframe = gun_frame; // development tool
1385  }
1386  else
1387  {
1388  gun.frame = ps->gunframe;
1389  if (gun.frame == 0)
1390  gun.oldframe = 0; // just changed weapons, don't lerp from old
1391  else
1392  gun.oldframe = ops->gunframe;
1393  }
1394 
1396  gun.backlerp = 1.0 - cl.lerpfrac;
1397  VectorCopy (gun.origin, gun.oldorigin); // don't lerp at all
1398  V_AddEntity (&gun);
1399 }

Referenced by CL_CalcViewValues().

◆ CL_CalcViewValues()

void CL_CalcViewValues ( void  )

Definition at line 1409 of file cl_ents.c.

1410 {
1411  int i;
1412  float lerp, backlerp;
1413  centity_t *ent;
1414  frame_t *oldframe;
1415  player_state_t *ps, *ops;
1416 
1417  // find the previous frame to interpolate from
1418  ps = &cl.frame.playerstate;
1419  i = (cl.frame.serverframe - 1) & UPDATE_MASK;
1420  oldframe = &cl.frames[i];
1421  if (oldframe->serverframe != cl.frame.serverframe-1 || !oldframe->valid)
1422  oldframe = &cl.frame; // previous frame was dropped or involid
1423  ops = &oldframe->playerstate;
1424 
1425  // see if the player entity was teleported this frame
1426  if ( fabs(ops->pmove.origin[0] - ps->pmove.origin[0]) > 256*8
1427  || abs(ops->pmove.origin[1] - ps->pmove.origin[1]) > 256*8
1428  || abs(ops->pmove.origin[2] - ps->pmove.origin[2]) > 256*8)
1429  ops = ps; // don't interpolate
1430 
1431  ent = &cl_entities[cl.playernum+1];
1432  lerp = cl.lerpfrac;
1433 
1434  // calculate the origin
1436  { // use predicted values
1437  unsigned delta;
1438 
1439  backlerp = 1.0 - lerp;
1440  for (i=0 ; i<3 ; i++)
1441  {
1443  + cl.lerpfrac * (ps->viewoffset[i] - ops->viewoffset[i])
1444  - backlerp * cl.prediction_error[i];
1445  }
1446 
1447  // smooth out stair climbing
1448  delta = cls.realtime - cl.predicted_step_time;
1449  if (delta < 100)
1450  cl.refdef.vieworg[2] -= cl.predicted_step * (100 - delta) * 0.01;
1451  }
1452  else
1453  { // just use interpolated values
1454  for (i=0 ; i<3 ; i++)
1455  cl.refdef.vieworg[i] = ops->pmove.origin[i]*0.125 + ops->viewoffset[i]
1456  + lerp * (ps->pmove.origin[i]*0.125 + ps->viewoffset[i]
1457  - (ops->pmove.origin[i]*0.125 + ops->viewoffset[i]) );
1458  }
1459 
1460  // if not running a demo or on a locked frame, add the local angle movement
1462  { // use predicted values
1463  for (i=0 ; i<3 ; i++)
1465  }
1466  else
1467  { // just use interpolated values
1468  for (i=0 ; i<3 ; i++)
1469  cl.refdef.viewangles[i] = LerpAngle (ops->viewangles[i], ps->viewangles[i], lerp);
1470  }
1471 
1472  for (i=0 ; i<3 ; i++)
1473  cl.refdef.viewangles[i] += LerpAngle (ops->kick_angles[i], ps->kick_angles[i], lerp);
1474 
1476 
1477  // interpolate field of view
1478  cl.refdef.fov_x = ops->fov + lerp * (ps->fov - ops->fov);
1479 
1480  // don't interpolate blend color
1481  for (i=0 ; i<4 ; i++)
1482  cl.refdef.blend[i] = ps->blend[i];
1483 
1484  // add the weapon
1485  CL_AddViewWeapon (ps, ops);
1486 }

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  || abs(state->origin[0] - ent->current.origin[0]) > 512
346  || abs(state->origin[1] - ent->current.origin[1]) > 512
347  || abs(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 #ifdef QMAX
651  //add stains if moving...
652  if (s1->origin[0]!=s1->old_origin[0]||
653  s1->origin[1]!=s1->old_origin[1]||
654  s1->origin[2]!=s1->old_origin[2])
655  {
656  if (s1->effects & EF_GIB)
657  re.AddStain(s1->origin, 25, 0, -200 ,-200);
658  if (s1->effects & EF_GREENGIB)
659  re.AddStain(s1->origin, 25, -200, 0, -200);
660 
661  }
662 #endif
663 
664  // EF_TELEPORTER acts like an event, but is not cleared each frame
665  if (s1->effects & EF_TELEPORTER)
667  }
668 }

Referenced by CL_ParseFrame().

◆ CL_GetEntitySoundOrigin()

void CL_GetEntitySoundOrigin ( int  ent,
vec3_t  org 
)

Definition at line 1547 of file cl_ents.c.

1548 {
1549  centity_t *old;
1550 
1551  if (ent < 0 || ent >= MAX_EDICTS)
1552  Com_Error (ERR_DROP, "CL_GetEntitySoundOrigin: bad ent");
1553  old = &cl_entities[ent];
1554  VectorCopy (old->lerp_origin, org);
1555 
1556  // FIXME: bmodel issues...
1557 }

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 676 of file cl_ents.c.

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

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  unsigned 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 793 of file cl_ents.c.

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

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 123 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:1175
RF_TRANSLUCENT
#define RF_TRANSLUCENT
Definition: q_shared.h:618
refexport_t::RegisterSkin
struct image_s *(* RegisterSkin)(char *name)
Definition: ref.h:177
EF_TELEPORTER
#define EF_TELEPORTER
Definition: q_shared.h:574
refdef_t::vieworg
float vieworg[3]
Definition: ref.h:124
SCR_EndLoadingPlaque
void SCR_EndLoadingPlaque(void)
Definition: cl_scrn.c:598
EF_TAGTRAIL
#define EF_TAGTRAIL
Definition: q_shared.h:589
RF_SHELL_RED
#define RF_SHELL_RED
Definition: q_shared.h:623
client_state_t::predicted_origin
vec3_t predicted_origin
Definition: client.h:132
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:1212
client_state_t::servercount
int servercount
Definition: client.h:174
EF_GREENGIB
#define EF_GREENGIB
Definition: q_shared.h:579
MAX_QPATH
#define MAX_QPATH
Definition: q_shared.h:73
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:1177
CL_BlasterTrail
void CL_BlasterTrail(vec3_t start, vec3_t end)
Definition: cl_fx.c:1403
entity_state_s::solid
int solid
Definition: q_shared.h:1182
U_ANGLE2
#define U_ANGLE2
Definition: qcommon.h:300
U_MOREBITS3
#define U_MOREBITS3
Definition: qcommon.h:324
client_state_t::frames
frame_t frames[UPDATE_BACKUP]
Definition: client.h:138
RF_MINLIGHT
#define RF_MINLIGHT
Definition: q_shared.h:613
EF_DOUBLE
#define EF_DOUBLE
Definition: q_shared.h:587
U_ANGLE1
#define U_ANGLE1
Definition: qcommon.h:310
RF_SHELL_HALF_DAM
#define RF_SHELL_HALF_DAM
Definition: q_shared.h:631
client_state_t::attractloop
qboolean attractloop
Definition: client.h:173
entity_state_s::frame
int frame
Definition: q_shared.h:1178
PS_M_ORIGIN
#define PS_M_ORIGIN
Definition: qcommon.h:251
client_state_t::v_forward
vec3_t v_forward
Definition: client.h:153
EV_PLAYER_TELEPORT
@ EV_PLAYER_TELEPORT
Definition: q_shared.h:1161
CL_DiminishingTrail
void CL_DiminishingTrail(vec3_t start, vec3_t end, centity_t *old, int flags)
Definition: cl_fx.c:1564
EF_IONRIPPER
#define EF_IONRIPPER
Definition: q_shared.h:578
EF_FLAG2
#define EF_FLAG2
Definition: q_shared.h:576
PS_M_FLAGS
#define PS_M_FLAGS
Definition: qcommon.h:254
EF_TRACKERTRAIL
#define EF_TRACKERTRAIL
Definition: q_shared.h:591
client_state_t::v_up
vec3_t v_up
Definition: client.h:153
RF_SHELL_GREEN
#define RF_SHELL_GREEN
Definition: q_shared.h:624
EF_QUAD
#define EF_QUAD
Definition: q_shared.h:572
PMF_NO_PREDICTION
#define PMF_NO_PREDICTION
Definition: q_shared.h:483
entity_state_s::renderfx
int renderfx
Definition: q_shared.h:1181
MSG_ReadShort
int MSG_ReadShort(sizebuf_t *msg_read)
Definition: common.c:735
PM_FREEZE
@ PM_FREEZE
Definition: q_shared.h:473
net_message
sizebuf_t net_message
Definition: net_chan.c:82
player_state_t::gunangles
vec3_t gunangles
Definition: q_shared.h:1209
entity_state_s
Definition: q_shared.h:1169
cl_shownet
cvar_t * cl_shownet
Definition: cl_main.c:71
U_ORIGIN1
#define U_ORIGIN1
Definition: qcommon.h:298
EF_FLIES
#define EF_FLIES
Definition: q_shared.h:571
frame_t::parse_entities
int parse_entities
Definition: client.h:72
entity_state_s::origin
vec3_t origin
Definition: q_shared.h:1173
PS_M_VELOCITY
#define PS_M_VELOCITY
Definition: qcommon.h:252
PS_M_DELTA_ANGLES
#define PS_M_DELTA_ANGLES
Definition: qcommon.h:256
player_state_t::gunoffset
vec3_t gunoffset
Definition: q_shared.h:1210
client_state_t::prediction_error
vec3_t prediction_error
Definition: client.h:134
CL_FlagTrail
void CL_FlagTrail(vec3_t start, vec3_t end, float color)
Definition: cl_fx.c:1511
EF_ANIM01
#define EF_ANIM01
Definition: q_shared.h:567
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:133
U_RENDERFX8
#define U_RENDERFX8
Definition: qcommon.h:312
sizebuf_s::readcount
int readcount
Definition: qcommon.h:82
U_OLDORIGIN
#define U_OLDORIGIN
Definition: qcommon.h:327
CS_MODELS
#define CS_MODELS
Definition: q_shared.h:1136
CL_TeleporterParticles
void CL_TeleporterParticles(entity_state_t *ent)
Definition: cl_fx.c:1145
client_static_t::disable_servercount
int disable_servercount
Definition: client.h:235
entity_s::skinnum
int skinnum
Definition: ref.h:70
pmove_state_t::gravity
short gravity
Definition: q_shared.h:498
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:71
ca_active
@ ca_active
Definition: client.h:209
vidref_val
int vidref_val
Definition: cl_ents.c:28
PS_KICKANGLES
#define PS_KICKANGLES
Definition: qcommon.h:260
U_MODEL
#define U_MODEL
Definition: qcommon.h:311
CL_AddViewWeapon
void CL_AddViewWeapon(player_state_t *ps, player_state_t *ops)
Definition: cl_ents.c:1350
CL_Tracker_Shell
void CL_Tracker_Shell(vec3_t origin)
Definition: cl_newfx.c:997
buffer
GLenum GLfloat * buffer
Definition: qgl_win.c:151
EF_BFG
#define EF_BFG
Definition: q_shared.h:564
model_s
Definition: r_model.h:171
entity_state_s::event
int event
Definition: q_shared.h:1186
svc_playerinfo
@ svc_playerinfo
Definition: qcommon.h:226
PS_RDFLAGS
#define PS_RDFLAGS
Definition: qcommon.h:265
entity_s::flags
int flags
Definition: ref.h:76
pmove_state_t::velocity
short velocity[3]
Definition: q_shared.h:495
client_state_t::refdef
refdef_t refdef
Definition: client.h:151
player_state_t::fov
float fov
Definition: q_shared.h:1216
PS_M_TIME
#define PS_M_TIME
Definition: qcommon.h:253
EF_PENT
#define EF_PENT
Definition: q_shared.h:573
CL_BfgParticles
void CL_BfgParticles(entity_t *ent)
Definition: cl_fx.c:2065
cl_gun
cvar_t * cl_gun
Definition: cl_main.c:50
gun_model
struct model_s * gun_model
Definition: cl_view.c:29
EF_TRACKER
#define EF_TRACKER
Definition: q_shared.h:586
player_state_t::rdflags
int rdflags
Definition: q_shared.h:1218
U_MODEL2
#define U_MODEL2
Definition: qcommon.h:321
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:1177
CL_CalcViewValues
void CL_CalcViewValues(void)
Definition: cl_ents.c:1409
anglemod
float anglemod(float a)
Definition: q_shared.c:293
client_state_t::force_refdef
qboolean force_refdef
Definition: client.h:120
PS_WEAPONINDEX
#define PS_WEAPONINDEX
Definition: qcommon.h:263
frame_t::areabits
byte areabits[MAX_MAP_AREAS/8]
Definition: client.h:69
intensity
cvar_t * intensity
Definition: gl_image.c:30
CL_AddTEnts
void CL_AddTEnts(void)
Definition: cl_tent.c:2029
entity_state_s::effects
unsigned int effects
Definition: q_shared.h:1180
client_state_t::clientinfo
clientinfo_t clientinfo[MAX_CLIENTS]
Definition: client.h:189
bitcounts
int bitcounts[32]
Definition: cl_ents.c:201
EF_GRENADE
#define EF_GRENADE
Definition: q_shared.h:562
entity_state_s::sound
int sound
Definition: q_shared.h:1185
EF_COLOR_SHELL
#define EF_COLOR_SHELL
Definition: q_shared.h:565
U_ANGLE3
#define U_ANGLE3
Definition: qcommon.h:301
centity_t::lerp_origin
vec3_t lerp_origin
Definition: client.h:84
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:329
RF_WEAPONMODEL
#define RF_WEAPONMODEL
Definition: q_shared.h:615
searchpath_s::next
struct searchpath_s * next
Definition: files.c:80
RF_BEAM
#define RF_BEAM
Definition: q_shared.h:620
EF_FLAG1
#define EF_FLAG1
Definition: q_shared.h:575
SHOWNET
void SHOWNET(char *s)
Definition: cl_parse.c:653
MAX_STATS
#define MAX_STATS
Definition: q_shared.h:1044
searchpath_s
Definition: files.c:76
clientinfo_t::model
struct model_s * model
Definition: client.h:98
EF_ROCKET
#define EF_ROCKET
Definition: q_shared.h:561
entity_s::alpha
float alpha
Definition: ref.h:73
client_state_t::model_draw
struct model_s * model_draw[MAX_MODELS]
Definition: client.h:183
pmove_state_t::pm_type
pmtype_t pm_type
Definition: q_shared.h:492
U_EVENT
#define U_EVENT
Definition: qcommon.h:303
VIDREF_GL
#define VIDREF_GL
Definition: q_shared.h:1226
centity_t
Definition: client.h:75
client_static_t::demowaiting
qboolean demowaiting
Definition: client.h:258
U_EFFECTS16
#define U_EFFECTS16
Definition: qcommon.h:320
U_ORIGIN2
#define U_ORIGIN2
Definition: qcommon.h:299
player_state_t::viewangles
vec3_t viewangles
Definition: q_shared.h:1204
forward
static vec3_t forward
Definition: p_view.c:29
RF_DEPTHHACK
#define RF_DEPTHHACK
Definition: q_shared.h:617
EF_BLASTER
#define EF_BLASTER
Definition: q_shared.h:560
player_state_t::pmove
pmove_state_t pmove
Definition: q_shared.h:1200
CL_TagTrail
void CL_TagTrail(vec3_t start, vec3_t end, float color)
Definition: cl_newfx.c:1218
CL_TrackerTrail
void CL_TrackerTrail(vec3_t start, vec3_t end, int particleColor)
Definition: cl_newfx.c:941
U_EFFECTS8
#define U_EFFECTS8
Definition: qcommon.h:313
U_MOREBITS1
#define U_MOREBITS1
Definition: qcommon.h:305
player_state_t::kick_angles
vec3_t kick_angles
Definition: q_shared.h:1206
player_state_t::viewoffset
vec3_t viewoffset
Definition: q_shared.h:1205
U_MODEL4
#define U_MODEL4
Definition: qcommon.h:323
player_state_t::blend
float blend[4]
Definition: q_shared.h:1214
RF_VIEWERMODEL
#define RF_VIEWERMODEL
Definition: q_shared.h:614
EF_BLUEHYPERBLASTER
#define EF_BLUEHYPERBLASTER
Definition: q_shared.h:580
client_state_t::refresh_prepped
qboolean refresh_prepped
Definition: client.h:118
CS_PLAYERSKINS
#define CS_PLAYERSKINS
Definition: q_shared.h:1141
EF_GIB
#define EF_GIB
Definition: q_shared.h:559
LerpAngle
float LerpAngle(float a2, float a1, float frac)
Definition: q_shared.c:283
centity_t::trailcount
int trailcount
Definition: client.h:83
entity_s::oldframe
int oldframe
Definition: ref.h:64
client_state_t::lerpfrac
float lerpfrac
Definition: client.h:149
CL_IonripperTrail
void CL_IonripperTrail(vec3_t start, vec3_t ent)
Definition: cl_fx.c:1844
RF_SHELL_DOUBLE
#define RF_SHELL_DOUBLE
Definition: q_shared.h:630
gun_frame
int gun_frame
Definition: cl_view.c:28
U_FRAME16
#define U_FRAME16
Definition: qcommon.h:318
cvar_s::value
float value
Definition: q_shared.h:324
entity_s::backlerp
float backlerp
Definition: ref.h:69
CL_AddLightStyles
void CL_AddLightStyles(void)
Definition: cl_fx.c:214
MSG_ReadByte
int MSG_ReadByte(sizebuf_t *msg_read)
Definition: common.c:722
U_SKIN8
#define U_SKIN8
Definition: qcommon.h:317
EF_ROTATE
#define EF_ROTATE
Definition: q_shared.h:558
frame_t::valid
qboolean valid
Definition: client.h:65
CL_AddPacketEntities
void CL_AddPacketEntities(frame_t *frame)
Definition: cl_ents.c:850
U_RENDERFX16
#define U_RENDERFX16
Definition: qcommon.h:319
pmove_state_t::delta_angles
short delta_angles[3]
Definition: q_shared.h:499
refdef_t::blend
float blend[4]
Definition: ref.h:126
EF_TRAP
#define EF_TRAP
Definition: q_shared.h:583
frame_t::serverframe
int serverframe
Definition: client.h:66
EF_ANIM_ALLFAST
#define EF_ANIM_ALLFAST
Definition: q_shared.h:570
client_static_t::serverProtocol
int serverProtocol
Definition: client.h:245
PS_M_TYPE
#define PS_M_TYPE
Definition: qcommon.h:250
U_MOREBITS2
#define U_MOREBITS2
Definition: qcommon.h:314
entity_state_s::number
int number
Definition: q_shared.h:1171
NULL
#define NULL
Definition: q_shared.h:60
client_state_t::frame
frame_t frame
Definition: client.h:136
EF_SPHERETRANS
#define EF_SPHERETRANS
Definition: q_shared.h:588
EV_OTHER_TELEPORT
@ EV_OTHER_TELEPORT
Definition: q_shared.h:1162
cl_vwep
cvar_t * cl_vwep
Definition: cl_main.c:103
Com_Error
void Com_Error(int code, char *fmt,...)
Definition: common.c:203
client_state_t::playernum
int playernum
Definition: client.h:176
client_state_t::predicted_step
float predicted_step
Definition: client.h:129
U_REMOVE
#define U_REMOVE
Definition: qcommon.h:304
MAX_CLIENTWEAPONMODELS
#define MAX_CLIENTWEAPONMODELS
Definition: client.h:89
EF_SPINNINGLIGHTS
#define EF_SPINNINGLIGHTS
Definition: q_shared.h:581
client_state_t::baseclientinfo
clientinfo_t baseclientinfo
Definition: client.h:190
PM_DEAD
@ PM_DEAD
Definition: q_shared.h:471
client_state_t::time
int time
Definition: client.h:147
cl_showclamp
cvar_t * cl_showclamp
Definition: cl_main.c:73
refexport_t::RegisterModel
struct model_s *(* RegisterModel)(char *name)
Definition: ref.h:176
ERR_DROP
#define ERR_DROP
Definition: qcommon.h:736
MSG_ReadCoord
float MSG_ReadCoord(sizebuf_t *msg_read)
Definition: common.c:832
client_state_t::predicted_step_time
unsigned predicted_step_time
Definition: client.h:130
EF_PLASMA
#define EF_PLASMA
Definition: q_shared.h:582
MAX_EDICTS
#define MAX_EDICTS
Definition: q_shared.h:80
clientinfo_t::skin
struct image_s * skin
Definition: client.h:95
EF_POWERSCREEN
#define EF_POWERSCREEN
Definition: q_shared.h:566
re
refexport_t re
Definition: vid_dll.c:31
frame_t::playerstate
player_state_t playerstate
Definition: client.h:70
entity_state_s::skinnum
int skinnum
Definition: q_shared.h:1179
V_AddEntity
void V_AddEntity(entity_t *ent)
Definition: cl_view.c:97
MAX_PARSE_ENTITIES
#define MAX_PARSE_ENTITIES
Definition: client.h:351
entity_s::frame
int frame
Definition: ref.h:58
U_SKIN16
#define U_SKIN16
Definition: qcommon.h:328
client_state_t::v_right
vec3_t v_right
Definition: client.h:153
cl_parse_entities
entity_state_t cl_parse_entities[MAX_PARSE_ENTITIES]
Definition: cl_main.c:110
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:158
clientinfo_t::weaponmodel
struct model_s * weaponmodel[MAX_CLIENTWEAPONMODELS]
Definition: client.h:99
centity_t::serverframe
int serverframe
Definition: client.h:81
CL_CheckPredictionError
void CL_CheckPredictionError(void)
Definition: cl_pred.c:29
client_state_t::parse_entities
int parse_entities
Definition: client.h:122
MSG_ReadLong
int MSG_ReadLong(sizebuf_t *msg_read)
Definition: common.c:750
client_state_t::sound_prepped
qboolean sound_prepped
Definition: client.h:119
cl_mod_powerscreen
struct model_s * cl_mod_powerscreen
Definition: cl_tent.c:123
CL_AddDLights
void CL_AddDLights(void)
Definition: cl_fx.c:912
fs_searchpaths
searchpath_t * fs_searchpaths
Definition: files.c:83
client_static_t::state
connstate_t state
Definition: client.h:224
svc_strings
char * svc_strings[256]
Definition: cl_parse.c:24
cl_timedemo
cvar_t * cl_timedemo
Definition: cl_main.c:76
entity_s
Definition: ref.h:49
clientinfo_t
Definition: client.h:91
MSG_ReadData
void MSG_ReadData(sizebuf_t *msg_read, void *data, int len)
Definition: common.c:893
MSG_ReadAngle16
float MSG_ReadAngle16(sizebuf_t *msg_read)
Definition: common.c:849
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:568
cl_predict
cvar_t * cl_predict
Definition: cl_main.c:46
refdef_t::fov_x
float fov_x
Definition: ref.h:123
CL_TrapParticles
void CL_TrapParticles(entity_t *ent)
Definition: cl_fx.c:2135
entity_state_s::modelindex
int modelindex
Definition: q_shared.h:1176
entity_state_s::modelindex2
int modelindex2
Definition: q_shared.h:1177
client_state_t::configstrings
char configstrings[MAX_CONFIGSTRINGS][MAX_QPATH]
Definition: client.h:178
CL_FireEntityEvents
void CL_FireEntityEvents(frame_t *frame)
Definition: cl_ents.c:639
sizebuf_s::cursize
int cursize
Definition: qcommon.h:81
U_FRAME8
#define U_FRAME8
Definition: qcommon.h:302
svc_packetentities
@ svc_packetentities
Definition: qcommon.h:227
frame_t::deltaframe
int deltaframe
Definition: client.h:68
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:837
pmove_state_t::origin
short origin[3]
Definition: q_shared.h:494
RF_SHELL_BLUE
#define RF_SHELL_BLUE
Definition: q_shared.h:625
U_NUMBER16
#define U_NUMBER16
Definition: qcommon.h:308
RF_FRAMELERP
#define RF_FRAMELERP
Definition: q_shared.h:619
Com_Printf
void Com_Printf(char *fmt,...)
Definition: common.c:102
player_state_t
Definition: q_shared.h:1198
centity_t::current
entity_state_t current
Definition: client.h:78
CL_BlasterTrail2
void CL_BlasterTrail2(vec3_t start, vec3_t end)
Definition: cl_newfx.c:1421
refdef_t::viewangles
float viewangles[3]
Definition: ref.h:125
Q_strcasecmp
int Q_strcasecmp(char *s1, char *s2)
Definition: q_shared.c:1229
MSG_ReadAngle
float MSG_ReadAngle(sizebuf_t *msg_read)
Definition: common.c:844
cls
client_static_t cls
Definition: cl_main.c:105
EF_ANIM_ALL
#define EF_ANIM_ALL
Definition: q_shared.h:569
frame_t
Definition: client.h:63
PS_M_GRAVITY
#define PS_M_GRAVITY
Definition: qcommon.h:255
client_state_t::surpressCount
int surpressCount
Definition: client.h:137
CL_RocketTrail
void CL_RocketTrail(vec3_t start, vec3_t end, centity_t *old)
Definition: cl_fx.c:1691
PS_VIEWANGLES
#define PS_VIEWANGLES
Definition: qcommon.h:259
CL_AddParticles
void CL_AddParticles(void)
Definition: cl_fx.c:2332
CL_EntityEvent
void CL_EntityEvent(entity_state_t *ent)
Definition: cl_fx.c:2410
frame_t::servertime
int servertime
Definition: client.h:67
player_state_t::gunindex
int gunindex
Definition: q_shared.h:1211
UPDATE_MASK
#define UPDATE_MASK
Definition: qcommon.h:192
cl_entities
centity_t cl_entities[MAX_EDICTS]
Definition: cl_main.c:108
entity_state_s::angles
vec3_t angles
Definition: q_shared.h:1174
EF_HYPERBLASTER
#define EF_HYPERBLASTER
Definition: q_shared.h:563
cl
client_state_t cl
Definition: cl_main.c:106
MSG_ReadChar
int MSG_ReadChar(sizebuf_t *msg_read)
Definition: common.c:709
U_ORIGIN3
#define U_ORIGIN3
Definition: qcommon.h:309
PS_FOV
#define PS_FOV
Definition: qcommon.h:262
pmove_state_t::pm_flags
byte pm_flags
Definition: q_shared.h:496
U_SOLID
#define U_SOLID
Definition: qcommon.h:330
U_MODEL3
#define U_MODEL3
Definition: qcommon.h:322
centity_t::prev
entity_state_t prev
Definition: client.h:79
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:127
Com_sprintf
void Com_sprintf(char *dest, int size, char *fmt,...)
Definition: q_shared.c:1236
RF_USE_DISGUISE
#define RF_USE_DISGUISE
Definition: q_shared.h:632
PS_BLEND
#define PS_BLEND
Definition: qcommon.h:261
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:497
player_state_t::stats
short stats[MAX_STATS]
Definition: q_shared.h:1220
EF_HALF_DAMAGE
#define EF_HALF_DAMAGE
Definition: q_shared.h:590
PS_WEAPONFRAME
#define PS_WEAPONFRAME
Definition: qcommon.h:264
V_AddLight
void V_AddLight(vec3_t org, float intensity, float r, float g, float b)
Definition: cl_view.c:157
PS_VIEWOFFSET
#define PS_VIEWOFFSET
Definition: qcommon.h:258
CL_FlyEffect
void CL_FlyEffect(centity_t *ent, vec3_t origin)
Definition: cl_fx.c:2026
client_static_t::realtime
int realtime
Definition: client.h:228