Xonotic
csqcmodel_hooks.qc
Go to the documentation of this file.
1 #include "csqcmodel_hooks.qh"
2 
6 #include <common/animdecide.qh>
7 #include <common/effects/all.inc>
8 #include <common/effects/all.qh>
9 #include <common/ent_cs.qh>
10 #include <common/gamemodes/_mod.qh>
11 #include <common/mapinfo.qh>
13 #include <common/physics/player.qh>
14 #include <common/viewloc.qh>
18 
19 .float death_time;
21 
22 // FEATURE: LOD
27 {
28  // LOD model loading
29  if(this.lodmodelindex0 != this.modelindex)
30  {
31  string modelname = this.model;
32  string s;
33 
34  vector mi = this.mins;
35  vector ma = this.maxs;
36 
37  // set modelindex
38  this.lodmodelindex0 = this.modelindex;
39  this.lodmodelindex1 = this.modelindex;
40  this.lodmodelindex2 = this.modelindex;
41 
42  // FIXME: this only supports 3-letter extensions
43  s = strcat(substring(modelname, 0, strlen(modelname)-4), "_lod1", substring(modelname, -4, 4));
44  if(fexists(s))
45  {
46  precache_model(s);
47  _setmodel(this, s);
48  if(this.modelindex)
49  this.lodmodelindex1 = this.modelindex;
50  }
51 
52  s = strcat(substring(modelname, 0, strlen(modelname)-4), "_lod2", substring(modelname, -4, 4));
53  if(fexists(s))
54  {
55  precache_model(s);
56  _setmodel(this, s);
57  if(this.modelindex)
58  this.lodmodelindex2 = this.modelindex;
59  }
60 
61  _setmodel(this, modelname); // make everything normal again
62  setsize(this, mi, ma);
63  }
64 
65  // apply LOD
67  {
69  this.modelindex = this.lodmodelindex2;
71  this.modelindex = this.lodmodelindex1;
72  else
73  this.modelindex = this.lodmodelindex0;
74  }
75  else
76  {
77  float distance = vlen(this.origin - view_origin);
78  float f = (distance * current_viewzoom + 100.0) * autocvar_cl_playerdetailreduction;
79  f *= 1.0 / bound(0.01, view_quality, 1);
81  this.modelindex = this.lodmodelindex2;
82  else if(f > autocvar_cl_loddistance1)
83  this.modelindex = this.lodmodelindex1;
84  else
85  this.modelindex = this.lodmodelindex0;
86  }
87 }
88 
89 // FEATURE: forcemodel and model color selection (MUST be called BEFORE LOD!)
94 
98 
100 
105 
108 
111 
112 .vector glowmod;
113 
115 {
118  this.skin = this.forceplayermodels_saveskin;
120 }
122 {
125  this.forceplayermodels_saveskin = this.skin;
127 
129  {
133  LOG_INFOF("Warning: missing model %s has been used", this.forceplayermodels_savemodel);
134  }
135 }
136 void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
137 {
138  int cm = this.forceplayermodels_savecolormap;
139  cm = (cm >= 1024) ? cm : (entcs_GetClientColors(cm - 1) + 1024);
140 
141  if(MUTATOR_CALLHOOK(ForcePlayermodels_Skip, this, islocalplayer))
142  goto skipforcemodels;
143 
144  // FORCEMODEL
145  // which one is ALWAYS good?
147  {
148  entity e = spawn();
149  precache_model(cvar_defstring("_cl_playermodel"));
150  _setmodel(e, cvar_defstring("_cl_playermodel"));
151  forceplayermodels_goodmodel = e.model;
152  forceplayermodels_goodmodelindex = e.modelindex;
153  delete(e);
154  }
155 
156  // first, try finding it from the server
158  {
159  if(islocalplayer)
160  {
161  if(!isdemo()) // this is mainly cheat protection; not needed for demos
162  {
163  // trust server's idea of "own player model"
169  }
170  }
171  }
172 
173  // forcemodel finding
175  {
177 
178  // only if this failed, find it out on our own
179  entity e = spawn();
180  precache_model(autocvar__cl_playermodel);
181  _setmodel(e, autocvar__cl_playermodel); // this is harmless, see below
183  forceplayermodels_model = e.model;
184  forceplayermodels_modelindex = e.modelindex;
186  delete(e);
187  }
188 
190  {
191  entity e = spawn();
192  _setmodel(e, autocvar_cl_forcemyplayermodel); // this is harmless, see below
194  forceplayermodels_mymodel = e.model;
195  forceplayermodels_mymodelindex = e.modelindex;
196  delete(e);
197  }
198 
199  // apply it
200  bool isfriend;
201 
202  if(teamplay)
203  isfriend = (cm == 1024 + 17 * myteam);
204  else
205  isfriend = islocalplayer;
206 
208  {
212  }
214  {
218  }
219  else if(this.forceplayermodels_isgoodmodel)
220  {
223  this.skin = this.forceplayermodels_saveskin;
224  }
225  else
226  {
229  this.skin = this.forceplayermodels_saveskin;
230  }
231 
232  LABEL(skipforcemodels)
233 
234  if(MUTATOR_CALLHOOK(ForcePlayercolors_Skip, this, islocalplayer))
235  goto skipforcecolors;
236 
237  bool forceplayercolors_enabled = false;
238  #define fpc autocvar_cl_forceplayercolors
239  if (ISGAMETYPE(DUEL))
240  {
241  if ((myteam != NUM_SPECTATOR) && (fpc == 1 || fpc == 2 || fpc == 3 || fpc == 5))
242  forceplayercolors_enabled = true;
243  }
244  else if (teamplay)
245  {
246  if ((team_count == 2) && (myteam != NUM_SPECTATOR) && (fpc == 2 || fpc == 4 || fpc == 5))
247  forceplayercolors_enabled = true;
248  }
249  else
250  {
251  if (fpc == 1 || fpc == 2)
252  forceplayercolors_enabled = true;
253  }
254 
255  // forceplayercolors too
256  if(teamplay)
257  {
258  // own team's color is never forced
259  int forcecolor_friend = 0, forcecolor_enemy = 0;
260  entity tm;
261 
263  forcecolor_friend = 1024 + autocvar_cl_forcemyplayercolors;
264 
265  if(forceplayercolors_enabled)
266  forcecolor_enemy = 1024 + autocvar__cl_color;
267 
268  if(forcecolor_enemy && !forcecolor_friend)
269  {
270  // only enemy color is forced?
271  // verify it is not equal to the friend color
272  if(forcecolor_enemy == 1024 + 17 * myteam)
273  forcecolor_enemy = 0;
274  }
275 
276  if(forcecolor_friend && !forcecolor_enemy)
277  {
278  // only friend color is forced?
279  // verify it is not equal to the enemy color
280  for(tm = teams.sort_next; tm; tm = tm.sort_next)
281  // note: we even compare against our own team.
282  // if we rejected because we matched our OWN team color,
283  // this is not bad; we then simply keep our color as is
284  // anyway.
285  if(forcecolor_friend == 1024 + 17 * tm.team)
286  forcecolor_friend = 0;
287  }
288 
289  if(cm == 1024 + 17 * myteam)
290  {
291  if(forcecolor_friend)
292  this.colormap = forcecolor_friend;
293  }
294  else
295  {
296  if(forcecolor_enemy)
297  this.colormap = forcecolor_enemy;
298  }
299  }
300  else // if(!teamplay)
301  {
302  if(autocvar_cl_forcemyplayercolors && islocalplayer)
304  else if (autocvar_cl_forceuniqueplayercolors && !islocalplayer && !ISGAMETYPE(DUEL))
305  {
306  // Assign each enemy unique colors
307  // pick colors from 0 to 14 since 15 is the rainbow color
308  // pl01 0 1, pl02 1 2, ..., pl14 13 14, pl15 14 0
309  // pl16 0 2, pl17 1 3, ..., pl29 13 0, pl30 14 1
310  int num = this.entnum - 1;
311  int c1 = num % 15;
312  int q = floor(num / 15);
313  int c2 = (c1 + 1 + q) % 15;
314  this.colormap = 1024 + (c1 << 4) + c2;
315  }
316  else if(forceplayercolors_enabled)
317  this.colormap = player_localnum + 1;
318  }
319 
320  LABEL(skipforcecolors)
321 
323  {
324  this.glowmod = '0 0 0';
325  this.colormap = 0;
326  return;
327  }
328 
329  // GLOWMOD AND DEATH FADING
330  if(this.colormap > 0)
331  this.glowmod = colormapPaletteColor(((this.colormap >= 1024) ? this.colormap : entcs_GetClientColors(this.colormap - 1)) & 0x0F, true) * 2;
332  else
333  this.glowmod = '1 1 1';
334 
335  if(autocvar_cl_deathglow > 0)
336  {
337  if(this.csqcmodel_isdead)
338  {
339  float min_factor = bound(0, autocvar_cl_deathglow_min, 1);
340  if(this.colormap > 0)
341  min_factor /= 2;
342  float glow_fade = bound(0, 1 - (time - this.death_time) / autocvar_cl_deathglow, 1);
343  this.glowmod *= (min_factor + glow_fade * (1 - min_factor));
344  if (this.glowmod == '0 0 0')
345  this.glowmod.x = 0.000001;
346  }
347  }
348 
349  //printf("CSQCPlayer_ModelAppearance_Apply(): state = %s, colormap = %f, glowmod = %s\n", (this.csqcmodel_isdead ? "DEAD" : "ALIVE"), this.colormap, vtos(this.glowmod));
350 }
351 
352 // FEATURE: fallback frames
355 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
356 .int csqcmodel_saveframe3;
357 .int csqcmodel_saveframe4;
358 #endif
360 
361 #define IS_DEAD_FRAME(f) ((f) == 0 || (f) == 1)
363 {
364  this.frame = this.csqcmodel_saveframe;
365  this.frame2 = this.csqcmodel_saveframe2;
366 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
367  this.frame3 = this.csqcmodel_saveframe3;
368  this.frame4 = this.csqcmodel_saveframe4;
369 #endif
370 }
372 {
373  this.csqcmodel_saveframe = this.frame;
374  this.csqcmodel_saveframe2 = this.frame2;
375 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
376  this.csqcmodel_saveframe3 = this.frame3;
377  this.csqcmodel_saveframe4 = this.frame4;
378 #endif
379 
380  // hack for death animations: set their frametime to zero in case a
381  // player "pops in"
382  if(isnew)
383  {
384 #define FIX_FRAMETIME(f,ft) MACRO_BEGIN \
385  if(IS_DEAD_FRAME(this.f) && this.ft != 0 && this.death_time != 0) \
386  this.ft = this.death_time; \
387 MACRO_END
390 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
393 #endif
394  }
395  this.csqcmodel_isdead = IS_DEAD_FRAME(this.frame);
396 }
398 {
400 }
402 {
403  TC(int, f);
404  if(frameduration(this.modelindex, f) > 0)
405  return f; // goooooood
406  if(frameduration(this.modelindex, 1) <= 0)
407  return f; // this is a static model. We can't fix it if we wanted to
408  switch(f)
409  {
410  case 23: return 11; // anim_melee -> anim_shoot
411  case 24: return 4; // anim_duckwalkbackwards -> anim_duckwalk
412  case 25: return 4; // anim_duckwalkstrafeleft -> anim_duckwalk
413  case 26: return 4; // anim_duckwalkstraferight -> anim_duckwalk
414  case 27: return 4; // anim_duckwalkforwardright -> anim_duckwalk
415  case 28: return 4; // anim_duckwalkforwardleft -> anim_duckwalk
416  case 29: return 4; // anim_duckwalkbackright -> anim_duckwalk
417  case 30: return 4; // anim_duckwalkbackleft -> anim_duckwalk
418  }
419  LOG_DEBUGF("Frame %d missing in model %s, and we have no fallback - FAIL!", f, this.model);
420  return f;
421 }
423 {
424  this.frame = CSQCPlayer_FallbackFrame(this, this.frame);
425  this.frame2 = CSQCPlayer_FallbackFrame(this, this.frame2);
426 #ifdef CSQCMODEL_HAVE_TWO_FRAMES
427  this.frame3 = CSQCPlayer_FallbackFrame(this, this.frame3);
428  this.frame4 = CSQCPlayer_FallbackFrame(this, this.frame4);
429 #endif
430 }
431 
432 // FEATURE: auto tag_index
433 .entity tag_entity;
437 {
438  if(this.tag_entity && wasfreed(this.tag_entity))
439  this.tag_entity = NULL;
440 
441  MUTATOR_CALLHOOK(TagIndex_Update, this);
442 
443  if(this.tag_networkentity)
444  {
445  // we are ATTACHED!
446  bool changed = 0;
447  if(this.tag_entity.entnum != this.tag_networkentity)
448  {
449  this.tag_entity = findfloat(NULL, entnum, this.tag_networkentity);
450  changed = 1;
451  }
452 
453  // recursive predraw call to fix issues with forcemodels and LOD if bone indexes mismatch
454  if(this.tag_entity.classname == "ENT_CLIENT_MODEL")
455  {
456  CSQCModel_Hook_PreDraw(this.tag_entity, (this.tag_entity.isplayermodel & ISPLAYER_CLIENT));
457  }
458 
459  if(this.tag_entity.modelindex != this.tag_entity_lastmodelindex)
460  {
461  this.tag_entity_lastmodelindex = this.tag_entity.modelindex;
462  changed = 1;
463  }
464  if(changed)
465  {
466  if(this.tag_entity)
467  {
468  // the best part is: IT EXISTS
469  if(substring(this.model, 0, 14) == "models/weapons")
470  {
471  if(substring(this.tag_entity.model, 0, 14) == "models/weapons")
472  {
473  this.tag_index = gettagindex(this.tag_entity, "weapon");
474  if(!this.tag_index)
475  this.tag_index = gettagindex(this.tag_entity, "tag_weapon");
476  if(!this.tag_index)
477  {
478  // we need to prevent this from 'appening
479  this.tag_entity = NULL;
480  this.drawmask = 0;
481  LOG_TRACE("h_ model lacks weapon attachment, but v_ model is attached to it");
482  }
483  }
484  else if((this.tag_entity.isplayermodel & ISPLAYER_MODEL))
485  {
487  this.tag_index = this.tag_entity.bone_weapon;
488  }
489  }
490 
491  if(substring(this.tag_entity.model, 0, 14) == "models/weapons")
492  {
493  this.tag_index = gettagindex(this.tag_entity, "shot");
494  if(!this.tag_index)
495  this.tag_index = gettagindex(this.tag_entity, "tag_shot");
496  }
497 
498  MUTATOR_CALLHOOK(TagIndex_Apply, this);
499  }
500  else
501  {
502  // damn, see you next frame
503  this.drawmask = 0;
504  }
505  }
506  }
507 }
508 
510 {
511  this.effects = this.csqcmodel_effects;
512  this.modelflags = this.csqcmodel_modelflags;
513  this.traileffect = this.csqcmodel_traileffect;
514 }
515 void Reset_ArcBeam();
517 {
518  if (this == csqcplayer) {
519  if (this.csqcmodel_teleported) {
520  Reset_ArcBeam();
521  }
522  }
523  this.csqcmodel_effects = this.effects;
524  this.csqcmodel_modelflags = this.modelflags;
525  this.csqcmodel_traileffect = this.traileffect;
526  this.effects = 0;
527  this.modelflags = 0;
528  if(this.csqcmodel_teleported)
529  Projectile_ResetTrail(this, this.origin);
530 }
533 {
535  int tref = this.csqcmodel_traileffect;
536 
538  this.effects = 0;
539  this.traileffect = 0;
540 
541  if(eff & EF_BRIGHTFIELD)
542  tref = EFFECT_TR_NEXUIZPLASMA.m_id;
543  // ignoring EF_MUZZLEFLASH
544  if(eff & EF_BRIGHTLIGHT)
545  adddynamiclight(this.origin, 400, '3 3 3');
546  if(eff & EF_DIMLIGHT)
547  adddynamiclight(this.origin, 200, '1.5 1.5 1.5');
548  if((eff & EF_NODRAW) || (this.alpha < 0))
549  this.drawmask = 0;
550  if(eff & EF_ADDITIVE)
551  this.renderflags |= RF_ADDITIVE;
552  if(eff & EF_BLUE)
553  adddynamiclight(this.origin, 200, '0.15 0.15 1.5');
554  if(eff & EF_RED)
555  adddynamiclight(this.origin, 200, '1.5 0.15 0.15');
556  // ignoring EF_NOGUNBOB
557  if(eff & EF_FULLBRIGHT)
558  this.renderflags |= RF_FULLBRIGHT;
559  if(eff & EF_FLAME)
560  {
561  boxparticles(particleeffectnum(EFFECT_EF_FLAME), this, this.absmin, this.absmax, this.velocity, this.velocity, bound(0, frametime, 0.1), 0);
562  //pointparticles(EFFECT_EF_FLAME, this.origin, '0 0 0', bound(0, frametime, 0.1));
563  }
564  if(eff & EF_STARDUST)
565  {
566  boxparticles(particleeffectnum(EFFECT_EF_STARDUST), this, this.absmin, this.absmax, this.velocity, this.velocity, bound(0, frametime, 0.1), 0);
567  //pointparticles(EFFECT_EF_STARDUST, this.origin, '0 0 0', bound(0, frametime, 0.1));
568  }
569  if(eff & EF_NOSHADOW)
570  this.renderflags |= RF_NOSHADOW;
571  if(eff & EF_NODEPTHTEST)
572  this.renderflags |= RF_DEPTHHACK;
573  // ignoring EF_SELECTABLE
574  if(eff & EF_DOUBLESIDED)
575  this.effects |= EF_DOUBLESIDED;
576  if(eff & EF_NOSELFSHADOW)
577  this.effects |= EF_NOSELFSHADOW;
578  if(eff & EF_DYNAMICMODELLIGHT)
580  // ignoring EF_UNUSED18, EF_UNUSED19, EF_RESTARTANIM_BIT, EF_TELEPORT_BIT, EF_LOWPRECISION
582  tref = EFFECT_TR_ROCKET.m_id;
584  tref = EFFECT_TR_GRENADE.m_id;
585  if(this.csqcmodel_modelflags & MF_GIB)
586  tref = EFFECT_TR_BLOOD.m_id;
588  {
589  // This will be hard to replace with MAKE_VECTORS because it's called as part of the predraw function
590  // as documented in csprogs.h in the engine. The globals can then be read in many places in the engine.
591  // However MF_ROTATE is currently only used in one place - might be possible to get rid of it entirely.
592  this.renderflags |= RF_USEAXIS;
593  makevectors(this.angles + '0 100 0' * fmod(time, 3.6));
594  }
596  tref = EFFECT_TR_WIZSPIKE.m_id;
598  tref = EFFECT_TR_SLIGHTBLOOD.m_id;
600  tref = EFFECT_TR_KNIGHTSPIKE.m_id;
602  tref = EFFECT_TR_VORESPIKE.m_id;
603 
604  this.traileffect = tref;
605 
606  if(this.drawmask)
607  Projectile_DrawTrail(this, this.origin);
608  else
609  Projectile_ResetTrail(this, this.origin);
610 
612  this.renderflags |= RF_ADDITIVE;
613  // also special in CSQCPlayer_GlowMod_Apply
614 
615  if(this.csqcmodel_modelflags & MF_ROCKET)
616  {
617  if(!this.snd_looping)
618  {
621  }
622  }
623  else
624  {
625  if(this.snd_looping)
626  {
628  this.snd_looping = 0;
629  }
630  }
631 }
632 
633 // general functions
644 void CSQCModel_Hook_PreDraw(entity this, bool isplayer)
645 {
647  return;
649 
650  if(!this.modelindex || this.model == "null")
651  {
652  this.drawmask = 0;
653  if(this.snd_looping > 0)
654  {
656  this.snd_looping = 0;
657  }
658  return;
659  }
660  else
661  this.drawmask = MASK_NORMAL;
662 
663  if((this.isplayermodel & ISPLAYER_MODEL) && this.drawmask) // this checks if it's a player MODEL!
664  {
666  CSQCPlayer_LOD_Apply(this);
667 
668  if(!isplayer)
669  {
670  skeleton_loadinfo(this);
671  bool doblend = (this.bone_upperbody >= 0);
673  if(doblend)
674  {
676  }
677  else
678  {
680  // just in case, clear these (we're animating in frame and frame3)
681  this.lerpfrac = 0;
682  this.lerpfrac4 = 0;
683  }
684  }
685  else
686  {
687  // we know that frame3 and frame4 fields, used by InterpolateAnimation, are left alone - but that is all we know!
688  skeleton_loadinfo(this);
689  bool doblend = (this.bone_upperbody >= 0);
690  bool onground = 0;
691  if(this == csqcplayer)
692  {
693  if(IS_ONGROUND(this))
694  onground = 1;
695  this.anim_prev_pmove_flags = this.flags;
696  if(this.flags & FL_DUCKED)
697  animdecide_setstate(this, this.anim_state | ANIMSTATE_DUCK, false);
698  else if(this.anim_state & ANIMSTATE_DUCK)
699  animdecide_setstate(this, this.anim_state - ANIMSTATE_DUCK, false);
700  }
701  else
702  {
703  tracebox(this.origin + '0 0 1', this.mins, this.maxs, this.origin - '0 0 4', MOVE_NORMAL, this);
705  onground = 1;
706  // predicted clients handle smoothing in the prediction code
707  this.origin = CSQCModel_ApplyStairSmoothing(this, onground, this.origin);
708  }
710  animdecide_setimplicitstate(this, onground);
712  int sf = 0;
713  if(this.anim_saveframe != this.anim_frame || this.anim_saveframe1time != this.anim_frame1time)
715  if(this.anim_saveframe2 != this.anim_frame2 || this.anim_saveframe2time != this.anim_frame2time)
717  this.anim_saveframe = this.anim_frame;
719  this.anim_saveframe2 = this.anim_frame2;
721  // Note: we always consider lerpfrac "changed", as it uses fixed values every time anyway.
722  // This ensures that .frame etc. are always written.
724  this.lerpfrac = (doblend ? 0.5 : 0);
725  this.frame = this.anim_frame;
726  this.frame1time = this.anim_frame1time;
727  this.frame2 = this.anim_frame2;
728  this.frame2time = this.anim_frame2time;
731  if(doblend)
732  {
734  }
735  else
736  {
738  // just in case, clear these (we're animating in frame and frame3)
739  this.lerpfrac = 0;
740  this.lerpfrac4 = 0;
741  }
742  }
743  }
744 
746 
748 }
749 
750 void CSQCModel_Hook_PreUpdate(entity this, bool isnew, bool isplayer, bool islocalplayer)
751 {
752  // interpolate v_angle
753  this.iflags |= IFLAG_V_ANGLE_X;
754  // revert to values from server
756  if((this.isplayermodel & ISPLAYER_MODEL))
757  {
758  if(!isplayer)
761  }
762 }
763 
764 void CSQCModel_Hook_PostUpdate(entity this, bool isnew, bool isplayer, bool islocalplayer)
765 {
766  // is it a player model? (shared state)
767  bool is_playermodel = (substring(this.model, 0, 14) == "models/player/" || substring(this.model, 0, 17) == "models/ok_player/" ||
768  (substring(this.model, 0, 16) == "models/monsters/" && (this.isplayermodel & BIT(1))));
769  this.isplayermodel = BITSET(this.isplayermodel, ISPLAYER_MODEL, is_playermodel);
770  this.csqcmodel_isdead = false; // workaround for dead players who become a spectator
771 
772  // save values set by server
773  if((this.isplayermodel & ISPLAYER_MODEL))
774  {
776  if(isplayer)
778  else
780  }
782 }
const float RF_USEAXIS
Definition: csprogsdefs.qc:170
#define CSQCMODEL_EF_RESPAWNGHOST
int forceplayermodels_goodmodelindex
bool autocvar_cl_respawn_ghosts_keepcolors
void CSQCModel_Hook_PostUpdate(entity this, bool isnew, bool isplayer, bool islocalplayer)
const int MF_ROTATE
int anim_frame2
void CSQCModel_Effects_Apply(entity this)
float colormap
Definition: csprogsdefs.qc:131
float alpha
Definition: items.qc:14
int anim_saveframe2time
const int NUM_SPECTATOR
Definition: teams.qh:23
int autocvar_cl_forcemyplayerskin
int iflags
Definition: interpolate.qh:26
float autocvar_cl_deathglow_min
const int EF_DYNAMICMODELLIGHT
string forceplayermodels_mymodel
int anim_frame2time
skin
Definition: ent_cs.qc:143
string forceplayermodels_isgoodmodel_mdl
#define adddynamiclight
Definition: post.qh:29
const int MF_ROCKET
void CSQCPlayer_AnimDecide_PostUpdate(entity this, bool isnew)
string forceplayermodels_model
void animdecide_setframes(entity e, float support_blending,.float fld_frame,.float fld_frame1time,.float fld_frame2,.float fld_frame2time)
Definition: animdecide.qc:296
const int EF_NOSELFSHADOW
void CSQCModel_Effects_PostUpdate(entity this)
void animdecide_setstate(entity e, int newstate, float restart)
Definition: animdecide.qc:330
bool csqcmodel_isdead
const float EF_FLAME
Definition: csprogsdefs.qc:302
const float RF_FULLBRIGHT
string autocvar_cl_forcemyplayermodel
void CSQCPlayer_ModelAppearance_PostUpdate(entity this)
float modelindex
Definition: csprogsdefs.qc:91
float frame2
secondary framegroup animation (strength = lerpfrac)
Definition: anim.qh:8
int autocvar__cl_playerskin
const float RF_NOSHADOW
int isplayermodel
const int EF_DIMLIGHT
float autocvar_cl_jetpack_attenuation
const int MF_TRACER2
entity() spawn
string autocvar__cl_playermodel
void animdecide_load_if_needed(entity e)
Definition: animdecide.qc:53
const float MOVE_NORMAL
Definition: csprogsdefs.qc:252
float frame4
quaternary framegroup animation (strength = lerpfrac4)
Definition: anim.qh:12
#define IS_ONGROUND(s)
Definition: movetypes.qh:16
float fmod(float e, float f)
Definition: mathlib.qc:208
vector view_origin
Definition: main.qh:93
vector maxs
Definition: csprogsdefs.qc:113
bool autocvar_cl_forceuniqueplayercolors
float current_viewzoom
Definition: main.qh:101
string forceplayermodels_savemodel
float frame3
tertiary framegroup animation (strength = lerpfrac3)
Definition: anim.qh:10
#define fpc
float frame2time
start time of framegroup animation
Definition: anim.qh:24
int forceplayermodels_mymodelindex
origin
Definition: ent_cs.qc:114
const int EF_BRIGHTLIGHT
int csqcmodel_traileffect
const float EF_NODEPTHTEST
Definition: csprogsdefs.qc:304
void CSQCPlayer_FallbackFrame_PostUpdate(entity this, bool isnew)
void CSQCModel_InterpolateAnimation_2To4_Do(entity this)
Definition: cl_model.qc:109
const int EF_BRIGHTFIELD
float effects
Definition: csprogsdefs.qc:111
const float EF_NOSHADOW
Definition: csprogsdefs.qc:306
void CSQCModel_AutoTagIndex_Apply(entity this)
int modelflags
const int CSQCMODEL_PROPERTY_FRAME2
Definition: common.qh:67
string model
Definition: csprogsdefs.qc:108
float renderflags
Definition: main.qh:95
void Projectile_DrawTrail(entity this, vector to)
Definition: projectile.qc:29
#define gettagindex
Definition: dpextensions.qh:16
int anim_saveframe1time
void Reset_ArcBeam()
const float EF_ADDITIVE
Definition: csprogsdefs.qc:300
const int MF_TRACER
int lodmodelindex0
void Projectile_ResetTrail(entity this, vector to)
Definition: projectile.qc:23
entity teams
Definition: main.qh:44
string forceplayermodels_goodmodel
vector absmax
Definition: csprogsdefs.qc:92
const float EF_NODRAW
Definition: csprogsdefs.qc:305
void CSQCPlayer_LOD_Apply(entity this)
const int MF_ZOMGIB
const float EF_FULLBRIGHT
Definition: csprogsdefs.qc:303
void CSQCPlayer_FallbackFrame_Apply(entity this)
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition: bits.qh:8
const float RF_DEPTHHACK
Definition: csprogsdefs.qc:168
void CSQCModel_Hook_PreDraw(entity this, bool isplayer)
int csqcmodel_effects
vector mins
Definition: csprogsdefs.qc:113
int forceplayermodels_saveskin
int csqcmodel_modelflags
void CSQCModel_Effects_PreUpdate(entity this)
void CSQCPlayer_FallbackFrame_PreUpdate(entity this)
int csqcmodel_framecount
float frame3time
start time of framegroup animation
Definition: anim.qh:26
const int ISPLAYER_LOCAL
Definition: common.qh:58
#define LOG_INFOF(...)
Definition: log.qh:71
int autocvar_cl_forcemyplayercolors
const float EF_BLUE
Definition: csprogsdefs.qc:301
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
int anim_frame
float lerpfrac
strength of framegroup blend
Definition: anim.qh:15
int csqcmodel_saveframe
void animdecide_setimplicitstate(entity e, float onground)
Definition: animdecide.qc:248
int autocvar__cl_color
int CSQCPlayer_FallbackFrame(entity this, int f)
void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
float lerpfrac4
strength of framegroup blend
Definition: anim.qh:19
bool forceplayermodels_modelisgoodmodel
#define NULL
Definition: post.qh:17
float frametime
Definition: csprogsdefs.qc:17
const int IFLAG_V_ANGLE_X
Definition: interpolate.qh:35
const int MF_GIB
float autocvar_cl_loddistance1
const float VOL_BASE
Definition: sound.qh:36
#define TC(T, sym)
Definition: _all.inc:82
void CSQCModel_InterpolateAnimation_2To4_PreNote(entity this, int sf)
Definition: cl_model.qc:37
bool forceplayermodels_myisgoodmodel
int lodmodelindex2
int anim_prev_pmove_flags
int anim_state
Definition: animdecide.qh:108
float teamplay
Definition: progsdefs.qc:31
const float MASK_NORMAL
Definition: csprogsdefs.qc:164
float drawmask
Definition: csprogsdefs.qc:95
const int CH_TRIGGER_SINGLE
Definition: sound.qh:13
const float RF_ADDITIVE
Definition: csprogsdefs.qc:169
#define BITSET(var, mask, flag)
Definition: bits.qh:11
const int CSQCMODEL_PROPERTY_LERPFRAC
Definition: common.qh:68
vector(float skel, float bonenum) _skel_get_boneabs_hidden
float autocvar_cl_loddistance2
int anim_saveframe2
#define IS_DEAD_FRAME(f)
float frame4time
start time of framegroup animation
Definition: anim.qh:28
const int MF_GRENADE
const float EF_RED
Definition: csprogsdefs.qc:307
const int MF_TRACER3
float flags
Definition: csprogsdefs.qc:129
int forceplayermodels_modelindex
#define LOG_TRACE(...)
Definition: log.qh:81
float view_quality
Definition: main.qh:143
#define ISGAMETYPE(NAME)
Definition: main.qh:32
int csqcmodel_saveframe2
const int CSQCMODEL_PROPERTY_FRAME
Definition: common.qh:61
int forceplayermodels_savecolormap
int lodmodelindex1
void CSQCPlayer_ModelAppearance_PreUpdate(entity this)
const int ISPLAYER_CLIENT
Definition: common.qh:57
const int EF_DOUBLESIDED
float team_count
Definition: main.qh:45
#define MUTATOR_CALLHOOK(id,...)
Definition: base.qh:140
const int ANIMSTATE_DEAD2
Definition: animdecide.qh:126
int autocvar_cl_playerdetailreduction
void free_skeleton_from_frames(entity e)
#define LABEL(id)
Definition: compiler.qh:36
int anim_frame1time
float frame
primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
Definition: anim.qh:6
void CSQCModel_Hook_PreUpdate(entity this, bool isnew, bool isplayer, bool islocalplayer)
vector CSQCModel_ApplyStairSmoothing(entity this, bool isonground, vector v)
Definition: cl_player.qc:245
bool autocvar_cl_forceplayermodels
const int ANIMSTATE_DEAD1
Definition: animdecide.qh:125
int csqcmodel_predraw_run
int tag_index
vector angles
Definition: csprogsdefs.qc:104
entity csqcplayer
Definition: cl_player.qh:26
float trace_startsolid
Definition: csprogsdefs.qc:35
float autocvar_cl_deathglow
#define sound(e, c, s, v, a)
Definition: sound.qh:52
vector absmin
Definition: csprogsdefs.qc:92
int framecount
Definition: main.qh:149
int anim_saveframe
void CSQCModel_InterpolateAnimation_2To4_Note(entity this, int sf, bool set_times)
Definition: cl_model.qc:73
entity tag_entity
vector glowmod
const int ISPLAYER_MODEL
Definition: common.qh:56
float time
Definition: csprogsdefs.qc:16
const int ANIMSTATE_DUCK
Definition: animdecide.qh:127
vector velocity
Definition: csprogsdefs.qc:103
ERASEABLE bool fexists(string f)
Definition: file.qh:4
void skeleton_from_frames(entity e, bool is_dead)
int forceplayermodels_skin
int forceplayermodels_savemodelindex
float death_time
#define makevectors
Definition: post.qh:21
float trace_fraction
Definition: csprogsdefs.qc:36
void skeleton_loadinfo(entity e)
float entnum
Definition: csprogsdefs.qc:94
#define boolean(value)
Definition: bool.qh:9
float player_localnum
Definition: csprogsdefs.qc:20
bool forceplayermodels_isgoodmodel
#define FIX_FRAMETIME(f, ft)
float RF_DYNAMICMODELLIGHT
int tag_entity_lastmodelindex
float csqcmodel_teleported
Definition: cl_model.qh:39
#define colormapPaletteColor(c, isPants)
Definition: color.qh:5
const float EF_STARDUST
Definition: csprogsdefs.qc:308
float frame1time
start time of framegroup animation
Definition: anim.qh:22
#define LOG_DEBUGF(...)
Definition: log.qh:86
int snd_looping
bool forceplayermodels_attempted
#define particleeffectnum(e)
Definition: effect.qh:3