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,81 +2378,84 @@ 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 ||
color[0] = color[1] = color[2] = 255; cl.stats[STAT_ACTIVEWEAPON] == W_M2 || cl.stats[STAT_ACTIVEWEAPON] == W_FIW)
} else { return;
color[0] = 132;
color[1] = 44; // Start fully colored
color[2] = 139; 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 // Weapon overrides for muzzleflash color
if (sv_player->v.view_ofs[2] >= 0) switch(cl.stats[STAT_ACTIVEWEAPON]) {
org[2] -= 32 - sv_player->v.view_ofs[2]; case W_RAY:
else color[0] = 0;
org[2] -= 32 + abs(sv_player->v.view_ofs[2]); color[1] = 255;
/*if (sv_player->v.view_ofs[2] == 8) { color[2] = 0;
org[2] -= 24; break;
} else if (sv_player->v.view_ofs[2] == -10) { case W_PORTER:
org[2] -= 42; 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)))) if(!(ISUNDERWATER(TruePointContents(org))))
{ {
size = sv_player->v.Flash_Size; size = sv_player->v.Flash_Size;
if(size == 0 || cl.stats[STAT_ZOOM] == 2) if(size == 0 || cl.stats[STAT_ZOOM] == 2)
return; return;
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);