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); VectorMA (smokeorg, right_offset, v_right ,smokeorg);
VectorAdd(smokeorg,CWeaponOffset,smokeorg); VectorAdd(smokeorg,CWeaponOffset,smokeorg);
if (sv_player->v.weapon != W_RAY && sv_player->v.weapon != W_PORTER) {
QMB_MuzzleFlash (smokeorg); QMB_MuzzleFlash (smokeorg);
} else {
QMB_RayFlash(smokeorg, sv_player->v.weapon);
}
} }
} }

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 //R00k added particle muzzleflashes
qboolean red_or_blue_pap; qboolean red_or_blue_pap;
void QMB_MuzzleFlash(vec3_t org) 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_GenSparks (vec3_t org, byte col[3], float count, float size, float life);
void QMB_EntityParticles (entity_t *ent); void QMB_EntityParticles (entity_t *ent);
void QMB_MuzzleFlash (vec3_t org); void QMB_MuzzleFlash (vec3_t org);
void QMB_RayFlash (vec3_t org, float weapon);
void QMB_MuzzleFlashLG (vec3_t org); void QMB_MuzzleFlashLG (vec3_t org);
void QMB_Q3Gunshot (vec3_t org, int skinnum, float alpha); void QMB_Q3Gunshot (vec3_t org, int skinnum, float alpha);
void QMB_Q3Teleport (vec3_t org, float alpha); void QMB_Q3Teleport (vec3_t org, float alpha);

View file

@ -2378,60 +2378,63 @@ float pap_detr(int weapon)
return 0; 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 //R00k added particle muzzleflashes
qboolean red_or_blue_pap;
void QMB_MuzzleFlash(vec3_t org) void QMB_MuzzleFlash(vec3_t org)
{ {
if (!qmb_initialized) { double frametime = fabs(cl.time - cl.oldtime);
return;
}
float frametime = fabs(cl.ctime - cl.oldtime);
col_t color; col_t color;
// change color if PaP // No muzzleflash for the Panzerschreck or the Flamethrower
if (pap_detr(cl.stats[STAT_ACTIVEWEAPON]) == 0) { 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; 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 { } else {
color[0] = 132; color[0] = 22;
color[1] = 44; color[1] = 10;
color[2] = 139; color[2] = 255;
} }
// lower origin based on player stance red_or_blue_pap = !red_or_blue_pap;
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;
}*/
float size; // 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, timemod;
timemod = 0.08;
if(!(ISUNDERWATER(TruePointContents(org)))) if(!(ISUNDERWATER(TruePointContents(org))))
{ {
@ -2443,16 +2446,16 @@ void QMB_MuzzleFlash(vec3_t org)
switch(rand() % 3 + 1) switch(rand() % 3 + 1)
{ {
case 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; break;
case 2: case 2:
AddParticle (p_muzzleflash2, org, 1, size, 0.04 * frametime, color, zerodir); AddParticle (p_muzzleflash2, org, 1, size, timemod * frametime, color, zerodir);
break; break;
case 3: case 3:
AddParticle (p_muzzleflash3, org, 1, size, 0.04 * frametime, color, zerodir); AddParticle (p_muzzleflash3, org, 1, size, timemod * frametime, color, zerodir);
break; break;
default: default:
AddParticle (p_muzzleflash, org, 1, size, 0.04 * frametime, color, zerodir); AddParticle (p_muzzleflash, org, 1, size, timemod * frametime, color, zerodir);
break; break;
} }
} }

View file

@ -365,7 +365,6 @@ void QMB_DrawParticles (void);
void QMB_Q3TorchFlame (vec3_t org, float size); void QMB_Q3TorchFlame (vec3_t org, float size);
void QMB_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count); 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_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_BlobExplosion (vec3_t org);
void QMB_ParticleExplosion (vec3_t org); void QMB_ParticleExplosion (vec3_t org);
void QMB_LavaSplash (vec3_t org); void QMB_LavaSplash (vec3_t org);