void viewmodel_draw(entity this)
{
int mask = (intermission || (getstati(STAT_HEALTH) <= 0) || autocvar_chase_active) ? 0 : MASK_NORMAL;
+ float a = this.alpha;
int c = stof(getplayerkeyvalue(current_player, "colors"));
- vector g = colormapPaletteColor(c & 0x0F, true) * 2;
+ vector g = this.glowmod; // TODO: completely clientside: colormapPaletteColor(c & 0x0F, true) * 2;
entity me = CSQCModel_server2csqc(player_localentnum);
int fx = ((me.csqcmodel_effects & EFMASK_CHEAP)
| EF_NODEPTHTEST)
for (entity e = this; e; e = e.weaponchild)
{
e.drawmask = mask;
+ e.alpha = a;
e.colormap = c;
e.glowmod = g;
e.csqcmodel_effects = fx;
bool restartanim = ReadByte();
setanim(viewmodel, a, restartanim == false, restartanim, restartanim);
viewmodel.state = ReadByte();
+ viewmodel.alpha = ReadByte() / 255;
}
#endif
WriteCoord(channel, a.z);
WriteByte(channel, restartanim);
WriteByte(channel, actor.(weaponentity).state);
+ WriteByte(channel, actor.(weaponentity).alpha * 255);
+}
+#endif
+
+REGISTER_NET_TEMP(wglow, bool isNew)
+#ifdef CSQC
+{
+ vector g = '0 0 0';
+ g.x = ReadCoord();
+ g.y = ReadCoord();
+ g.z = ReadCoord();
+ viewmodel.glowmod = g;
+}
+#endif
+
+#ifdef SVQC
+void wglow_send(entity actor, vector g)
+{
+ if (!IS_REAL_CLIENT(actor)) return;
+ int channel = MSG_ONE;
+ msg_entity = actor;
+ WriteHeader(channel, wglow);
+ WriteCoord(channel, g.x);
+ WriteCoord(channel, g.y);
+ WriteCoord(channel, g.z);
}
#endif
return true;
}
+void wglow_send(entity actor, vector g);
+
/*
=============
PlayerPreThink
if(frametime)
{
+ vector g;
if(self.weapon == WEP_VORTEX.m_id && WEP_CVAR(vortex, charge))
{
- self.weaponentity_glowmod_x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, self.vortex_charge / WEP_CVAR(vortex, charge_animlimit));
- self.weaponentity_glowmod_y = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_half * min(1, self.vortex_charge / WEP_CVAR(vortex, charge_animlimit));
- self.weaponentity_glowmod_z = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_half * min(1, self.vortex_charge / WEP_CVAR(vortex, charge_animlimit));
+ g.x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, self.vortex_charge / WEP_CVAR(vortex, charge_animlimit));
+ g.y = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_half * min(1, self.vortex_charge / WEP_CVAR(vortex, charge_animlimit));
+ g.z = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_half * min(1, self.vortex_charge / WEP_CVAR(vortex, charge_animlimit));
if(self.vortex_charge > WEP_CVAR(vortex, charge_animlimit))
{
- self.weaponentity_glowmod_x = self.weaponentity_glowmod.x + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_full * (self.vortex_charge - WEP_CVAR(vortex, charge_animlimit)) / (1 - WEP_CVAR(vortex, charge_animlimit));
- self.weaponentity_glowmod_y = self.weaponentity_glowmod.y + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_full * (self.vortex_charge - WEP_CVAR(vortex, charge_animlimit)) / (1 - WEP_CVAR(vortex, charge_animlimit));
- self.weaponentity_glowmod_z = self.weaponentity_glowmod.z + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_full * (self.vortex_charge - WEP_CVAR(vortex, charge_animlimit)) / (1 - WEP_CVAR(vortex, charge_animlimit));
+ g.x += autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_full * (self.vortex_charge - WEP_CVAR(vortex, charge_animlimit)) / (1 - WEP_CVAR(vortex, charge_animlimit));
+ g.y += autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_full * (self.vortex_charge - WEP_CVAR(vortex, charge_animlimit)) / (1 - WEP_CVAR(vortex, charge_animlimit));
+ g.z += autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_full * (self.vortex_charge - WEP_CVAR(vortex, charge_animlimit)) / (1 - WEP_CVAR(vortex, charge_animlimit));
}
}
else
- self.weaponentity_glowmod = colormapPaletteColor(self.clientcolors & 0x0F, true) * 2;
-
+ g = colormapPaletteColor(self.clientcolors & 0x0F, true) * 2;
+ if (g != self.weaponentity_glowmod)
+ wglow_send(self, self.weaponentity_glowmod = g);
player_powerups();
}
CL_WeaponEntity_SetModel(this, this.owner.weaponname);
}
- int tb = (this.effects & (EF_TELEPORT_BIT | EF_RESTARTANIM_BIT));
- this.effects = this.owner.effects
- & EFMASK_CHEAP
- & ~(
- EF_LOWPRECISION
- | EF_FULLBRIGHT // can mask team color, so get rid of it
- | EF_TELEPORT_BIT
- | EF_RESTARTANIM_BIT
- )
- | tb
- // TODO: don't render this entity at all
- | EF_NODRAW;
+ this.effects = EF_NODRAW; // TODO: don't render this entity at all
if (this.owner.alpha == default_player_alpha) this.alpha = default_weapon_alpha;
else if (this.owner.alpha != 0) this.alpha = this.owner.alpha;
else this.alpha = 1;
- this.glowmod = this.owner.weaponentity_glowmod;
- this.colormap = this.owner.colormap;
if (this.weaponchild)
{
this.weaponchild.effects = this.effects;
- this.weaponchild.alpha = this.alpha;
- this.weaponchild.colormap = this.colormap;
- this.weaponchild.glowmod = this.glowmod;
}
}