PSP/CTR: Remove legacy QMB_RayFlash reference

This commit is contained in:
cypress 2024-09-09 18:06:32 -07:00
parent 4bb4e817dd
commit d274259d9d
5 changed files with 55 additions and 81 deletions

View file

@ -766,11 +766,7 @@ void CL_RelinkEntities (void)
VectorMA (smokeorg, right_offset, v_right ,smokeorg);
VectorAdd(smokeorg,CWeaponOffset,smokeorg);
if (sv_player->v.weapon != W_RAY && sv_player->v.weapon != W_PORTER) {
QMB_MuzzleFlash (smokeorg);
} else {
QMB_RayFlash(smokeorg, sv_player->v.weapon);
}
QMB_MuzzleFlash (smokeorg);
}
}

View file

@ -2174,29 +2174,6 @@ float pap_detr(int weapon)
}
}
// cypress - Raygun barrel trail
void QMB_RayFlash(vec3_t org, float weapon)
{
// if we're ADS, just flat out end here to avoid useless calcs/defs
if (cl.stats[STAT_ZOOM] || !qmb_initialized)
return;
col_t color;
vec3_t endorg;
// green trail
if (weapon == W_RAY) {
color[0] = 0;
color[1] = 255;
} else { // red trail
color[0] = 255;
color[1] = 0;
}
color[2] = 0;
QMB_MuzzleFlash(org);
}
//R00k added particle muzzleflashes
qboolean red_or_blue_pap;
void QMB_MuzzleFlash(vec3_t org)

View file

@ -359,7 +359,6 @@ void QMB_LightningBeam (vec3_t start, vec3_t end);
//void QMB_GenSparks (vec3_t org, byte col[3], float count, float size, float life);
void QMB_EntityParticles (entity_t *ent);
void QMB_MuzzleFlash (vec3_t org);
void QMB_RayFlash (vec3_t org, float weapon);
void QMB_MuzzleFlashLG (vec3_t org);
void QMB_Q3Gunshot (vec3_t org, int skinnum, float alpha);
void QMB_Q3Teleport (vec3_t org, float alpha);

View file

@ -2378,81 +2378,84 @@ float pap_detr(int weapon)
return 0;
}
// cypress - Raygun barrel trail
void QMB_RayFlash(vec3_t org, float weapon)
{
// if we're ADS, just flat out end here to avoid useless calcs/defs
if (cl.stats[STAT_ZOOM] || !qmb_initialized)
return;
col_t color;
vec3_t endorg;
// green trail
if (weapon == W_RAY) {
color[0] = 0;
color[1] = 255;
} else { // red trail
color[0] = 255;
color[1] = 0;
}
color[2] = 0;
QMB_MuzzleFlash(org);
}
//R00k added particle muzzleflashes
qboolean red_or_blue_pap;
void QMB_MuzzleFlash(vec3_t org)
{
if (!qmb_initialized) {
return;
}
float frametime = fabs(cl.ctime - cl.oldtime);
double frametime = fabs(cl.time - cl.oldtime);
col_t color;
// change color if PaP
if (pap_detr(cl.stats[STAT_ACTIVEWEAPON]) == 0) {
color[0] = color[1] = color[2] = 255;
} else {
color[0] = 132;
color[1] = 44;
color[2] = 139;
// No muzzleflash for the Panzerschreck or the Flamethrower
if (cl.stats[STAT_ACTIVEWEAPON] == W_PANZER || cl.stats[STAT_ACTIVEWEAPON] == W_LONGINUS ||
cl.stats[STAT_ACTIVEWEAPON] == W_M2 || cl.stats[STAT_ACTIVEWEAPON] == W_FIW)
return;
// Start fully colored
color[0] = color[1] = color[2] = 255;
// Alternate red and blue if it's a Pack-a-Punched weapon
if (pap_detr(cl.stats[STAT_ACTIVEWEAPON])) {
if (red_or_blue_pap) {
color[0] = 255;
color[1] = 10;
color[2] = 22;
} else {
color[0] = 22;
color[1] = 10;
color[2] = 255;
}
red_or_blue_pap = !red_or_blue_pap;
}
// lower origin based on player stance
if (sv_player->v.view_ofs[2] >= 0)
org[2] -= 32 - sv_player->v.view_ofs[2];
else
org[2] -= 32 + abs(sv_player->v.view_ofs[2]);
/*if (sv_player->v.view_ofs[2] == 8) {
org[2] -= 24;
} else if (sv_player->v.view_ofs[2] == -10) {
org[2] -= 42;
}*/
// Weapon overrides for muzzleflash color
switch(cl.stats[STAT_ACTIVEWEAPON]) {
case W_RAY:
color[0] = 0;
color[1] = 255;
color[2] = 0;
break;
case W_PORTER:
color[0] = 255;
color[1] = 0;
color[2] = 0;
break;
case W_TESLA:
color[0] = 22;
color[1] = 139;
color[2] = 255;
break;
case W_DG3:
color[0] = 255;
color[1] = 89;
color[2] = 22;
break;
}
float size;
float size, timemod;
timemod = 0.08;
if(!(ISUNDERWATER(TruePointContents(org))))
{
size = sv_player->v.Flash_Size;
if(size == 0 || cl.stats[STAT_ZOOM] == 2)
return;
switch(rand() % 3 + 1)
{
case 1:
AddParticle (p_muzzleflash, org, 1, size, 0.04 * frametime, color, zerodir);
AddParticle (p_muzzleflash, org, 1, size, timemod * frametime, color, zerodir);
break;
case 2:
AddParticle (p_muzzleflash2, org, 1, size, 0.04 * frametime, color, zerodir);
AddParticle (p_muzzleflash2, org, 1, size, timemod * frametime, color, zerodir);
break;
case 3:
AddParticle (p_muzzleflash3, org, 1, size, 0.04 * frametime, color, zerodir);
AddParticle (p_muzzleflash3, org, 1, size, timemod * frametime, color, zerodir);
break;
default:
AddParticle (p_muzzleflash, org, 1, size, 0.04 * frametime, color, zerodir);
AddParticle (p_muzzleflash, org, 1, size, timemod * frametime, color, zerodir);
break;
}
}

View file

@ -365,7 +365,6 @@ void QMB_DrawParticles (void);
void QMB_Q3TorchFlame (vec3_t org, float size);
void QMB_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count);
void QMB_RocketTrail (vec3_t start, vec3_t end, trail_type_t type);
void QMB_RayFlash (vec3_t org, float weapon);
void QMB_BlobExplosion (vec3_t org);
void QMB_ParticleExplosion (vec3_t org);
void QMB_LavaSplash (vec3_t org);