From dc5809c208c5caf54601a242dbd340a44c368986 Mon Sep 17 00:00:00 2001 From: TimeServ Date: Sun, 13 Mar 2005 21:00:26 +0000 Subject: [PATCH] tent stuff i forgot to merge a long time ago git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@897 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_tent.c | 68 +++++++++++++++++++++++++++++------------ 1 file changed, 49 insertions(+), 19 deletions(-) diff --git a/engine/client/cl_tent.c b/engine/client/cl_tent.c index c303e409c..9103729aa 100644 --- a/engine/client/cl_tent.c +++ b/engine/client/cl_tent.c @@ -830,6 +830,16 @@ void CL_ParseTEnt (void) pos[0] = MSG_ReadCoord (); pos[1] = MSG_ReadCoord (); pos[2] = MSG_ReadCoord (); + + // light + dl = CL_AllocDlight (0); + VectorCopy (pos, dl->origin); + dl->radius = 200; + dl->decay = 1000; + dl->die = cl.time + 0.2; + dl->color[0] = 0.4; + dl->color[1] = 0.4; + dl->color[2] = 0.4; break; case 73://TE_CUSTOMFLASH @@ -844,34 +854,54 @@ void CL_ParseTEnt (void) pos2[0] = (MSG_ReadByte() + 1) * (1.0 / 256.0); dl->die = cl.time + pos2[0]; dl->decay = dl->radius / pos2[0]; + + // DP's range is 0-2 for lights, FTE is 0-0.4.. 255/637.5 = 0.4 + dl->color[0] = MSG_ReadByte()*(1.0f/637.5f); + dl->color[1] = MSG_ReadByte()*(1.0f/637.5f); + dl->color[2] = MSG_ReadByte()*(1.0f/637.5f); - dl->color[0] = MSG_ReadByte()/255.0f; - dl->color[1] = MSG_ReadByte()/255.0f; - dl->color[2] = MSG_ReadByte()/255.0f; - break; case 74://TE_FLAMEJET -#pragma message("CL_ParseTEnt: effect 74 not implemented (properly)") -pos[0] = MSG_ReadCoord (); -pos[1] = MSG_ReadCoord (); -pos[2] = MSG_ReadCoord (); + // origin + pos[0] = MSG_ReadCoord (); + pos[1] = MSG_ReadCoord (); + pos[2] = MSG_ReadCoord (); -pos2[0] = MSG_ReadCoord (); -pos2[1] = MSG_ReadCoord (); -pos2[2] = MSG_ReadCoord (); -cnt = MSG_ReadByte (); + // velocity + pos2[0] = MSG_ReadCoord (); + pos2[1] = MSG_ReadCoord (); + pos2[2] = MSG_ReadCoord (); -P_ParticleExplosion (pos); + // count + cnt = MSG_ReadByte (); + + rnd = FindParticleType("te_flamejet"); + if (R_RunParticleEffectType(pos, pos2, cnt, rnd)) + R_RunParticleEffect (pos, pos2, 232, cnt); break; - case 75://TE_PLASMABURN -#pragma message("CL_ParseTEnt: effect 75 not implemented (properly)") -pos[0] = MSG_ReadCoord (); -pos[1] = MSG_ReadCoord (); -pos[2] = MSG_ReadCoord (); + case 75://TE_PLASMABURN + // origin + pos[0] = MSG_ReadCoord (); + pos[1] = MSG_ReadCoord (); + pos[2] = MSG_ReadCoord (); -P_ParticleExplosion (pos); + // light + dl = CL_AllocDlight (0); + VectorCopy (pos, dl->origin); + dl->radius = 200; + dl->decay = 1000; + dl->die = cl.time + 0.2; + dl->color[0] = 0.2; + dl->color[1] = 0.2; + dl->color[2] = 0.2; + + // stain (Hopefully this is close to how DP does it) + R_AddStain(pos, -10, -10, -10, 30); + + // TODO: DP also has a decal, should this be simulated or should we just + // use a particle effect and let the user decide what to do with it? break; case 76: