]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Draw: purge SELFPARAM
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 7 Oct 2015 02:51:02 +0000 (13:51 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 7 Oct 2015 02:51:02 +0000 (13:51 +1100)
44 files changed:
qcsrc/client/announcer.qc
qcsrc/client/command/cl_cmd.qc
qcsrc/client/controlpoint.qc
qcsrc/client/controlpoint.qh
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/generator.qc
qcsrc/client/gibs.qc
qcsrc/client/gibs.qh
qcsrc/client/hook.qc
qcsrc/client/laser.qc
qcsrc/client/main.qc
qcsrc/client/main.qh
qcsrc/client/modeleffects.qc
qcsrc/client/modeleffects.qh
qcsrc/client/particles.qh
qcsrc/client/view.qc
qcsrc/client/wall.qc
qcsrc/client/wall.qh
qcsrc/client/weapons/projectile.qc
qcsrc/client/weapons/projectile.qh
qcsrc/common/mutators/mutator/casings.qc
qcsrc/common/mutators/mutator/damagetext.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh
qcsrc/common/nades/all.qc
qcsrc/common/triggers/func/conveyor.qc
qcsrc/common/triggers/func/door.qc
qcsrc/common/triggers/func/plat.qc
qcsrc/common/triggers/func/pointparticles.qc
qcsrc/common/triggers/func/rainsnow.qc
qcsrc/common/triggers/func/train.qc
qcsrc/common/triggers/misc/laser.qc
qcsrc/common/triggers/triggers.qc
qcsrc/common/turrets/cl_turrets.qc
qcsrc/common/turrets/turret/ewheel.qc
qcsrc/common/turrets/turret/walker.qc
qcsrc/common/vehicles/cl_vehicles.qc
qcsrc/common/vehicles/cl_vehicles.qh
qcsrc/common/vehicles/vehicle/bumblebee_weapons.qc
qcsrc/common/vehicles/vehicle/raptor_weapons.qc
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/server/t_items.qc
qcsrc/server/t_items.qh

index 8f477171cec19286cf96efafc40b5517f97fdfe4..b7b7bb5c6e5d992c2a8c20ea1e9f8c8bce7332f2 100644 (file)
@@ -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));
        }
 }
 
index 72fa244835207c21677501e4b2ec3d010f3757b2..88cd246ff106fe5246ad3de4b721ced2e1fd80bf 100644 (file)
@@ -20,8 +20,8 @@
 
 #include "../../common/command/generic.qh"
 
-void DrawDebugModel()
-{SELFPARAM();
+void DrawDebugModel(entity this)
+{
        if(time - floor(time) > 0.5)
        {
                PolyDrawModel(self);
index a83260b1049c7dfcabcb04926e9b6c817fe1dd23..34301d8063dc50501381721eaf01040ad7ebc51a 100644 (file)
 
 .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;
        }
 }
index a2ce395917ae7561f4482c36bac921250780b1f8..31485519d4eefee415115cd3098d03fc80d821cd 100644 (file)
@@ -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
index 488289f15e60d88da20f79688b51d27f0dbe354a..d795e63699fefc11158c1a4f4529548e89adbb63 100644 (file)
@@ -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;
index 148a8f521b0ab3a2991c9f95aa388368ca69c0f6..eed682785e0ec2ee8877f4aa71546c6843c20be4 100644 (file)
@@ -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;
 
index 5c4c338f155c5e91ad7272c5556de0c80f10c486..360f7b5c361bdb6b99435575f8dfb5553e6de855 100644 (file)
@@ -91,8 +91,8 @@ void Gib_Touch()
        Gib_Delete();
 }
 
-void Gib_Draw()
-{SELFPARAM();
+void Gib_Draw(entity this)
+{
        vector oldorg;
        oldorg = self.origin;
 
index 5b8b16bfd8c11cbac3caba4fd709716dfd8b07a6..f4b60948af7cf0a103c19da8645e18317e7178cf 100644 (file)
@@ -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);
 
index dd70c760c34534a1456165647e1fcc019b10754a..07123f06b5ec278b9bb1d609a7e9e8d195032836 100644 (file)
@@ -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;
index d023ea9b59957e72f52ee8114f1c91fcb1ee43b3..93c4103a9cd993ae2fdc7c45e050bd7e887ce2c3 100644 (file)
@@ -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;
index d494050f060b025bb8fc6838ba16a0bf3d98096a..bc3fb43d6820af3bee49ddf3aa1b9c2e029b3874 100644 (file)
@@ -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
 }
index c8de3afdc93522a7542ce65b66e9558921688522..d403984d38a08bcac4073496dee4e320310ac14e 100644 (file)
@@ -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;
index fa7044fc29e4a7db03026565310335b71e5bee81..a10062a9f758c21c795824c464b9d2097102eab9 100644 (file)
@@ -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);
index 22998f09d689d14c2951969493479c3811ccbbb6..d4b98e0a5928c6a87f802bfc07aaa534a97f00cb 100644 (file)
@@ -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
index 791313f50408de88ed712a9bd60d90b2a3c3cd3e..06cd72523dafe02c7da53b33db59e35837fc2b6c 100644 (file)
@@ -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();
 
index 9c20747fbac1bd8c6d50de065ba6343fc57b9397..381ead7869362d94bc98025544a1af291efccaab 100644 (file)
@@ -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();
 
index 7d79f7756500dad7b06478bd6104b64ee816a51c..f17b54a5caa7bf0f877593c1cd1a811d148fcb46 100644 (file)
@@ -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;
 
index 04c0dce24f84326303bf3e57638da5e8329f2f67..f44355fc284092de6498b94cbccc2eef03e5deb9 100644 (file)
@@ -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();
 
index 9d23e3cabdad77231eb403587b7335ba55e509d3..22443043d2ae4b699e0360a466c8c7518dd8c6a8 100644 (file)
@@ -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);
        }
 }
 
index 67e08c224bfd6f2a5f35dd8f3354c36e7d79be07..dd289817ec15b034e01d1a3b89ec13cc51227dac 100644 (file)
@@ -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);
 
index d60854e2dedfe7776f263026500c7fb5b57a3500..9ed5fefa7ac5b85b6eaeea351324e44acc7648a2 100644 (file)
@@ -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;
index 8d21f17057a1da4baf5770f618d73f720fb0bccb..e4e4be5e8792eaafacd152d1db9546c99c4b0115 100644 (file)
@@ -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;
index 89f9a0f0f1d4282220c2fc678952b8b49a255450..9adf1a95bac36b74e3a5dbd046ae630b820c77db 100644 (file)
@@ -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
index e4ed397c278de25b29f6fd739764a281e66ce0ec..2be4ff8fddbda031d3f1649aba1365caa7d5e561 100644 (file)
@@ -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
index 3a4f632a3f54ec894625e41ee0438dd1d5463bb8..90d7ca3ced875e35cc5ba0c1279bd1c4e46f593f 100644 (file)
@@ -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)
index 587dec8d015dff6d6d7d0cbb730a719569cfb9d1..b8c1310d8ca70dc148977d113d3eb4983d8d814d 100644 (file)
@@ -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;
index fed8e9fa424515b9c3aa8aa5aa3f5029e07b3529..c55754bdbe30f2fe03b47e76cbf0a60c3fb73769 100644 (file)
@@ -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()
index de4c53cb53f69b6a0b265204bec44c5f79c8fec7..fc62341a85a3a09b65b158d09d6e4d2fce92cf40 100644 (file)
@@ -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);
index c9e8ba96cb758fa7e62a8d7e9dfcf30d3bfc9b65..a4f31b2fd81c0e2b25e4597b0234b3c327a1329c 100644 (file)
@@ -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;
index 05f555a24f7da99b1637b65cd96314ab49bcaec3..18c2c0a0fb91c9cb9adecb5fc5bb5a253530e93b 100644 (file)
@@ -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);
 }
 
index 4284d24031e6d609f16428e146707ce1d5366747..a75ac4192ee1b7bd6a7afe274fd0612b82bcc8bd 100644 (file)
@@ -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);
index f0babbc557a9f47cf0a0772fe0ce8ebb40cb212f..3b9996db6daea61a447dfa6005827d9f2cb1ff00 100644 (file)
@@ -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();
index 73c5c49651259aaa9376945cc6e1c080df0bb91b..b97d2b1d9d94c6e8239482da45ae5a3360f11501 100644 (file)
@@ -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; }
index 03cb16b886b8ee7573c806ac96a26f41e8ddb8be..e62a4cc3579c4ff4d6e3db3c373a08815b800a97 100644 (file)
@@ -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;
index cdb9a605c2c37d46c328a79f22bc9166a22b1a63..3875f1bdfc63cb0b7c9db95080feee32e45c3191 100644 (file)
@@ -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;
index 1feace46ae2e5e404702283e72ff4b263932cb1e..e629ada79853f2a31a96aa27ee334d9f84fa6de0 100644 (file)
@@ -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;
index 338b015d6797adfa8e899b54b9ad972ea1edef05..3472a7f1c7e7e76747e0b056ef22c31d12c589ca 100644 (file)
@@ -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;
 
index a495f036705874843ea21d755ba2daded058ef8c..bf96d95ea367bbad6641f4343ba75a86a9ff04ab 100644 (file)
@@ -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)
index 0966ddf648d1577865355a93bccf3e98b949ed4c..79252e13cbb2401c5557d405625e16f8bf2c2381 100644 (file)
@@ -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;
index ebc73787ce1b8df2d100b8addfe261b9abaa290c..9c2fd0e5f15a0e4c4212edc71aca6e34ff3c82e1 100644 (file)
@@ -263,8 +263,8 @@ void raptor_flare_think()
 
 #ifdef CSQC
 
-void RaptorCBShellfragDraw()
-{SELFPARAM();
+void RaptorCBShellfragDraw(entity this)
+{
     if(wasfreed(self))
         return;
 
index d9ad712ea1a8cbedfa90abc4ab1e2ef260d1b26e..99eb17d031b89453a0d2da13ec56fd7fedb83702 100644 (file)
@@ -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; }
index 30ffaca327ee2b40449964b0cdd0355cb1382a55..4965ba6f2010f357df50f8b375e12b57af1e5aa8 100644 (file)
@@ -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); }
index 603522d4ac8004076f84f17901db887eca31474b..e93ee2d7e1fe181b842df30668d93556b22d72fe 100644 (file)
@@ -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);
index 991e2d665a8693c1f24734bc2f9d611f3be13077..dd79b1788f2b14fbf451b5b4ee01f16d1f2ea3c6 100644 (file)
@@ -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);