mirror of https://github.com/nzp-team/fteqw.git
pe_defaultrail, like pe_default but for trails, works mostly with q2 for now though
additional Q2 TE_s supported a few other particle fixes git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1454 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
0751c774e9
commit
e47090201b
|
@ -3190,7 +3190,7 @@ int CL_PlayerColor(player_info_t *plr, int *name_ormask)
|
||||||
if (*t)
|
if (*t)
|
||||||
c = atoi(t);
|
c = atoi(t);
|
||||||
else
|
else
|
||||||
c = plr->userid - 1;
|
c = plr->userid; // Quake2 can start from 0
|
||||||
|
|
||||||
if ((c / 7) & 1)
|
if ((c / 7) & 1)
|
||||||
*name_ormask = CON_STANDARDMASK;
|
*name_ormask = CON_STANDARDMASK;
|
||||||
|
|
|
@ -331,7 +331,9 @@ void CL_AddBeam (int tent, int ent, vec3_t start, vec3_t end) //fixme: use TE_ n
|
||||||
case 0:
|
case 0:
|
||||||
if (ent < 0 && ent >= -512) //a zquake concept. ent between -1 and -maxplayers is to be taken to be a railtrail from a particular player instead of a beam.
|
if (ent < 0 && ent >= -512) //a zquake concept. ent between -1 and -maxplayers is to be taken to be a railtrail from a particular player instead of a beam.
|
||||||
{
|
{
|
||||||
CLQ2_RailTrail(start, end);
|
// TODO: add support for those finnicky colored railtrails...
|
||||||
|
if (P_ParticleTrail(start, end, rt_railtrail, NULL))
|
||||||
|
P_ParticleTrailIndex(start, end, 208, 8, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -735,7 +737,10 @@ void CL_ParseTEnt (void)
|
||||||
pos[1] = MSG_ReadCoord ();
|
pos[1] = MSG_ReadCoord ();
|
||||||
pos[2] = MSG_ReadCoord ();
|
pos[2] = MSG_ReadCoord ();
|
||||||
if (P_RunParticleEffectTypeString(pos, NULL, 1, "te_explosionquad"))
|
if (P_RunParticleEffectTypeString(pos, NULL, 1, "te_explosionquad"))
|
||||||
P_ParticleExplosion (pos);
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_explosion))
|
||||||
|
P_RunParticleEffect(pos, NULL, 107, 1024); // should be 97-111
|
||||||
|
|
||||||
|
R_AddStain(pos, -1, -1, -1, 100);
|
||||||
|
|
||||||
// light
|
// light
|
||||||
if (r_explosionlight.value)
|
if (r_explosionlight.value)
|
||||||
|
@ -772,7 +777,10 @@ void CL_ParseTEnt (void)
|
||||||
pos[0] = MSG_ReadCoord ();
|
pos[0] = MSG_ReadCoord ();
|
||||||
pos[1] = MSG_ReadCoord ();
|
pos[1] = MSG_ReadCoord ();
|
||||||
pos[2] = MSG_ReadCoord ();
|
pos[2] = MSG_ReadCoord ();
|
||||||
P_ParticleExplosion (pos);
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_explosion))
|
||||||
|
P_RunParticleEffect(pos, NULL, 107, 1024); // should be 97-111
|
||||||
|
|
||||||
|
R_AddStain(pos, -1, -1, -1, 100);
|
||||||
|
|
||||||
// light
|
// light
|
||||||
if (r_explosionlight.value)
|
if (r_explosionlight.value)
|
||||||
|
@ -809,7 +817,11 @@ void CL_ParseTEnt (void)
|
||||||
pos[0] = MSG_ReadCoord ();
|
pos[0] = MSG_ReadCoord ();
|
||||||
pos[1] = MSG_ReadCoord ();
|
pos[1] = MSG_ReadCoord ();
|
||||||
pos[2] = MSG_ReadCoord ();
|
pos[2] = MSG_ReadCoord ();
|
||||||
P_ParticleExplosion (pos);
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_explosion))
|
||||||
|
P_RunParticleEffect(pos, NULL, 107, 1024); // should be 97-111
|
||||||
|
|
||||||
|
R_AddStain(pos, -1, -1, -1, 100);
|
||||||
|
|
||||||
|
|
||||||
// light
|
// light
|
||||||
if (r_explosionlight.value)
|
if (r_explosionlight.value)
|
||||||
|
@ -836,7 +848,10 @@ void CL_ParseTEnt (void)
|
||||||
pos[1] = MSG_ReadCoord ();
|
pos[1] = MSG_ReadCoord ();
|
||||||
pos[2] = MSG_ReadCoord ();
|
pos[2] = MSG_ReadCoord ();
|
||||||
if (P_RunParticleEffectTypeString(pos, NULL, 1, "te_bigexplosion"))
|
if (P_RunParticleEffectTypeString(pos, NULL, 1, "te_bigexplosion"))
|
||||||
P_ParticleExplosion (pos);
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_explosion))
|
||||||
|
P_RunParticleEffect(pos, NULL, 107, 1024); // should be 97-111
|
||||||
|
|
||||||
|
R_AddStain(pos, -1, -1, -1, 100);
|
||||||
|
|
||||||
// light
|
// light
|
||||||
if (r_explosionlight.value)
|
if (r_explosionlight.value)
|
||||||
|
@ -951,7 +966,9 @@ void CL_ParseTEnt (void)
|
||||||
pos2[0] = MSG_ReadCoord ();
|
pos2[0] = MSG_ReadCoord ();
|
||||||
pos2[1] = MSG_ReadCoord ();
|
pos2[1] = MSG_ReadCoord ();
|
||||||
pos2[2] = MSG_ReadCoord ();
|
pos2[2] = MSG_ReadCoord ();
|
||||||
CLQ2_RailTrail (pos, pos2);
|
|
||||||
|
if (P_ParticleTrail(pos, pos2, rt_railtrail, NULL))
|
||||||
|
P_ParticleTrailIndex(pos, pos2, 208, 8, NULL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TE_STREAM_CHAIN:
|
case TE_STREAM_CHAIN:
|
||||||
|
@ -1088,7 +1105,8 @@ void CL_ParseTEnt (void)
|
||||||
// stain (Hopefully this is close to how DP does it)
|
// stain (Hopefully this is close to how DP does it)
|
||||||
R_AddStain(pos, -10, -10, -10, 30);
|
R_AddStain(pos, -10, -10, -10, 30);
|
||||||
|
|
||||||
P_ParticleTrail(pos, pos2, P_FindParticleType("te_plasmaburn"), NULL);
|
if (P_ParticleTrail(pos, pos2, P_FindParticleType("te_plasmaburn"), NULL))
|
||||||
|
P_ParticleTrailIndex(pos, pos2, 15, 0, NULL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DPTE_TEI_G3: //nexuiz's nex beam
|
case DPTE_TEI_G3: //nexuiz's nex beam
|
||||||
|
@ -1105,7 +1123,8 @@ void CL_ParseTEnt (void)
|
||||||
MSG_ReadCoord ();
|
MSG_ReadCoord ();
|
||||||
MSG_ReadCoord ();
|
MSG_ReadCoord ();
|
||||||
|
|
||||||
P_ParticleTrail(pos, pos2, P_FindParticleType("te_nexbeam"), NULL);
|
if (P_ParticleTrail(pos, pos2, P_FindParticleType("te_nexbeam"), NULL))
|
||||||
|
P_ParticleTrailIndex(pos, pos2, 15, 0, NULL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DPTE_SMOKE:
|
case DPTE_SMOKE:
|
||||||
|
@ -1527,6 +1546,7 @@ void CL_Laser (vec3_t start, vec3_t end, int colors)
|
||||||
VectorCopy (end, ex->oldorigin);
|
VectorCopy (end, ex->oldorigin);
|
||||||
ex->flags = Q2RF_TRANSLUCENT | Q2RF_BEAM;
|
ex->flags = Q2RF_TRANSLUCENT | Q2RF_BEAM;
|
||||||
ex->start = cl.time;
|
ex->start = cl.time;
|
||||||
|
ex->framerate = 100; // smoother fading
|
||||||
}
|
}
|
||||||
|
|
||||||
static qbyte splash_color[] = {0x00, 0xe0, 0xb0, 0x50, 0xd0, 0xe0, 0xe8};
|
static qbyte splash_color[] = {0x00, 0xe0, 0xb0, 0x50, 0xd0, 0xe0, 0xe8};
|
||||||
|
@ -1556,7 +1576,8 @@ void CLQ2_ParseTEnt (void)
|
||||||
case Q2TE_BLOOD: // bullet hitting flesh
|
case Q2TE_BLOOD: // bullet hitting flesh
|
||||||
MSG_ReadPos (pos);
|
MSG_ReadPos (pos);
|
||||||
MSG_ReadDir (dir);
|
MSG_ReadDir (dir);
|
||||||
P_RunParticleEffectType(pos, dir, 1, pt_blood);
|
if (P_RunParticleEffectType(pos, dir, 1, pt_blood))
|
||||||
|
P_RunParticleEffect(pos, dir, 0xe8, 60);
|
||||||
R_AddStain(pos, 0, -10, -10, 40);
|
R_AddStain(pos, 0, -10, -10, 40);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1707,7 +1728,8 @@ void CLQ2_ParseTEnt (void)
|
||||||
case Q2TE_RAILTRAIL: // railgun effect
|
case Q2TE_RAILTRAIL: // railgun effect
|
||||||
MSG_ReadPos (pos);
|
MSG_ReadPos (pos);
|
||||||
MSG_ReadPos (pos2);
|
MSG_ReadPos (pos2);
|
||||||
CLQ2_RailTrail (pos, pos2);
|
if (P_ParticleTrail(pos, pos2, rt_railtrail, NULL))
|
||||||
|
P_ParticleTrailIndex(pos, pos2, 0x74, 8, NULL);
|
||||||
Q2S_StartSound (pos, 0, 0, S_PrecacheSound ("weapons/railgf1a.wav"), 1, ATTN_NORM, 0);
|
Q2S_StartSound (pos, 0, 0, S_PrecacheSound ("weapons/railgf1a.wav"), 1, ATTN_NORM, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1716,8 +1738,11 @@ void CLQ2_ParseTEnt (void)
|
||||||
case Q2TE_GRENADE_EXPLOSION_WATER:
|
case Q2TE_GRENADE_EXPLOSION_WATER:
|
||||||
MSG_ReadPos (pos);
|
MSG_ReadPos (pos);
|
||||||
|
|
||||||
P_ParticleExplosion (pos);
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_explosion))
|
||||||
|
P_RunParticleEffect(pos, NULL, 0xe0, 256);
|
||||||
|
|
||||||
|
R_AddStain(pos, -1, -1, -1, 100);
|
||||||
|
|
||||||
// light
|
// light
|
||||||
if (r_explosionlight.value)
|
if (r_explosionlight.value)
|
||||||
{
|
{
|
||||||
|
@ -1806,7 +1831,12 @@ void CLQ2_ParseTEnt (void)
|
||||||
|
|
||||||
// particle effect
|
// particle effect
|
||||||
if (type != Q2TE_EXPLOSION1_BIG && type != Q2TE_EXPLOSION1_NP)
|
if (type != Q2TE_EXPLOSION1_BIG && type != Q2TE_EXPLOSION1_NP)
|
||||||
P_ParticleExplosion (pos);
|
{
|
||||||
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_explosion))
|
||||||
|
P_RunParticleEffect(pos, NULL, 0xe0, 256);
|
||||||
|
|
||||||
|
R_AddStain(pos, -1, -1, -1, 100);
|
||||||
|
}
|
||||||
|
|
||||||
// light
|
// light
|
||||||
if (r_explosionlight.value)
|
if (r_explosionlight.value)
|
||||||
|
@ -1892,6 +1922,8 @@ void CLQ2_ParseTEnt (void)
|
||||||
case Q2TE_BFG_BIGEXPLOSION:
|
case Q2TE_BFG_BIGEXPLOSION:
|
||||||
MSG_ReadPos (pos);
|
MSG_ReadPos (pos);
|
||||||
// CL_BFGExplosionParticles (pos);
|
// CL_BFGExplosionParticles (pos);
|
||||||
|
if (P_RunParticleEffectTypeString(pos, dir, 1, "te_bfg_bigexplosion"))
|
||||||
|
P_RunParticleEffect(pos, dir, 0xd0, 256); // TODO: x+(r%8) unstead of x&7+(r&7)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Q2TE_BFG_LASER:
|
case Q2TE_BFG_LASER:
|
||||||
|
@ -1903,7 +1935,8 @@ void CLQ2_ParseTEnt (void)
|
||||||
case Q2TE_BUBBLETRAIL:
|
case Q2TE_BUBBLETRAIL:
|
||||||
MSG_ReadPos (pos);
|
MSG_ReadPos (pos);
|
||||||
MSG_ReadPos (pos2);
|
MSG_ReadPos (pos2);
|
||||||
CLQ2_BubbleTrail (pos, pos2);
|
if (P_ParticleTrail(pos, pos2, rt_bubbletrail, NULL))
|
||||||
|
P_ParticleTrailIndex(pos, pos2, 4, 8, NULL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Q2TE_PARASITE_ATTACK:
|
case Q2TE_PARASITE_ATTACK:
|
||||||
|
@ -1928,6 +1961,9 @@ void CLQ2_ParseTEnt (void)
|
||||||
MSG_ReadPos (pos);
|
MSG_ReadPos (pos);
|
||||||
MSG_ReadDir (dir);
|
MSG_ReadDir (dir);
|
||||||
color = MSG_ReadByte ();
|
color = MSG_ReadByte ();
|
||||||
|
|
||||||
|
// TODO: fix to Q2's standards
|
||||||
|
P_RunParticleEffect(pos, dir, color, cnt);
|
||||||
/* CL_ParticleEffect2 (pos, dir, color, cnt);
|
/* CL_ParticleEffect2 (pos, dir, color, cnt);
|
||||||
|
|
||||||
ex = CL_AllocExplosion ();
|
ex = CL_AllocExplosion ();
|
||||||
|
@ -1948,6 +1984,8 @@ void CLQ2_ParseTEnt (void)
|
||||||
case Q2TE_GREENBLOOD:
|
case Q2TE_GREENBLOOD:
|
||||||
MSG_ReadPos (pos);
|
MSG_ReadPos (pos);
|
||||||
MSG_ReadDir (dir);
|
MSG_ReadDir (dir);
|
||||||
|
if (P_RunParticleEffectTypeString(pos, dir, 1, "te_greenblood"))
|
||||||
|
P_RunParticleEffect(pos, dir, 0xdf, 30); // TODO: x+(r%8) unstead of x&7+(r&7)
|
||||||
// CL_ParticleEffect2 (pos, dir, 0xdf, 30);
|
// CL_ParticleEffect2 (pos, dir, 0xdf, 30);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2072,7 +2110,8 @@ void CLQ2_ParseTEnt (void)
|
||||||
case Q2TE_DEBUGTRAIL:
|
case Q2TE_DEBUGTRAIL:
|
||||||
MSG_ReadPos (pos);
|
MSG_ReadPos (pos);
|
||||||
MSG_ReadPos (pos2);
|
MSG_ReadPos (pos2);
|
||||||
P_ParticleTrail(pos, pos2, P_AllocateParticleType("te_debugtrail"), NULL);
|
if (P_ParticleTrail(pos, pos2, P_AllocateParticleType("te_debugtrail"), NULL))
|
||||||
|
P_ParticleTrailIndex(pos, pos2, 116, 8, NULL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Q2TE_PLAIN_EXPLOSION:
|
case Q2TE_PLAIN_EXPLOSION:
|
||||||
|
@ -2169,13 +2208,15 @@ void CLQ2_ParseTEnt (void)
|
||||||
CL_BubbleTrail2 (pos, pos2, cnt);
|
CL_BubbleTrail2 (pos, pos2, cnt);
|
||||||
S_StartSound (pos, 0, 0, cl_sfx_lashit, 1, ATTN_NORM, 0);
|
S_StartSound (pos, 0, 0, cl_sfx_lashit, 1, ATTN_NORM, 0);
|
||||||
break;
|
break;
|
||||||
|
*/
|
||||||
case Q2TE_MOREBLOOD:
|
case Q2TE_MOREBLOOD:
|
||||||
MSG_ReadPos (&net_message, pos);
|
MSG_ReadPos (pos);
|
||||||
MSG_ReadDir (&net_message, dir);
|
MSG_ReadDir (dir);
|
||||||
CL_ParticleEffect (pos, dir, 0xe8, 250);
|
if (P_RunParticleEffectTypeString(pos, dir, 1, "te_moreblood"))
|
||||||
|
if (P_RunParticleEffectType(pos, dir, 4, pt_blood))
|
||||||
|
P_RunParticleEffect(pos, dir, 0xe8, 250);
|
||||||
break;
|
break;
|
||||||
|
/*
|
||||||
case Q2TE_CHAINFIST_SMOKE:
|
case Q2TE_CHAINFIST_SMOKE:
|
||||||
dir[0]=0; dir[1]=0; dir[2]=1;
|
dir[0]=0; dir[1]=0; dir[2]=1;
|
||||||
MSG_ReadPos(&net_message, pos);
|
MSG_ReadPos(&net_message, pos);
|
||||||
|
@ -2196,7 +2237,8 @@ void CLQ2_ParseTEnt (void)
|
||||||
MSG_ReadPos (pos);
|
MSG_ReadPos (pos);
|
||||||
|
|
||||||
// effect
|
// effect
|
||||||
P_RunParticleEffectTypeString(pos, NULL, 1, "te_tracker_explosion");
|
if (P_RunParticleEffectTypeString(pos, NULL, 1, "te_tracker_explosion"))
|
||||||
|
P_RunParticleEffect(pos, NULL, 0, 128); // TODO: needs to be nonrandom instead of 0+r%8
|
||||||
|
|
||||||
// light
|
// light
|
||||||
// light
|
// light
|
||||||
|
@ -2234,13 +2276,17 @@ void CLQ2_ParseTEnt (void)
|
||||||
CL_ParseNuke ();
|
CL_ParseNuke ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
*/
|
||||||
case Q2TE_WIDOWSPLASH:
|
case Q2TE_WIDOWSPLASH:
|
||||||
MSG_ReadPos (&net_message, pos);
|
MSG_ReadPos (pos);
|
||||||
CL_WidowSplash (pos);
|
// this one is really annoying, it's supposed to be a random choice
|
||||||
|
// between 2*8, 13*8, 21*8, 18*8
|
||||||
|
if (P_RunParticleEffectTypeString(pos, NULL, 1, "te_widowsplash"))
|
||||||
|
P_RunParticleEffect(pos, NULL, 13*8, 256);
|
||||||
break;
|
break;
|
||||||
//PGM
|
//PGM
|
||||||
//==============
|
//==============
|
||||||
*/
|
|
||||||
default:
|
default:
|
||||||
Host_EndGame ("CLQ2_ParseTEnt: bad/non-implemented type %i", type);
|
Host_EndGame ("CLQ2_ParseTEnt: bad/non-implemented type %i", type);
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,7 +105,6 @@ void CLQ2_TrapParticles(entity_t *ent){};
|
||||||
void CLQ2_BfgParticles(entity_t *ent){};
|
void CLQ2_BfgParticles(entity_t *ent){};
|
||||||
void CLQ2_FlyEffect(q2centity_t *ent, vec3_t org){};
|
void CLQ2_FlyEffect(q2centity_t *ent, vec3_t org){};
|
||||||
void CLQ2_DiminishingTrail(vec3_t oldorg, vec3_t neworg, q2centity_t *ent, unsigned int effects){};
|
void CLQ2_DiminishingTrail(vec3_t oldorg, vec3_t neworg, q2centity_t *ent, unsigned int effects){};
|
||||||
void CLQ2_BlasterTrail(vec3_t oldorg, vec3_t neworg);
|
|
||||||
void CLQ2_BlasterTrail2(vec3_t oldorg, vec3_t neworg){};
|
void CLQ2_BlasterTrail2(vec3_t oldorg, vec3_t neworg){};
|
||||||
|
|
||||||
|
|
||||||
|
@ -651,7 +650,10 @@ void CLQ2_AddProjectiles (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pr->effects & EF_BLASTER)
|
if (pr->effects & EF_BLASTER)
|
||||||
CLQ2_BlasterTrail (pr->oldorigin, ent.origin);
|
{
|
||||||
|
if (P_ParticleTrail(pr->oldorigin, ent.origin, rt_blastertrail, NULL))
|
||||||
|
P_ParticleTrailIndex(pr->oldorigin, ent.origin, 0xe0, 1, NULL);
|
||||||
|
}
|
||||||
V_AddLight (pr->origin, 200, 0.2, 0.2, 0);
|
V_AddLight (pr->origin, 200, 0.2, 0.2, 0);
|
||||||
|
|
||||||
VectorCopy (pr->angles, ent.angles);
|
VectorCopy (pr->angles, ent.angles);
|
||||||
|
@ -1706,14 +1708,15 @@ void CLQ2_AddPacketEntities (q2frame_t *frame)
|
||||||
{
|
{
|
||||||
if (effects & Q2EF_ROCKET)
|
if (effects & Q2EF_ROCKET)
|
||||||
{
|
{
|
||||||
P_ParticleTrail(cent->lerp_origin, ent.origin, rt_rocket, ¢->trailstate);
|
if (P_ParticleTrail(cent->lerp_origin, ent.origin, rt_rocket, ¢->trailstate))
|
||||||
|
P_ParticleTrailIndex(cent->lerp_origin, ent.origin, 0xdc, 4, ¢->trailstate);
|
||||||
|
|
||||||
V_AddLight (ent.origin, 200, 0.2, 0.2, 0);
|
V_AddLight (ent.origin, 200, 0.2, 0.2, 0);
|
||||||
}
|
}
|
||||||
// PGM - Do not reorder EF_BLASTER and EF_HYPERBLASTER.
|
// PGM - Do not reorder EF_BLASTER and EF_HYPERBLASTER.
|
||||||
// EF_BLASTER | EF_TRACKER is a special case for EF_BLASTER2... Cheese!
|
// EF_BLASTER | EF_TRACKER is a special case for EF_BLASTER2... Cheese!
|
||||||
else if (effects & Q2EF_BLASTER)
|
else if (effects & Q2EF_BLASTER)
|
||||||
{
|
{
|
||||||
// CLQ2_BlasterTrail (cent->lerp_origin, ent.origin);
|
|
||||||
//PGM
|
//PGM
|
||||||
if (effects & Q2EF_TRACKER) // lame... problematic?
|
if (effects & Q2EF_TRACKER) // lame... problematic?
|
||||||
{
|
{
|
||||||
|
@ -1722,7 +1725,8 @@ void CLQ2_AddPacketEntities (q2frame_t *frame)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
P_ParticleTrail(cent->lerp_origin, ent.origin, rt_blastertrail, ¢->trailstate);
|
if (P_ParticleTrail(cent->lerp_origin, ent.origin, rt_blastertrail, ¢->trailstate))
|
||||||
|
P_ParticleTrailIndex(cent->lerp_origin, ent.origin, 0xe0, 1, ¢->trailstate);
|
||||||
V_AddLight (ent.origin, 200, 0.2, 0.2, 0);
|
V_AddLight (ent.origin, 200, 0.2, 0.2, 0);
|
||||||
}
|
}
|
||||||
//PGM
|
//PGM
|
||||||
|
@ -1736,11 +1740,13 @@ void CLQ2_AddPacketEntities (q2frame_t *frame)
|
||||||
}
|
}
|
||||||
else if (effects & Q2EF_GIB)
|
else if (effects & Q2EF_GIB)
|
||||||
{
|
{
|
||||||
P_ParticleTrail(cent->lerp_origin, ent.origin, rt_gib, ¢->trailstate);
|
if (P_ParticleTrail(cent->lerp_origin, ent.origin, rt_gib, ¢->trailstate))
|
||||||
|
P_ParticleTrailIndex(cent->lerp_origin, ent.origin, 0xe8, 8, ¢->trailstate);
|
||||||
}
|
}
|
||||||
else if (effects & Q2EF_GRENADE)
|
else if (effects & Q2EF_GRENADE)
|
||||||
{
|
{
|
||||||
P_ParticleTrail(cent->lerp_origin, ent.origin, rt_grenade, ¢->trailstate);
|
if (P_ParticleTrail(cent->lerp_origin, ent.origin, rt_grenade, ¢->trailstate))
|
||||||
|
P_ParticleTrailIndex(cent->lerp_origin, ent.origin, 4, 8, ¢->trailstate);
|
||||||
}
|
}
|
||||||
else if (effects & Q2EF_FLIES)
|
else if (effects & Q2EF_FLIES)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2208,7 +2208,10 @@ static void PF_cl_te_explosion (progfuncs_t *prinst, struct globalvars_s *pr_glo
|
||||||
dl->channelfade[2] = 0.12;
|
dl->channelfade[2] = 0.12;
|
||||||
}
|
}
|
||||||
|
|
||||||
P_ParticleExplosion(pos);
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_explosion))
|
||||||
|
P_RunParticleEffect(pos, NULL, 107, 1024); // should be 97-111
|
||||||
|
|
||||||
|
R_AddStain(pos, -1, -1, -1, 100);
|
||||||
|
|
||||||
S_StartSound (-2, 0, cl_sfx_r_exp3, pos, 1, 1);
|
S_StartSound (-2, 0, cl_sfx_r_exp3, pos, 1, 1);
|
||||||
}
|
}
|
||||||
|
@ -2273,9 +2276,10 @@ static void PF_cl_te_explosionquad (progfuncs_t *prinst, struct globalvars_s *pr
|
||||||
{
|
{
|
||||||
float *pos = G_VECTOR(OFS_PARM0);
|
float *pos = G_VECTOR(OFS_PARM0);
|
||||||
if (P_RunParticleEffectTypeString(pos, vec3_origin, 1, "te_explosionquad"))
|
if (P_RunParticleEffectTypeString(pos, vec3_origin, 1, "te_explosionquad"))
|
||||||
{
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_explosion))
|
||||||
P_ParticleExplosion(pos);
|
P_RunParticleEffect(pos, NULL, 107, 1024); // should be 97-111
|
||||||
}
|
|
||||||
|
R_AddStain(pos, -1, -1, -1, 100);
|
||||||
|
|
||||||
// light
|
// light
|
||||||
if (r_explosionlight.value) {
|
if (r_explosionlight.value) {
|
||||||
|
@ -2384,7 +2388,10 @@ static void PF_cl_te_explosionrgb (progfuncs_t *prinst, struct globalvars_s *pr_
|
||||||
|
|
||||||
dlight_t *dl;
|
dlight_t *dl;
|
||||||
|
|
||||||
P_ParticleExplosion (org);
|
if (P_RunParticleEffectType(org, NULL, 1, pt_explosion))
|
||||||
|
P_RunParticleEffect(org, NULL, 107, 1024); // should be 97-111
|
||||||
|
|
||||||
|
R_AddStain(org, -1, -1, -1, 100);
|
||||||
|
|
||||||
// light
|
// light
|
||||||
if (r_explosionlight.value)
|
if (r_explosionlight.value)
|
||||||
|
|
|
@ -60,7 +60,8 @@ int pt_explosion,
|
||||||
|
|
||||||
int pe_default,
|
int pe_default,
|
||||||
pe_size2,
|
pe_size2,
|
||||||
pe_size3;
|
pe_size3,
|
||||||
|
pe_defaulttrail;
|
||||||
|
|
||||||
int rt_blastertrail,
|
int rt_blastertrail,
|
||||||
rt_railtrail,
|
rt_railtrail,
|
||||||
|
@ -1022,6 +1023,7 @@ void P_AssosiateTrail_f (void)
|
||||||
|
|
||||||
void P_DefaultTrail (model_t *model)
|
void P_DefaultTrail (model_t *model)
|
||||||
{
|
{
|
||||||
|
// TODO: EF_BRIGHTFIELD should probably be handled in here somewhere
|
||||||
if (model->engineflags & MDLF_NODEFAULTTRAIL)
|
if (model->engineflags & MDLF_NODEFAULTTRAIL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1280,6 +1282,7 @@ void P_InitParticles (void)
|
||||||
pe_default = P_AllocateParticleType("pe_default");
|
pe_default = P_AllocateParticleType("pe_default");
|
||||||
pe_size2 = P_AllocateParticleType("pe_size2");
|
pe_size2 = P_AllocateParticleType("pe_size2");
|
||||||
pe_size3 = P_AllocateParticleType("pe_size3");
|
pe_size3 = P_AllocateParticleType("pe_size3");
|
||||||
|
pe_defaulttrail = P_AllocateParticleType("pe_defaulttrail");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1807,12 +1810,6 @@ static trailstate_t *P_NewTrailstate(trailstate_t **key)
|
||||||
return ts;
|
return ts;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
===============
|
|
||||||
R_EntityParticles
|
|
||||||
===============
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define NUMVERTEXNORMALS 162
|
#define NUMVERTEXNORMALS 162
|
||||||
float r_avertexnormals[NUMVERTEXNORMALS][3] = {
|
float r_avertexnormals[NUMVERTEXNORMALS][3] = {
|
||||||
#include "anorms.h"
|
#include "anorms.h"
|
||||||
|
@ -1823,105 +1820,6 @@ vec2_t avelocities[NUMVERTEXNORMALS];
|
||||||
// float partstep = 0.01;
|
// float partstep = 0.01;
|
||||||
// float timescale = 0.01;
|
// float timescale = 0.01;
|
||||||
|
|
||||||
void P_EntityParticles (float *org, qbyte colour, float *radius)
|
|
||||||
{
|
|
||||||
part_type[pt_entityparticles].areaspread = radius[0]*0.5 + radius[1]*0.5;
|
|
||||||
part_type[pt_entityparticles].areaspreadvert = radius[2];
|
|
||||||
part_type[pt_entityparticles].colorindex = colour;
|
|
||||||
|
|
||||||
P_RunParticleEffectType(org, NULL, 1, pt_entityparticles);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
===============
|
|
||||||
R_ParticleExplosion
|
|
||||||
|
|
||||||
===============
|
|
||||||
*/
|
|
||||||
void P_ParticleExplosion (vec3_t org)
|
|
||||||
{
|
|
||||||
// int i, j;
|
|
||||||
// particle_t *p;
|
|
||||||
|
|
||||||
P_RunParticleEffectType(org, NULL, 1, pt_explosion);
|
|
||||||
|
|
||||||
R_AddStain(org, -1, -1, -1, 100);
|
|
||||||
/*
|
|
||||||
for (i=0 ; i<r_particles_in_explosion.value ; i++)
|
|
||||||
{
|
|
||||||
if (!free_particles)
|
|
||||||
return;
|
|
||||||
if ((rand()&3)==3)
|
|
||||||
{
|
|
||||||
p = free_particles;
|
|
||||||
free_particles = p->next;
|
|
||||||
p->next = active_sparks;
|
|
||||||
active_sparks = p;
|
|
||||||
|
|
||||||
p->scale = 1;
|
|
||||||
p->alpha = 0.8 + (rand()&15)/(15.0*5);
|
|
||||||
p->die = particletime + 7;
|
|
||||||
p->color = ramp1[0];
|
|
||||||
p->ramp = rand()&3;
|
|
||||||
if (i & 1)
|
|
||||||
{
|
|
||||||
p->type = st_shrapnal;
|
|
||||||
for (j=0 ; j<3 ; j++)
|
|
||||||
{
|
|
||||||
p->org[j] = org[j];// + ((rand()%32)-16);
|
|
||||||
p->vel[j] = ((rand()%512)-256)*r_particle_explosion_speed.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
p->type = pt_grav;
|
|
||||||
for (j=0 ; j<3 ; j++)
|
|
||||||
{
|
|
||||||
p->org[j] = org[j];// + ((rand()%32)-16);
|
|
||||||
p->vel[j] = ((rand()%512)-256)*r_particle_explosion_speed.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
p = free_particles;
|
|
||||||
free_particles = p->next;
|
|
||||||
p->next = active_sparks;
|
|
||||||
active_sparks = p;
|
|
||||||
|
|
||||||
p->scale = 1;
|
|
||||||
p->alpha = 0.8;
|
|
||||||
p->die = particletime + 7;
|
|
||||||
p->color = ramp1[0];
|
|
||||||
p->ramp = rand()&3;
|
|
||||||
if (i & 1)
|
|
||||||
{
|
|
||||||
p->type = st_shrapnal;
|
|
||||||
for (j=0 ; j<3 ; j++)
|
|
||||||
{
|
|
||||||
p->org[j] = org[j];// + ((rand()%32)-16);
|
|
||||||
p->vel[j] = ((rand()%512)-256)*r_particle_explosion_speed.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
p->type = st_shrapnal;
|
|
||||||
for (j=0 ; j<3 ; j++)
|
|
||||||
{
|
|
||||||
p->org[j] = org[j];// + ((rand()%32)-16);
|
|
||||||
p->vel[j] = ((rand()%512)-256)*r_particle_explosion_speed.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
===============
|
|
||||||
R_BlobExplosion
|
|
||||||
|
|
||||||
===============
|
|
||||||
*/
|
|
||||||
int Q1BSP_ClipDecal(vec3_t center, vec3_t normal, vec3_t tangent, vec3_t tangent2, float size, float **out);
|
int Q1BSP_ClipDecal(vec3_t center, vec3_t normal, vec3_t tangent, vec3_t tangent2, float size, float **out);
|
||||||
int P_RunParticleEffectState (vec3_t org, vec3_t dir, float count, int typenum, trailstate_t **tsk)
|
int P_RunParticleEffectState (vec3_t org, vec3_t dir, float count, int typenum, trailstate_t **tsk)
|
||||||
{
|
{
|
||||||
|
@ -2329,6 +2227,30 @@ int P_RunParticleEffectState (vec3_t org, vec3_t dir, float count, int typenum,
|
||||||
m += 0.1762891; // some BS number to try to "randomize" things
|
m += 0.1762891; // some BS number to try to "randomize" things
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SM_DISTBALL:
|
||||||
|
{
|
||||||
|
float rdist;
|
||||||
|
|
||||||
|
rdist = ptype->spawnparam2 - crandom()*(1-(crandom() * ptype->spawnparam1));
|
||||||
|
|
||||||
|
// this is a strange spawntype, which is based on the fact that
|
||||||
|
// crandom()*crandom() provides something similar to an exponential
|
||||||
|
// probability curve
|
||||||
|
ofsvec[0] = hrandom();
|
||||||
|
ofsvec[1] = hrandom();
|
||||||
|
if (ptype->areaspreadvert)
|
||||||
|
ofsvec[2] = hrandom();
|
||||||
|
else
|
||||||
|
ofsvec[2] = 0;
|
||||||
|
|
||||||
|
VectorNormalize(ofsvec);
|
||||||
|
VectorScale(ofsvec, rdist, ofsvec);
|
||||||
|
|
||||||
|
arsvec[0] = ofsvec[0]*ptype->areaspread;
|
||||||
|
arsvec[1] = ofsvec[1]*ptype->areaspread;
|
||||||
|
arsvec[2] = ofsvec[2]*ptype->areaspreadvert;
|
||||||
|
}
|
||||||
|
break;
|
||||||
default: // SM_BALL, SM_CIRCLE
|
default: // SM_BALL, SM_CIRCLE
|
||||||
ofsvec[0] = hrandom();
|
ofsvec[0] = hrandom();
|
||||||
ofsvec[1] = hrandom();
|
ofsvec[1] = hrandom();
|
||||||
|
@ -2458,7 +2380,7 @@ void P_EmitEffect (vec3_t pos, int type, trailstate_t **tsk)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
===============
|
||||||
R_RunParticleEffect
|
P_RunParticleEffect
|
||||||
|
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
|
@ -2529,7 +2451,7 @@ void P_RunParticleEffect2 (vec3_t org, vec3_t dmin, vec3_t dmax, int color, int
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
===============
|
||||||
R_RunParticleEffect3
|
P_RunParticleEffect3
|
||||||
|
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
|
@ -2571,7 +2493,7 @@ void P_RunParticleEffect3 (vec3_t org, vec3_t box, int color, int effect, int co
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
===============
|
||||||
R_RunParticleEffect4
|
P_RunParticleEffect4
|
||||||
|
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
|
@ -2689,23 +2611,7 @@ void P_LavaSplash (vec3_t org)
|
||||||
P_RunParticleEffectType(org, NULL, 1, pt_lavasplash);
|
P_RunParticleEffectType(org, NULL, 1, pt_lavasplash);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
static void P_ParticleTrailDraw (vec3_t startpos, vec3_t end, part_type_t *ptype, trailstate_t **tsk)
|
||||||
===============
|
|
||||||
R_TeleportSplash
|
|
||||||
|
|
||||||
===============
|
|
||||||
*/
|
|
||||||
void CLQ2_BlasterTrail (vec3_t start, vec3_t end)
|
|
||||||
{
|
|
||||||
P_ParticleTrail(start, end, rt_blastertrail, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CLQ2_RailTrail (vec3_t start, vec3_t end)
|
|
||||||
{
|
|
||||||
P_ParticleTrail(start, end, rt_railtrail, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int P_ParticleTrailDraw (vec3_t startpos, vec3_t end, part_type_t *ptype, trailstate_t **tsk)
|
|
||||||
{
|
{
|
||||||
vec3_t vec, vstep, right, up, start;
|
vec3_t vec, vstep, right, up, start;
|
||||||
float len;
|
float len;
|
||||||
|
@ -2763,7 +2669,7 @@ static int P_ParticleTrailDraw (vec3_t startpos, vec3_t end, part_type_t *ptype,
|
||||||
if (ptype->spawntime && ts)
|
if (ptype->spawntime && ts)
|
||||||
{
|
{
|
||||||
if (ts->statetime > particletime)
|
if (ts->statetime > particletime)
|
||||||
return 0; // timelimit still in effect
|
return; // timelimit still in effect
|
||||||
|
|
||||||
ts->statetime = particletime + ptype->spawntime; // record old time
|
ts->statetime = particletime + ptype->spawntime; // record old time
|
||||||
ts = NULL; // clear trailstate so we don't save length/lastseg
|
ts = NULL; // clear trailstate so we don't save length/lastseg
|
||||||
|
@ -2771,7 +2677,7 @@ static int P_ParticleTrailDraw (vec3_t startpos, vec3_t end, part_type_t *ptype,
|
||||||
|
|
||||||
// random chance for trails
|
// random chance for trails
|
||||||
if (ptype->spawnchance < frandom())
|
if (ptype->spawnchance < frandom())
|
||||||
return 0; // don't spawn but return success
|
return; // don't spawn but return success
|
||||||
|
|
||||||
if (!ptype->die)
|
if (!ptype->die)
|
||||||
ts = NULL;
|
ts = NULL;
|
||||||
|
@ -3096,7 +3002,7 @@ static int P_ParticleTrailDraw (vec3_t startpos, vec3_t end, part_type_t *ptype,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int P_ParticleTrail (vec3_t startpos, vec3_t end, int type, trailstate_t **tsk)
|
int P_ParticleTrail (vec3_t startpos, vec3_t end, int type, trailstate_t **tsk)
|
||||||
|
@ -3119,12 +3025,15 @@ int P_ParticleTrail (vec3_t startpos, vec3_t end, int type, trailstate_t **tsk)
|
||||||
ptype = &part_type[ptype->inwater];
|
ptype = &part_type[ptype->inwater];
|
||||||
}
|
}
|
||||||
|
|
||||||
return P_ParticleTrailDraw (startpos, end, ptype, tsk);
|
P_ParticleTrailDraw (startpos, end, ptype, tsk);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLQ2_BubbleTrail (vec3_t start, vec3_t end)
|
void P_ParticleTrailIndex (vec3_t start, vec3_t end, int color, int crnd, trailstate_t **tsk)
|
||||||
{
|
{
|
||||||
P_ParticleTrail(start, end, rt_bubbletrail, NULL);
|
part_type[pe_defaulttrail].colorindex = color;
|
||||||
|
part_type[pe_defaulttrail].colorrand = crnd;
|
||||||
|
P_ParticleTrail(start, end, pe_defaulttrail, tsk);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Q2BSPS
|
#ifdef Q2BSPS
|
||||||
|
|
|
@ -309,8 +309,6 @@ void Media_RecordFrame (void);
|
||||||
void R_SetRenderer(int wanted);
|
void R_SetRenderer(int wanted);
|
||||||
void RQ_Init(void);
|
void RQ_Init(void);
|
||||||
|
|
||||||
void CLQ2_RailTrail (vec3_t start, vec3_t end);
|
|
||||||
void CLQ2_BubbleTrail (vec3_t start, vec3_t end);
|
|
||||||
void CLQ2_EntityEvent(entity_state_t *es);
|
void CLQ2_EntityEvent(entity_state_t *es);
|
||||||
void CLQ2_TeleporterParticles(entity_state_t *es);
|
void CLQ2_TeleporterParticles(entity_state_t *es);
|
||||||
void CLQ2_IonripperTrail(vec3_t oldorg, vec3_t neworg);
|
void CLQ2_IonripperTrail(vec3_t oldorg, vec3_t neworg);
|
||||||
|
|
|
@ -20,7 +20,8 @@ extern int pt_explosion,
|
||||||
pt_flame,
|
pt_flame,
|
||||||
pt_bullet,
|
pt_bullet,
|
||||||
pt_superbullet,
|
pt_superbullet,
|
||||||
pe_default;
|
pe_default,
|
||||||
|
pe_defaulttrail;
|
||||||
|
|
||||||
extern int rt_blastertrail,
|
extern int rt_blastertrail,
|
||||||
rt_railtrail,
|
rt_railtrail,
|
||||||
|
@ -157,18 +158,17 @@ void P_RunParticleEffect3 (vec3_t org, vec3_t box, int color, int effect, int co
|
||||||
void P_RunParticleEffect4 (vec3_t org, float radius, int color, int effect, int count);
|
void P_RunParticleEffect4 (vec3_t org, float radius, int color, int effect, int count);
|
||||||
|
|
||||||
void P_DarkFieldParticles (float *org, qbyte colour);
|
void P_DarkFieldParticles (float *org, qbyte colour);
|
||||||
void P_EntityParticles (float *org, qbyte colour, float *radius); //nq's EF_BRIGHTFIELD
|
|
||||||
void P_EmitEffect (vec3_t pos, int type, trailstate_t **tsk); //particles centered around a model, called every frame for those models.
|
void P_EmitEffect (vec3_t pos, int type, trailstate_t **tsk); //particles centered around a model, called every frame for those models.
|
||||||
|
|
||||||
//functions that spawn point effects (basically just pass throughs)
|
//functions that spawn point effects (basically just pass throughs)
|
||||||
void P_BlobExplosion (vec3_t org); //tarbaby explosion or TF emp.
|
void P_BlobExplosion (vec3_t org); //tarbaby explosion or TF emp.
|
||||||
void P_ParticleExplosion (vec3_t org); //rocket explosion (sprite is allocated seperatly :( )
|
|
||||||
void P_LavaSplash (vec3_t org); //cthon dying, or a gas grenade.
|
void P_LavaSplash (vec3_t org); //cthon dying, or a gas grenade.
|
||||||
void P_RunParticleCube(vec3_t minb, vec3_t maxb, vec3_t dir, float count, int colour, qboolean gravity, float jitter);
|
void P_RunParticleCube(vec3_t minb, vec3_t maxb, vec3_t dir, float count, int colour, qboolean gravity, float jitter);
|
||||||
void P_RunParticleWeather(vec3_t minb, vec3_t maxb, vec3_t dir, float count, int colour, char *efname);
|
void P_RunParticleWeather(vec3_t minb, vec3_t maxb, vec3_t dir, float count, int colour, char *efname);
|
||||||
|
|
||||||
//the core spawn function for trails. (trailstate can be null)
|
//the core spawn function for trails. (trailstate can be null)
|
||||||
int P_ParticleTrail (vec3_t start, vec3_t end, int type, trailstate_t **trailstate);
|
int P_ParticleTrail (vec3_t start, vec3_t end, int type, trailstate_t **trailstate);
|
||||||
|
void P_ParticleTrailIndex (vec3_t start, vec3_t end, int color, int rndcolor, trailstate_t **trailstate);
|
||||||
|
|
||||||
void P_DefaultTrail (struct model_s *model); //fills in the default particle properties for a loaded model. Should already have the model flags set.
|
void P_DefaultTrail (struct model_s *model); //fills in the default particle properties for a loaded model. Should already have the model flags set.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue