From 9ae63d858415772fdb60bd549758825103c0ba17 Mon Sep 17 00:00:00 2001 From: TimePath Date: Wed, 7 Oct 2015 13:51:02 +1100 Subject: [PATCH] Draw: purge SELFPARAM --- qcsrc/client/announcer.qc | 9 +- qcsrc/client/command/cl_cmd.qc | 4 +- qcsrc/client/controlpoint.qc | 230 +++++++++--------- qcsrc/client/controlpoint.qh | 2 +- qcsrc/client/csqcmodel_hooks.qc | 6 +- qcsrc/client/generator.qc | 8 +- qcsrc/client/gibs.qc | 4 +- qcsrc/client/gibs.qh | 2 +- qcsrc/client/hook.qc | 4 +- qcsrc/client/laser.qc | 2 +- qcsrc/client/main.qc | 12 +- qcsrc/client/main.qh | 4 +- qcsrc/client/modeleffects.qc | 4 +- qcsrc/client/modeleffects.qh | 2 +- qcsrc/client/particles.qh | 2 +- qcsrc/client/view.qc | 6 +- qcsrc/client/wall.qc | 4 +- qcsrc/client/wall.qh | 2 +- qcsrc/client/weapons/projectile.qc | 41 ++-- qcsrc/client/weapons/projectile.qh | 6 +- qcsrc/common/mutators/mutator/casings.qc | 4 +- qcsrc/common/mutators/mutator/damagetext.qc | 5 +- .../mutator/waypoints/waypointsprites.qc | 4 +- .../mutator/waypoints/waypointsprites.qh | 2 +- qcsrc/common/nades/all.qc | 4 +- qcsrc/common/triggers/func/conveyor.qc | 4 +- qcsrc/common/triggers/func/door.qc | 4 +- qcsrc/common/triggers/func/plat.qc | 2 +- qcsrc/common/triggers/func/pointparticles.qc | 4 +- qcsrc/common/triggers/func/rainsnow.qc | 8 +- qcsrc/common/triggers/func/train.qc | 2 +- qcsrc/common/triggers/misc/laser.qc | 4 +- qcsrc/common/triggers/triggers.qc | 4 +- qcsrc/common/turrets/cl_turrets.qc | 12 +- qcsrc/common/turrets/turret/ewheel.qc | 4 +- qcsrc/common/turrets/turret/walker.qc | 4 +- qcsrc/common/vehicles/cl_vehicles.qc | 4 +- qcsrc/common/vehicles/cl_vehicles.qh | 2 +- .../vehicles/vehicle/bumblebee_weapons.qc | 6 +- .../common/vehicles/vehicle/raptor_weapons.qc | 4 +- qcsrc/common/weapons/weapon/arc.qc | 4 +- qcsrc/common/weapons/weapon/shockwave.qc | 4 +- qcsrc/server/t_items.qc | 8 +- qcsrc/server/t_items.qh | 4 +- 44 files changed, 231 insertions(+), 230 deletions(-) diff --git a/qcsrc/client/announcer.qc b/qcsrc/client/announcer.qc index 8f477171c..b7b7bb5c6 100644 --- a/qcsrc/client/announcer.qc +++ b/qcsrc/client/announcer.qc @@ -8,13 +8,14 @@ bool announcer_1min; bool announcer_5min; void Announcer_Countdown() -{SELFPARAM(); +{ + SELFPARAM(); float starttime = getstatf(STAT_GAMESTARTTIME); float roundstarttime = getstatf(STAT_ROUNDSTARTTIME); if(roundstarttime == -1) { Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTOP); - remove(self); + remove(this); return; } if(roundstarttime >= starttime) @@ -29,7 +30,7 @@ void Announcer_Countdown() { Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_BEGIN); Local_Notification(MSG_MULTI, MULTI_COUNTDOWN_BEGIN); - remove(self); + remove(this); return; } else // countdown is still going @@ -46,7 +47,7 @@ void Announcer_Countdown() Local_Notification(MSG_ANNCE, Announcer_PickNumber(CNT_GAMESTART, countdown_rounded)); } - self.nextthink = (starttime - (countdown - 1)); + this.nextthink = (starttime - (countdown - 1)); } } diff --git a/qcsrc/client/command/cl_cmd.qc b/qcsrc/client/command/cl_cmd.qc index 72fa24483..88cd246ff 100644 --- a/qcsrc/client/command/cl_cmd.qc +++ b/qcsrc/client/command/cl_cmd.qc @@ -20,8 +20,8 @@ #include "../../common/command/generic.qh" -void DrawDebugModel() -{SELFPARAM(); +void DrawDebugModel(entity this) +{ if(time - floor(time) > 0.5) { PolyDrawModel(self); diff --git a/qcsrc/client/controlpoint.qc b/qcsrc/client/controlpoint.qc index a83260b10..34301d806 100644 --- a/qcsrc/client/controlpoint.qc +++ b/qcsrc/client/controlpoint.qc @@ -20,180 +20,180 @@ .entity icon_realmodel; -void cpicon_draw() -{SELFPARAM(); - if(time < self.move_time) { return; } +void cpicon_draw(entity this) +{ + if(time < this.move_time) { return; } - if(self.cp_bob_dmg_z > 0) - self.cp_bob_dmg_z = self.cp_bob_dmg_z - 3 * frametime; + if(this.cp_bob_dmg_z > 0) + this.cp_bob_dmg_z = this.cp_bob_dmg_z - 3 * frametime; else - self.cp_bob_dmg_z = 0; - self.cp_bob_origin_z = 4 * PI * (1 - cos(self.cp_bob_spd)); - self.cp_bob_spd = self.cp_bob_spd + 1.875 * frametime; - self.colormod = '1 1 1' * (2 - bound(0, (self.pain_finished - time) / 10, 1)); + this.cp_bob_dmg_z = 0; + this.cp_bob_origin_z = 4 * PI * (1 - cos(this.cp_bob_spd)); + this.cp_bob_spd = this.cp_bob_spd + 1.875 * frametime; + this.colormod = '1 1 1' * (2 - bound(0, (this.pain_finished - time) / 10, 1)); - if(!self.iscaptured) self.alpha = self.health / self.max_health; + if(!this.iscaptured) this.alpha = this.health / this.max_health; - if(self.iscaptured) + if(this.iscaptured) { - if (self.punchangle_x > 0) + if (this.punchangle_x > 0) { - self.punchangle_x = self.punchangle_x - 60 * frametime; - if (self.punchangle_x < 0) - self.punchangle_x = 0; + this.punchangle_x = this.punchangle_x - 60 * frametime; + if (this.punchangle_x < 0) + this.punchangle_x = 0; } - else if (self.punchangle_x < 0) + else if (this.punchangle_x < 0) { - self.punchangle_x = self.punchangle_x + 60 * frametime; - if (self.punchangle_x > 0) - self.punchangle_x = 0; + this.punchangle_x = this.punchangle_x + 60 * frametime; + if (this.punchangle_x > 0) + this.punchangle_x = 0; } - if (self.punchangle_y > 0) + if (this.punchangle_y > 0) { - self.punchangle_y = self.punchangle_y - 60 * frametime; - if (self.punchangle_y < 0) - self.punchangle_y = 0; + this.punchangle_y = this.punchangle_y - 60 * frametime; + if (this.punchangle_y < 0) + this.punchangle_y = 0; } - else if (self.punchangle_y < 0) + else if (this.punchangle_y < 0) { - self.punchangle_y = self.punchangle_y + 60 * frametime; - if (self.punchangle_y > 0) - self.punchangle_y = 0; + this.punchangle_y = this.punchangle_y + 60 * frametime; + if (this.punchangle_y > 0) + this.punchangle_y = 0; } - if (self.punchangle_z > 0) + if (this.punchangle_z > 0) { - self.punchangle_z = self.punchangle_z - 60 * frametime; - if (self.punchangle_z < 0) - self.punchangle_z = 0; + this.punchangle_z = this.punchangle_z - 60 * frametime; + if (this.punchangle_z < 0) + this.punchangle_z = 0; } - else if (self.punchangle_z < 0) + else if (this.punchangle_z < 0) { - self.punchangle_z = self.punchangle_z + 60 * frametime; - if (self.punchangle_z > 0) - self.punchangle_z = 0; + this.punchangle_z = this.punchangle_z + 60 * frametime; + if (this.punchangle_z > 0) + this.punchangle_z = 0; } - self.angles_x = self.punchangle_x; - self.angles_y = self.punchangle_y + self.move_angles_y; - self.angles_z = self.punchangle_z; - self.move_angles_y = self.move_angles_y + 45 * frametime; + this.angles_x = this.punchangle_x; + this.angles_y = this.punchangle_y + this.move_angles_y; + this.angles_z = this.punchangle_z; + this.move_angles_y = this.move_angles_y + 45 * frametime; } - setorigin(self, self.cp_origin + self.cp_bob_origin + self.cp_bob_dmg); + setorigin(this, this.cp_origin + this.cp_bob_origin + this.cp_bob_dmg); } -void cpicon_damage(float hp) -{SELFPARAM(); - if(!self.iscaptured) { return; } +void cpicon_damage(entity this, float hp) +{ + if(!this.iscaptured) { return; } - if(hp < self.max_health * 0.25) - setmodel(self, MDL_ONS_CP3); - else if(hp < self.max_health * 0.50) - setmodel(self, MDL_ONS_CP2); - else if(hp < self.max_health * 0.75) - setmodel(self, MDL_ONS_CP1); - else if(hp <= self.max_health || hp >= self.max_health) - setmodel(self, MDL_ONS_CP); + if(hp < this.max_health * 0.25) + setmodel(this, MDL_ONS_CP3); + else if(hp < this.max_health * 0.50) + setmodel(this, MDL_ONS_CP2); + else if(hp < this.max_health * 0.75) + setmodel(this, MDL_ONS_CP1); + else if(hp <= this.max_health || hp >= this.max_health) + setmodel(this, MDL_ONS_CP); - self.punchangle = (2 * randomvec() - '1 1 1') * 45; + this.punchangle = (2 * randomvec() - '1 1 1') * 45; - self.cp_bob_dmg_z = (2 * random() - 1) * 15; - self.pain_finished = time + 1; - self.colormod = '2 2 2'; + this.cp_bob_dmg_z = (2 * random() - 1) * 15; + this.pain_finished = time + 1; + this.colormod = '2 2 2'; - setsize(self, CPICON_MIN, CPICON_MAX); + setsize(this, CPICON_MIN, CPICON_MAX); } -void cpicon_construct() -{SELFPARAM(); - self.netname = "Control Point Icon"; +void cpicon_construct(entity this) +{ + this.netname = "Control Point Icon"; - setmodel(self, MDL_ONS_CP); - setsize(self, CPICON_MIN, CPICON_MAX); + setmodel(this, MDL_ONS_CP); + setsize(this, CPICON_MIN, CPICON_MAX); - if(self.icon_realmodel == world) + if(this.icon_realmodel == world) { - self.icon_realmodel = spawn(); - setmodel(self.icon_realmodel, MDL_Null); - setorigin(self.icon_realmodel, self.origin); - setsize(self.icon_realmodel, CPICON_MIN, CPICON_MAX); - self.icon_realmodel.movetype = MOVETYPE_NOCLIP; - self.icon_realmodel.solid = SOLID_NOT; - self.icon_realmodel.move_origin = self.icon_realmodel.origin; + this.icon_realmodel = spawn(); + setmodel(this.icon_realmodel, MDL_Null); + setorigin(this.icon_realmodel, this.origin); + setsize(this.icon_realmodel, CPICON_MIN, CPICON_MAX); + this.icon_realmodel.movetype = MOVETYPE_NOCLIP; + this.icon_realmodel.solid = SOLID_NOT; + this.icon_realmodel.move_origin = this.icon_realmodel.origin; } - if(self.iscaptured) { self.icon_realmodel.solid = SOLID_BBOX; } - - self.move_movetype = MOVETYPE_NOCLIP; - self.solid = SOLID_NOT; - self.movetype = MOVETYPE_NOCLIP; - self.move_origin = self.origin; - self.move_time = time; - self.drawmask = MASK_NORMAL; - self.alpha = 1; - self.draw = cpicon_draw; - self.cp_origin = self.origin; - self.cp_bob_origin = '0 0 0.1'; - self.cp_bob_spd = 0; + if(this.iscaptured) { this.icon_realmodel.solid = SOLID_BBOX; } + + this.move_movetype = MOVETYPE_NOCLIP; + this.solid = SOLID_NOT; + this.movetype = MOVETYPE_NOCLIP; + this.move_origin = this.origin; + this.move_time = time; + this.drawmask = MASK_NORMAL; + this.alpha = 1; + this.draw = cpicon_draw; + this.cp_origin = this.origin; + this.cp_bob_origin = '0 0 0.1'; + this.cp_bob_spd = 0; } .vector glowmod; -void cpicon_changeteam() -{SELFPARAM(); - if(self.team) +void cpicon_changeteam(entity this) +{ + if(this.team) { - self.glowmod = Team_ColorRGB(self.team - 1); - self.teamradar_color = Team_ColorRGB(self.team - 1); - self.colormap = 1024 + (self.team - 1) * 17; + this.glowmod = Team_ColorRGB(this.team - 1); + this.teamradar_color = Team_ColorRGB(this.team - 1); + this.colormap = 1024 + (this.team - 1) * 17; } else { - self.colormap = 1024; - self.glowmod = '1 1 0'; - self.teamradar_color = '1 1 0'; + this.colormap = 1024; + this.glowmod = '1 1 0'; + this.teamradar_color = '1 1 0'; } } -void ent_cpicon() -{SELFPARAM(); +void ent_cpicon(entity this) +{ int sf = ReadByte(); if(sf & CPSF_SETUP) { - self.origin_x = ReadCoord(); - self.origin_y = ReadCoord(); - self.origin_z = ReadCoord(); - setorigin(self, self.origin); - - self.health = ReadByte(); - self.max_health = ReadByte(); - self.count = ReadByte(); - self.team = ReadByte(); - self.iscaptured = ReadByte(); - - if(!self.count) - self.count = (self.health - self.max_health) * frametime; - - cpicon_changeteam(); - cpicon_construct(); + this.origin_x = ReadCoord(); + this.origin_y = ReadCoord(); + this.origin_z = ReadCoord(); + setorigin(this, this.origin); + + this.health = ReadByte(); + this.max_health = ReadByte(); + this.count = ReadByte(); + this.team = ReadByte(); + this.iscaptured = ReadByte(); + + if(!this.count) + this.count = (this.health - this.max_health) * frametime; + + cpicon_changeteam(this); + cpicon_construct(this); } if(sf & CPSF_STATUS) { int _tmp = ReadByte(); - if(_tmp != self.team) + if(_tmp != this.team) { - self.team = _tmp; - cpicon_changeteam(); + this.team = _tmp; + cpicon_changeteam(this); } _tmp = ReadByte(); - if(_tmp != self.health) - cpicon_damage(_tmp); + if(_tmp != this.health) + cpicon_damage(this, _tmp); - self.health = _tmp; + this.health = _tmp; } } diff --git a/qcsrc/client/controlpoint.qh b/qcsrc/client/controlpoint.qh index a2ce39591..31485519d 100644 --- a/qcsrc/client/controlpoint.qh +++ b/qcsrc/client/controlpoint.qh @@ -7,6 +7,6 @@ const vector CPICON_MAX = '32 32 25'; const int CPSF_STATUS = 4; const int CPSF_SETUP = 8; -void ent_cpicon(); +void ent_cpicon(entity this); #endif diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index 488289f15..d795e6369 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -515,7 +515,7 @@ void CSQCModel_Effects_PostUpdate(void) self.effects = 0; self.modelflags = 0; if(self.csqcmodel_teleported) - Projectile_ResetTrail(self.origin); + Projectile_ResetTrail(self, self.origin); } .int snd_looping; void CSQCModel_Effects_Apply(void) @@ -584,9 +584,9 @@ void CSQCModel_Effects_Apply(void) self.traileffect = tref; if(self.drawmask) - Projectile_DrawTrail(self.origin); + Projectile_DrawTrail(self, self.origin); else - Projectile_ResetTrail(self.origin); + Projectile_ResetTrail(self, self.origin); if(self.csqcmodel_effects & CSQCMODEL_EF_RESPAWNGHOST) self.renderflags |= RF_ADDITIVE; diff --git a/qcsrc/client/generator.qc b/qcsrc/client/generator.qc index 148a8f521..eed682785 100644 --- a/qcsrc/client/generator.qc +++ b/qcsrc/client/generator.qc @@ -3,8 +3,8 @@ .int count; .float max_health; -void ons_generator_ray_draw() -{SELFPARAM(); +void ons_generator_ray_draw(entity this) +{ if(time < self.move_time) return; @@ -42,8 +42,8 @@ void ons_generator_ray_spawn(vector org) e.draw = ons_generator_ray_draw; } -void generator_draw() -{SELFPARAM(); +void generator_draw(entity this) +{ if(time < self.move_time) return; diff --git a/qcsrc/client/gibs.qc b/qcsrc/client/gibs.qc index 5c4c338f1..360f7b5c3 100644 --- a/qcsrc/client/gibs.qc +++ b/qcsrc/client/gibs.qc @@ -91,8 +91,8 @@ void Gib_Touch() Gib_Delete(); } -void Gib_Draw() -{SELFPARAM(); +void Gib_Draw(entity this) +{ vector oldorg; oldorg = self.origin; diff --git a/qcsrc/client/gibs.qh b/qcsrc/client/gibs.qh index 5b8b16bfd..f4b60948a 100644 --- a/qcsrc/client/gibs.qh +++ b/qcsrc/client/gibs.qh @@ -17,7 +17,7 @@ void SUB_RemoveOnNoImpact(); void Gib_Touch(); -void Gib_Draw(); +void Gib_Draw(entity this); void TossGib (string mdlname, vector safeorg, vector org, vector vconst, vector vrand, int specnum, bool destroyontouch, bool issilent); diff --git a/qcsrc/client/hook.qc b/qcsrc/client/hook.qc index dd70c760c..07123f06b 100644 --- a/qcsrc/client/hook.qc +++ b/qcsrc/client/hook.qc @@ -31,8 +31,8 @@ void Draw_GrapplingHook_trace_callback(vector start, vector hit, vector end) } class(Hook) .float teleport_time; -void Draw_GrapplingHook() -{SELFPARAM(); +void Draw_GrapplingHook(entity this) +{ vector a, b, atrans; string tex; vector rgb; diff --git a/qcsrc/client/laser.qc b/qcsrc/client/laser.qc index d023ea9b5..93c4103a9 100644 --- a/qcsrc/client/laser.qc +++ b/qcsrc/client/laser.qc @@ -21,7 +21,7 @@ class(Laser) .float alpha; class(Laser) .float scale; // scaling factor of the thickness class(Laser) .float modelscale; // scaling factor of the dlight -void Draw_Laser() +void Draw_Laser(entity this) { if(!self.state) return; diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index d494050f0..bc3fb43d6 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -81,6 +81,8 @@ void menu_sub_null() { } +void draw_null(entity this) { } + string forcefog; void ConsoleCommand_macro_init(); void CSQC_Init(void) @@ -686,9 +688,9 @@ void Ent_ReadAccuracy(void) } } -void Spawn_Draw(void) -{SELFPARAM(); - pointparticles(self.cnt, self.origin + '0 0 28', '0 0 2', bound(0, frametime, 0.1)); +void Spawn_Draw(entity this) +{ + pointparticles(this.cnt, this.origin + '0 0 28', '0 0 2', bound(0, frametime, 0.1)); } void Ent_ReadSpawnPoint(float is_new) // entity for spawnpoint @@ -880,7 +882,7 @@ void CSQC_Ent_Update(float bIsNewEntity) case ENT_CLIENT_AUXILIARYXHAIR: Net_AuXair2(bIsNewEntity); break; case ENT_CLIENT_TURRET: ent_turret(); break; case ENT_CLIENT_GENERATOR: ent_generator(); break; - case ENT_CLIENT_CONTROLPOINT_ICON: ent_cpicon(); break; + case ENT_CLIENT_CONTROLPOINT_ICON: ent_cpicon(this); break; case ENT_CLIENT_MODEL: CSQCModel_Read(bIsNewEntity); break; case ENT_CLIENT_ITEM: ItemRead(bIsNewEntity); break; case ENT_CLIENT_BUMBLE_RAYGUN: bumble_raygun_read(bIsNewEntity); break; @@ -933,7 +935,7 @@ void Ent_Remove() self.enttype = 0; self.classname = ""; - self.draw = menu_sub_null; + self.draw = draw_null; self.entremove = menu_sub_null; // TODO possibly set more stuff to defaults } diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index c8de3afdc..d403984d3 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -91,8 +91,8 @@ entity teamslots[17]; // 17 teams (including "spectator team") .float ready; .float eliminated; -.void(void) draw; -.void(void) draw2d; +.void(entity) draw; +.void(entity) draw2d; .void(void) entremove; float drawframetime; vector view_origin, view_forward, view_right, view_up; diff --git a/qcsrc/client/modeleffects.qc b/qcsrc/client/modeleffects.qc index fa7044fc2..a10062a9f 100644 --- a/qcsrc/client/modeleffects.qc +++ b/qcsrc/client/modeleffects.qc @@ -5,8 +5,8 @@ .float scale; .float alpha; -void ModelEffect_Draw() -{SELFPARAM(); +void ModelEffect_Draw(entity this) +{ self.angles = self.angles + frametime * self.avelocity; setorigin(self, self.origin + frametime * self.velocity); self.scale = self.scale1 + (self.scale2 - self.scale1) * (time - self.teleport_time) / (self.lifetime + self.fadetime - self.teleport_time); diff --git a/qcsrc/client/modeleffects.qh b/qcsrc/client/modeleffects.qh index 22998f09d..d4b98e0a5 100644 --- a/qcsrc/client/modeleffects.qh +++ b/qcsrc/client/modeleffects.qh @@ -7,7 +7,7 @@ class(ModelEffect) .float lifetime, fadetime; class(ModelEffect) .float teleport_time; class(ModelEffect) .float scale1, scale2; -void ModelEffect_Draw(); +void ModelEffect_Draw(entity this); void Ent_ModelEffect(bool isNew); #endif diff --git a/qcsrc/client/particles.qh b/qcsrc/client/particles.qh index 791313f50..06cd72523 100644 --- a/qcsrc/client/particles.qh +++ b/qcsrc/client/particles.qh @@ -14,7 +14,7 @@ class(PointParticles) .float volume; class(PointParticles) .float absolute; // 1 = count per second is absolute, 2 = only spawn at toggle class(PointParticles) .vector movedir; // trace direction -void Draw_PointParticles(); +void Draw_PointParticles(entity this); void Ent_PointParticles_Remove(); diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 9c20747fb..381ead786 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -27,7 +27,7 @@ entity porto; vector polyline[16]; -void Porto_Draw() +void Porto_Draw(entity this) { vector p, dir, ang, q, nextdir; float portal_number, portal1_idx; @@ -1468,7 +1468,7 @@ void CSQC_UpdateView(float w, float h) */ for(entity e = NULL; (e = nextent(e)); ) if (e.draw) { - WITH(entity, self, e, e.draw()); + WITH(entity, self, e, e.draw(e)); } addentities(MASK_NORMAL | MASK_ENGINE | MASK_ENGINEVIEWMODELS); @@ -1806,7 +1806,7 @@ void CSQC_UpdateView(float w, float h) // draw 2D entities for (entity e = NULL; (e = nextent(e)); ) if (e.draw2d) { - WITH(entity, self, e, e.draw2d()); + WITH(entity, self, e, e.draw2d(e)); } Draw_ShowNames_All(); diff --git a/qcsrc/client/wall.qc b/qcsrc/client/wall.qc index 7d79f7756..f17b54a5c 100644 --- a/qcsrc/client/wall.qc +++ b/qcsrc/client/wall.qc @@ -51,8 +51,8 @@ void Ent_Wall_PreDraw() self.drawmask = MASK_NORMAL; } -void Ent_Wall_Draw() -{SELFPARAM(); +void Ent_Wall_Draw(entity this) +{ float f; var .vector fld; diff --git a/qcsrc/client/wall.qh b/qcsrc/client/wall.qh index 04c0dce24..f44355fc2 100644 --- a/qcsrc/client/wall.qh +++ b/qcsrc/client/wall.qh @@ -16,7 +16,7 @@ class(Wall) .vector saved; .float fade_start, fade_end, fade_vertical_offset; .float default_solid; -void Ent_Wall_Draw(); +void Ent_Wall_Draw(entity this); void Ent_Wall_Remove(); diff --git a/qcsrc/client/weapons/projectile.qc b/qcsrc/client/weapons/projectile.qc index 9d23e3cab..22443043d 100644 --- a/qcsrc/client/weapons/projectile.qc +++ b/qcsrc/client/weapons/projectile.qc @@ -23,36 +23,33 @@ void SUB_Stop() self.move_movetype = MOVETYPE_NONE; } -void Projectile_ResetTrail(vector to) -{SELFPARAM(); - self.trail_oldorigin = to; - self.trail_oldtime = time; +void Projectile_ResetTrail(entity this, vector to) +{ + this.trail_oldorigin = to; + this.trail_oldtime = time; } -void Projectile_DrawTrail(vector to) -{SELFPARAM(); - vector from; - float t0; - - from = self.trail_oldorigin; - t0 = self.trail_oldtime; - self.trail_oldorigin = to; - self.trail_oldtime = time; +void Projectile_DrawTrail(entity this, vector to) +{ + vector from = this.trail_oldorigin; + // float t0 = this.trail_oldtime; + this.trail_oldorigin = to; + this.trail_oldtime = time; // force the effect even for stationary firemine - if(self.cnt == PROJECTILE_FIREMINE) + if(this.cnt == PROJECTILE_FIREMINE) if(from == to) from.z += 1; - if (self.traileffect) + if (this.traileffect) { - particles_alphamin = particles_alphamax = particles_fade = sqrt(self.alpha); - boxparticles(particleeffectnum(Effects[self.traileffect]), self, from, to, self.velocity, self.velocity, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE | PARTICLES_DRAWASTRAIL); + particles_alphamin = particles_alphamax = particles_fade = sqrt(this.alpha); + boxparticles(particleeffectnum(Effects[this.traileffect]), this, from, to, this.velocity, this.velocity, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE | PARTICLES_DRAWASTRAIL); } } -void Projectile_Draw() -{SELFPARAM(); +void Projectile_Draw(entity this) +{ vector rot; vector trailorigin; int f; @@ -146,9 +143,9 @@ void Projectile_Draw() trailorigin += v_up * 4; if(drawn) - Projectile_DrawTrail(trailorigin); + Projectile_DrawTrail(self, trailorigin); else - Projectile_ResetTrail(trailorigin); + Projectile_ResetTrail(self, trailorigin); self.drawmask = 0; @@ -179,7 +176,7 @@ void Ent_RemoveProjectile() if(self.count & 0x80) { tracebox(self.origin, self.mins, self.maxs, self.origin + self.velocity * 0.05, MOVE_NORMAL, self); - Projectile_DrawTrail(trace_endpos); + Projectile_DrawTrail(self, trace_endpos); } } diff --git a/qcsrc/client/weapons/projectile.qh b/qcsrc/client/weapons/projectile.qh index 67e08c224..dd289817e 100644 --- a/qcsrc/client/weapons/projectile.qh +++ b/qcsrc/client/weapons/projectile.qh @@ -19,11 +19,11 @@ class(Projectile) .bool silent; void SUB_Stop(); -void Projectile_ResetTrail(vector to); +void Projectile_ResetTrail(entity this, vector to); -void Projectile_DrawTrail(vector to); +void Projectile_DrawTrail(entity this, vector to); -void Projectile_Draw(); +void Projectile_Draw(entity this); void loopsound(entity e, int ch, string samp, float vol, float attn); diff --git a/qcsrc/common/mutators/mutator/casings.qc b/qcsrc/common/mutators/mutator/casings.qc index d60854e2d..9ed5fefa7 100644 --- a/qcsrc/common/mutators/mutator/casings.qc +++ b/qcsrc/common/mutators/mutator/casings.qc @@ -40,8 +40,8 @@ void Casing_Delete() remove(self); } -void Casing_Draw() -{SELFPARAM(); +void Casing_Draw(entity this) +{ if (self.move_flags & FL_ONGROUND) { self.move_angles_x = 0; diff --git a/qcsrc/common/mutators/mutator/damagetext.qc b/qcsrc/common/mutators/mutator/damagetext.qc index 8d21f1705..e4e4be5e8 100644 --- a/qcsrc/common/mutators/mutator/damagetext.qc +++ b/qcsrc/common/mutators/mutator/damagetext.qc @@ -24,8 +24,7 @@ CLASS(DamageText, Object) ATTRIB(DamageText, m_armordamage, int, 0) ATTRIB(DamageText, time_prev, float, time) - void DamageText_draw() { - SELFPARAM(); + void DamageText_draw2d(DamageText this) { float dt = time - this.time_prev; this.time_prev = time; setorigin(this, this.origin + dt * this.velocity); @@ -38,7 +37,7 @@ CLASS(DamageText, Object) drawcolorcodedstring2(pos, s, this.m_size * '1 1 0', this.m_color, this.alpha, DRAWFLAG_NORMAL); } } - ATTRIB(DamageText, draw2d, void(), DamageText_draw) + ATTRIB(DamageText, draw2d, void(DamageText), DamageText_draw2d) void DamageText_update(DamageText this, vector _origin, int _health, int _armor) { this.m_damage = _health; diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index 89f9a0f0f..9adf1a95b 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -455,8 +455,8 @@ vector fixrgbexcess(vector rgb) return rgb; } -void Draw_WaypointSprite() -{SELFPARAM(); +void Draw_WaypointSprite(entity this) +{ if (self.lifetime) self.alpha = pow(bound(0, (self.fadetime - time) / self.lifetime, 1), waypointsprite_timealphaexponent); else diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh index e4ed397c2..2be4ff8fd 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh @@ -114,7 +114,7 @@ void WaypointSprite_Load_Frames(string ext); void WaypointSprite_Load(); .float alpha; -void Draw_WaypointSprite(); +void Draw_WaypointSprite(entity this); #endif #ifdef SVQC diff --git a/qcsrc/common/nades/all.qc b/qcsrc/common/nades/all.qc index 3a4f632a3..90d7ca3ce 100644 --- a/qcsrc/common/nades/all.qc +++ b/qcsrc/common/nades/all.qc @@ -17,8 +17,8 @@ #ifdef CSQC .float ltime; -void healer_draw() -{SELFPARAM(); +void healer_draw(entity this) +{ float dt = time - self.move_time; self.move_time = time; if(dt <= 0) diff --git a/qcsrc/common/triggers/func/conveyor.qc b/qcsrc/common/triggers/func/conveyor.qc index 587dec8d0..b8c1310d8 100644 --- a/qcsrc/common/triggers/func/conveyor.qc +++ b/qcsrc/common/triggers/func/conveyor.qc @@ -146,9 +146,11 @@ spawnfunc(func_conveyor) #elif defined(CSQC) +void conveyor_draw(entity this) { WITH(entity, self, this, conveyor_think()); } + void conveyor_init() {SELFPARAM(); - self.draw = conveyor_think; + self.draw = conveyor_draw; self.drawmask = MASK_NORMAL; self.movetype = MOVETYPE_NONE; diff --git a/qcsrc/common/triggers/func/door.qc b/qcsrc/common/triggers/func/door.qc index fed8e9fa4..c55754bdb 100644 --- a/qcsrc/common/triggers/func/door.qc +++ b/qcsrc/common/triggers/func/door.qc @@ -795,11 +795,11 @@ spawnfunc(func_door) #elif defined(CSQC) -void door_draw() +void door_draw(entity this) { Movetype_Physics_NoMatchServer(); - trigger_draw_generic(); + trigger_draw_generic(this); } void ent_door() diff --git a/qcsrc/common/triggers/func/plat.qc b/qcsrc/common/triggers/func/plat.qc index de4c53cb5..fc62341a8 100644 --- a/qcsrc/common/triggers/func/plat.qc +++ b/qcsrc/common/triggers/func/plat.qc @@ -127,7 +127,7 @@ spawnfunc(func_plat) InitializeEntity(self, plat_delayedinit, INITPRIO_FINDTARGET); } #elif defined(CSQC) -void plat_draw() +void plat_draw(entity this) { Movetype_Physics_NoMatchServer(); //Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy); diff --git a/qcsrc/common/triggers/func/pointparticles.qc b/qcsrc/common/triggers/func/pointparticles.qc index c9e8ba96c..a4f31b2fd 100644 --- a/qcsrc/common/triggers/func/pointparticles.qc +++ b/qcsrc/common/triggers/func/pointparticles.qc @@ -183,8 +183,8 @@ spawnfunc(func_sparks) } #elif defined(CSQC) -void Draw_PointParticles() -{SELFPARAM(); +void Draw_PointParticles(entity this) +{ float n, i, fail; vector p; vector sz; diff --git a/qcsrc/common/triggers/func/rainsnow.qc b/qcsrc/common/triggers/func/rainsnow.qc index 05f555a24..18c2c0a0f 100644 --- a/qcsrc/common/triggers/func/rainsnow.qc +++ b/qcsrc/common/triggers/func/rainsnow.qc @@ -90,13 +90,13 @@ spawnfunc(func_snow) Net_LinkEntity(self, false, 0, rainsnow_SendEntity); } #elif defined(CSQC) -void Draw_Rain() -{SELFPARAM(); +void Draw_Rain(entity this) +{ te_particlerain(self.origin + self.mins, self.origin + self.maxs, self.velocity, floor(self.count * drawframetime + random()), self.glow_color); } -void Draw_Snow() -{SELFPARAM(); +void Draw_Snow(entity this) +{ te_particlesnow(self.origin + self.mins, self.origin + self.maxs, self.velocity, floor(self.count * drawframetime + random()), self.glow_color); } diff --git a/qcsrc/common/triggers/func/train.qc b/qcsrc/common/triggers/func/train.qc index 4284d2403..a75ac4192 100644 --- a/qcsrc/common/triggers/func/train.qc +++ b/qcsrc/common/triggers/func/train.qc @@ -225,7 +225,7 @@ spawnfunc(func_train) // TODO make a reset function for this one } #elif defined(CSQC) -void train_draw() +void train_draw(entity this) { //Movetype_Physics_NoMatchServer(); Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy); diff --git a/qcsrc/common/triggers/misc/laser.qc b/qcsrc/common/triggers/misc/laser.qc index f0babbc55..3b9996db6 100644 --- a/qcsrc/common/triggers/misc/laser.qc +++ b/qcsrc/common/triggers/misc/laser.qc @@ -272,8 +272,8 @@ class(Laser) .float alpha; class(Laser) .float scale; // scaling factor of the thickness class(Laser) .float modelscale; // scaling factor of the dlight -void Draw_Laser() -{SELFPARAM(); +void Draw_Laser(entity this) +{ if(!self.state) return; InterpolateOrigin_Do(); diff --git a/qcsrc/common/triggers/triggers.qc b/qcsrc/common/triggers/triggers.qc index 73c5c4965..b97d2b1d9 100644 --- a/qcsrc/common/triggers/triggers.qc +++ b/qcsrc/common/triggers/triggers.qc @@ -265,8 +265,8 @@ void trigger_touch_generic(void() touchfunc) } } } -void trigger_draw_generic() -{SELFPARAM(); +void trigger_draw_generic(entity this) +{ float dt = time - self.move_time; self.move_time = time; if(dt <= 0) { return; } diff --git a/qcsrc/common/turrets/cl_turrets.qc b/qcsrc/common/turrets/cl_turrets.qc index 03cb16b88..e62a4cc35 100644 --- a/qcsrc/common/turrets/cl_turrets.qc +++ b/qcsrc/common/turrets/cl_turrets.qc @@ -24,8 +24,8 @@ void turret_head_draw() self.drawmask = MASK_NORMAL; } -void turret_draw() -{SELFPARAM(); +void turret_draw(entity this) +{ float dt; dt = time - self.move_time; @@ -53,8 +53,8 @@ void turret_draw() } -void turret_draw2d() -{SELFPARAM(); +void turret_draw2d(entity this) +{ if(self.netname == "") return; @@ -246,8 +246,8 @@ void turret_construct() entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, float _explode); void turret_gibboom(); -void turret_gib_draw() -{SELFPARAM(); +void turret_gib_draw(entity this) +{ Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy); self.drawmask = MASK_NORMAL; diff --git a/qcsrc/common/turrets/turret/ewheel.qc b/qcsrc/common/turrets/turret/ewheel.qc index cdb9a605c..3875f1bdf 100644 --- a/qcsrc/common/turrets/turret/ewheel.qc +++ b/qcsrc/common/turrets/turret/ewheel.qc @@ -237,8 +237,8 @@ spawnfunc(turret_ewheel) { if(!turret_initialize(TUR_EWHEEL)) remove(self); } #endif // SVQC #ifdef CSQC -void ewheel_draw() -{SELFPARAM(); +void ewheel_draw(entity this) +{ float dt; dt = time - self.move_time; diff --git a/qcsrc/common/turrets/turret/walker.qc b/qcsrc/common/turrets/turret/walker.qc index 1feace46a..e629ada79 100644 --- a/qcsrc/common/turrets/turret/walker.qc +++ b/qcsrc/common/turrets/turret/walker.qc @@ -633,8 +633,8 @@ spawnfunc(turret_walker) { if(!turret_initialize(TUR_WALKER)) remove(self); } #include "../../../client/movelib.qh" -void walker_draw() -{SELFPARAM(); +void walker_draw(entity this) +{ float dt; dt = time - self.move_time; diff --git a/qcsrc/common/vehicles/cl_vehicles.qc b/qcsrc/common/vehicles/cl_vehicles.qc index 338b015d6..3472a7f1c 100644 --- a/qcsrc/common/vehicles/cl_vehicles.qc +++ b/qcsrc/common/vehicles/cl_vehicles.qc @@ -26,8 +26,8 @@ void vehicle_alarm(entity e, int ch, string s0und) _sound(e, ch, s0und, VOL_BASEVOICE, ATTEN_NONE); } -void AuxiliaryXhair_Draw2D() -{SELFPARAM(); +void AuxiliaryXhair_Draw2D(entity this) +{ if (scoreboard_showscores) return; diff --git a/qcsrc/common/vehicles/cl_vehicles.qh b/qcsrc/common/vehicles/cl_vehicles.qh index a495f0367..bf96d95ea 100644 --- a/qcsrc/common/vehicles/cl_vehicles.qh +++ b/qcsrc/common/vehicles/cl_vehicles.qh @@ -5,7 +5,7 @@ void Net_AuXair2(float bIsNew); void Net_VehicleSetup(); -void RaptorCBShellfragDraw(); +void RaptorCBShellfragDraw(entity this); void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang); #define weapon2mode getstati(STAT_VEHICLESTAT_W2MODE) diff --git a/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc b/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc index 0966ddf64..79252e13c 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc @@ -61,7 +61,7 @@ bool bumble_raygun_send(entity this, entity to, float sf) #ifdef CSQC -void bumble_raygun_draw(); +void bumble_raygun_draw(entity this); void bumble_raygun_read(bool bIsNew) {SELFPARAM(); @@ -101,8 +101,8 @@ void bumble_raygun_read(bool bIsNew) } } -void bumble_raygun_draw() -{SELFPARAM(); +void bumble_raygun_draw(entity this) +{ float _len; vector _dir; vector _vtmp1, _vtmp2; diff --git a/qcsrc/common/vehicles/vehicle/raptor_weapons.qc b/qcsrc/common/vehicles/vehicle/raptor_weapons.qc index ebc73787c..9c2fd0e5f 100644 --- a/qcsrc/common/vehicles/vehicle/raptor_weapons.qc +++ b/qcsrc/common/vehicles/vehicle/raptor_weapons.qc @@ -263,8 +263,8 @@ void raptor_flare_think() #ifdef CSQC -void RaptorCBShellfragDraw() -{SELFPARAM(); +void RaptorCBShellfragDraw(entity this) +{ if(wasfreed(self)) return; diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index d9ad712ea..99eb17d03 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -850,8 +850,8 @@ void Reset_ArcBeam(void) } } -void Draw_ArcBeam(void) -{SELFPARAM(); +void Draw_ArcBeam(entity this) +{ float dt = time - self.move_time; self.move_time = time; if(dt <= 0) { return; } diff --git a/qcsrc/common/weapons/weapon/shockwave.qc b/qcsrc/common/weapons/weapon/shockwave.qc index 30ffaca32..4965ba6f2 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qc +++ b/qcsrc/common/weapons/weapon/shockwave.qc @@ -735,8 +735,8 @@ void W_Shockwave_Attack(void) const float SW_MAXALPHA = 0.5; const float SW_FADETIME = 0.4; const float SW_DISTTOMIN = 200; -void Draw_Shockwave() -{SELFPARAM(); +void Draw_Shockwave(entity this) +{ // fading/removal control float a = bound(0, (SW_MAXALPHA - ((time - self.sw_time) / SW_FADETIME)), SW_MAXALPHA); if(a < ALPHA_MIN_VISIBLE) { remove(self); } diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 603522d4a..e93ee2d7e 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -28,8 +28,8 @@ #endif #ifdef CSQC -void ItemDraw() -{SELFPARAM(); +void ItemDraw(entity self) +{ if(self.gravity) { Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy); @@ -64,8 +64,8 @@ void ItemDraw() } } -void ItemDrawSimple() -{SELFPARAM(); +void ItemDrawSimple(entity this) +{ if(self.gravity) { Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy); diff --git a/qcsrc/server/t_items.qh b/qcsrc/server/t_items.qh index 991e2d665..dd79b1788 100644 --- a/qcsrc/server/t_items.qh +++ b/qcsrc/server/t_items.qh @@ -78,9 +78,9 @@ string autocvar_cl_simpleitems_postfix = "_simple"; .float spawntime; .float gravity; .vector colormod; -void ItemDraw(); -void ItemDrawSimple(); +void ItemDraw(entity this); +void ItemDrawSimple(entity this); void ItemRead(float _IsNew); -- 2.39.2