if(this.tag_entity && wasfreed(this.tag_entity))
this.tag_entity = world;
- WITH(entity, self, this, viewloc_SetTags());
+ viewloc_SetTags(this);
MUTATOR_CALLHOOK(TagIndex_Update, this);
// recursive predraw call to fix issues with forcemodels and LOD if bone indexes mismatch
if(this.tag_entity.classname == "csqcmodel")
{
- WITH(entity, this, this.tag_entity, CSQCModel_Hook_PreDraw(this, (this.entnum >= 1 && this.entnum <= maxclients)));
+ CSQCModel_Hook_PreDraw(this.tag_entity, (this.entnum >= 1 && this.entnum <= maxclients));
}
if(this.tag_entity.modelindex != this.tag_entity_lastmodelindex)
{
if (this == csqcplayer) {
if (this.csqcmodel_teleported) {
- WITH(entity, self, this, Reset_ArcBeam());
+ Reset_ArcBeam();
}
}
this.csqcmodel_effects = this.effects;
this.anim_saveframe2time = this.anim_frame2time;
// Note: we always consider lerpfrac "changed", as it uses fixed values every time anyway.
// This ensures that .frame etc. are always written.
- WITH(entity, self, this, CSQCModel_InterpolateAnimation_2To4_PreNote(sf | CSQCMODEL_PROPERTY_LERPFRAC));
+ CSQCModel_InterpolateAnimation_2To4_PreNote(this, sf | CSQCMODEL_PROPERTY_LERPFRAC);
this.lerpfrac = (doblend ? 0.5 : 0);
this.frame = this.anim_frame;
this.frame1time = this.anim_frame1time;
this.frame2 = this.anim_frame2;
this.frame2time = this.anim_frame2time;
- WITH(entity, self, this, CSQCModel_InterpolateAnimation_2To4_Note(sf | CSQCMODEL_PROPERTY_LERPFRAC, false));
- WITH(entity, self, this, CSQCModel_InterpolateAnimation_2To4_Do());
+ CSQCModel_InterpolateAnimation_2To4_Note(this, sf | CSQCMODEL_PROPERTY_LERPFRAC, false);
+ CSQCModel_InterpolateAnimation_2To4_Do(this);
if(doblend)
{
skeleton_from_frames(this, this.csqcmodel_isdead);
.float csqcmodel_lerpfractime;
.float csqcmodel_lerpfrac2time;
-void CSQCModel_InterpolateAnimation_2To4_PreNote(int sf)
-{SELFPARAM();
+void CSQCModel_InterpolateAnimation_2To4_PreNote(entity this, int sf)
+{
if(sf & CSQCMODEL_PROPERTY_FRAME)
{
- self.frame3 = self.frame;
- self.frame3time = self.frame1time;
+ this.frame3 = this.frame;
+ this.frame3time = this.frame1time;
}
if(sf & CSQCMODEL_PROPERTY_FRAME2)
{
- self.frame4 = self.frame2;
- self.frame4time = self.frame2time;
+ this.frame4 = this.frame2;
+ this.frame4time = this.frame2time;
}
if(sf & CSQCMODEL_PROPERTY_LERPFRAC)
{
- self.csqcmodel_lerpfrac2 = self.csqcmodel_lerpfrac;
- self.csqcmodel_lerpfrac2time = self.csqcmodel_lerpfractime;
- self.lerpfrac = self.csqcmodel_lerpfrac;
+ this.csqcmodel_lerpfrac2 = this.csqcmodel_lerpfrac;
+ this.csqcmodel_lerpfrac2time = this.csqcmodel_lerpfractime;
+ this.lerpfrac = this.csqcmodel_lerpfrac;
}
}
-void CSQCModel_InterpolateAnimation_1To2_PreNote(int sf)
-{SELFPARAM();
+void CSQCModel_InterpolateAnimation_1To2_PreNote(entity this, int sf)
+{
if(sf & CSQCMODEL_PROPERTY_FRAME)
{
- self.frame2 = self.frame;
- self.frame2time = self.frame1time;
+ this.frame2 = this.frame;
+ this.frame2time = this.frame1time;
}
}
-void CSQCModel_InterpolateAnimation_PreNote(int sf)
+void CSQCModel_InterpolateAnimation_PreNote(entity this, int sf)
{
#ifdef CSQCMODEL_HAVE_TWO_FRAMES
- CSQCModel_InterpolateAnimation_2To4_PreNote(sf);
+ CSQCModel_InterpolateAnimation_2To4_PreNote(this, sf);
#else
- CSQCModel_InterpolateAnimation_1To2_PreNote(sf);
+ CSQCModel_InterpolateAnimation_1To2_PreNote(this, sf);
#endif
}
-void CSQCModel_InterpolateAnimation_2To4_Note(int sf, float set_times)
-{SELFPARAM();
+void CSQCModel_InterpolateAnimation_2To4_Note(entity this, int sf, bool set_times)
+{
if(sf & CSQCMODEL_PROPERTY_FRAME)
{
if(set_times)
- self.frame1time = time;
+ this.frame1time = time;
}
if(sf & CSQCMODEL_PROPERTY_FRAME2)
{
if(set_times)
- self.frame2time = time;
+ this.frame2time = time;
}
if(sf & CSQCMODEL_PROPERTY_LERPFRAC)
{
- self.csqcmodel_lerpfrac = self.lerpfrac;
+ this.csqcmodel_lerpfrac = this.lerpfrac;
if(set_times)
- self.csqcmodel_lerpfractime = time;
+ this.csqcmodel_lerpfractime = time;
}
}
-void CSQCModel_InterpolateAnimation_1To2_Note(int sf, float set_times)
-{SELFPARAM();
+void CSQCModel_InterpolateAnimation_1To2_Note(entity this, int sf, bool set_times)
+{
if(sf & CSQCMODEL_PROPERTY_FRAME)
{
if(set_times)
- self.frame1time = time;
+ this.frame1time = time;
}
}
-void CSQCModel_InterpolateAnimation_Note(int sf)
+void CSQCModel_InterpolateAnimation_Note(entity this, int sf)
{
#ifdef CSQCMODEL_HAVE_TWO_FRAMES
- CSQCModel_InterpolateAnimation_2To4_Note(sf, true);
+ CSQCModel_InterpolateAnimation_2To4_Note(this, sf, true);
#else
- CSQCModel_InterpolateAnimation_1To2_Note(sf, true);
+ CSQCModel_InterpolateAnimation_1To2_Note(this, sf, true);
#endif
}
-void CSQCModel_InterpolateAnimation_2To4_Do()
-{SELFPARAM();
+void CSQCModel_InterpolateAnimation_2To4_Do(entity this)
+{
if(autocvar_cl_nolerp || (autocvar_cl_lerpanim_maxdelta_framegroups == 0))
{
- self.lerpfrac = self.csqcmodel_lerpfrac;
- self.lerpfrac3 = 0;
- self.lerpfrac4 = 0;
+ this.lerpfrac = this.csqcmodel_lerpfrac;
+ this.lerpfrac3 = 0;
+ this.lerpfrac4 = 0;
}
else
{
float l13, l24, llf;
float l24_13;
- if(self.frame3time == 0) // if frame1/3 were not previously displayed, only frame1 can make sense
+ if(this.frame3time == 0) // if frame1/3 were not previously displayed, only frame1 can make sense
l13 = 1;
else
- l13 = bound(0, (time - self.frame1time) / autocvar_cl_lerpanim_maxdelta_framegroups, 1);
+ l13 = bound(0, (time - this.frame1time) / autocvar_cl_lerpanim_maxdelta_framegroups, 1);
- if(self.frame4time == 0) // if frame2/4 were not previously displayed, only frame2 can make sense
+ if(this.frame4time == 0) // if frame2/4 were not previously displayed, only frame2 can make sense
l24 = 1;
else
- l24 = bound(0, (time - self.frame2time) / autocvar_cl_lerpanim_maxdelta_framegroups, 1);
+ l24 = bound(0, (time - this.frame2time) / autocvar_cl_lerpanim_maxdelta_framegroups, 1);
- if(self.csqcmodel_lerpfrac2time == 0) // if there is no old lerpfrac (newly displayed model), only lerpfrac makes sense
+ if(this.csqcmodel_lerpfrac2time == 0) // if there is no old lerpfrac (newly displayed model), only lerpfrac makes sense
llf = 1;
else
- llf = bound(0, (time - self.csqcmodel_lerpfractime) / autocvar_cl_lerpanim_maxdelta_framegroups, 1);
+ llf = bound(0, (time - this.csqcmodel_lerpfractime) / autocvar_cl_lerpanim_maxdelta_framegroups, 1);
- l24_13 = self.csqcmodel_lerpfrac * llf + self.csqcmodel_lerpfrac2 * (1 - llf);
+ l24_13 = this.csqcmodel_lerpfrac * llf + this.csqcmodel_lerpfrac2 * (1 - llf);
- self.lerpfrac = l24 * l24_13;
- self.lerpfrac4 = (1 - l24) * l24_13;
- self.lerpfrac3 = (1 - l13) * (1 - l24_13);
+ this.lerpfrac = l24 * l24_13;
+ this.lerpfrac4 = (1 - l24) * l24_13;
+ this.lerpfrac3 = (1 - l13) * (1 - l24_13);
if(l24_13 == 0) // if frames 2/4 are not displayed, clear their frametime
{
- self.frame2time = 0;
- self.frame4time = 0;
+ this.frame2time = 0;
+ this.frame4time = 0;
}
if(l24_13 == 1) // if frames 1/3 are not displayed, clear their frametime
{
- self.frame1time = 0;
- self.frame3time = 0;
+ this.frame1time = 0;
+ this.frame3time = 0;
}
}
}
-void CSQCModel_InterpolateAnimation_1To2_Do()
-{SELFPARAM();
+void CSQCModel_InterpolateAnimation_1To2_Do(entity this)
+{
if(autocvar_cl_nolerp || (autocvar_cl_lerpanim_maxdelta_framegroups == 0))
{
- self.lerpfrac = 0;
+ this.lerpfrac = 0;
}
else
{
- if(self.frame2time == 0) // if frame2 was not previously displayed, only frame1 can make sense
- self.lerpfrac = 0;
+ if(this.frame2time == 0) // if frame2 was not previously displayed, only frame1 can make sense
+ this.lerpfrac = 0;
else
- self.lerpfrac = 1 - bound(0, (time - self.frame1time) / autocvar_cl_lerpanim_maxdelta_framegroups, 1);
+ this.lerpfrac = 1 - bound(0, (time - this.frame1time) / autocvar_cl_lerpanim_maxdelta_framegroups, 1);
}
}
-void CSQCModel_InterpolateAnimation_Do()
+void CSQCModel_InterpolateAnimation_Do(entity this)
{
#ifdef CSQCMODEL_HAVE_TWO_FRAMES
- CSQCModel_InterpolateAnimation_2To4_Do();
+ CSQCModel_InterpolateAnimation_2To4_Do(this);
#else
- CSQCModel_InterpolateAnimation_1To2_Do();
+ CSQCModel_InterpolateAnimation_1To2_Do(this);
#endif
}
// by CSQCPlayer_SetCamera()
if (!CSQCPlayer_IsLocalPlayer(this)) InterpolateOrigin_Do(this);
- WITH(entity, self, this, CSQCModel_InterpolateAnimation_Do());
+ CSQCModel_InterpolateAnimation_Do(this);
{ CSQCMODEL_HOOK_PREDRAW }
CSQCPlayer_PreUpdate(this);
InterpolateOrigin_Undo(this);
- CSQCModel_InterpolateAnimation_PreNote(sf);
+ CSQCModel_InterpolateAnimation_PreNote(this, sf);
#define CSQCMODEL_IF(cond) if(cond) {
#define CSQCMODEL_ENDIF }
this.csqcmodel_teleported = 1;
}
- CSQCModel_InterpolateAnimation_Note(sf);
+ CSQCModel_InterpolateAnimation_Note(this, sf);
InterpolateOrigin_Note(this);
CSQCPlayer_PostUpdate(this);
#ifdef CSQCMODEL_SUPPORT_GETTAGINFO_BEFORE_DRAW
InterpolateOrigin_Do(this);
- CSQCModel_InterpolateAnimation_Do();
+ CSQCModel_InterpolateAnimation_Do(this);
#endif
// relink