]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_tent.c
put parentheses around parameters to min/max/bound macros
[xonotic/darkplaces.git] / cl_tent.c
index 1cdc8e049a7bc08a37728dca26b410197b050d6d..987ff449f4de1cb45c87d5f987c6689f2644519b 100644 (file)
--- a/cl_tent.c
+++ b/cl_tent.c
@@ -21,8 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "quakedef.h"
 
-cvar_t cl_glowinglightning = {CVAR_SAVE, "cl_glowinglightning", "1"};
-
 int                    num_temp_entities;
 entity_t       cl_temp_entities[MAX_TEMP_ENTITIES];
 beam_t         cl_beams[MAX_BEAMS];
@@ -47,14 +45,13 @@ CL_ParseTEnt
 */
 void CL_InitTEnts (void)
 {
-       Cvar_RegisterVariable(&cl_glowinglightning);
-       cl_sfx_wizhit = S_PrecacheSound ("wizard/hit.wav");
-       cl_sfx_knighthit = S_PrecacheSound ("hknight/hit.wav");
-       cl_sfx_tink1 = S_PrecacheSound ("weapons/tink1.wav");
-       cl_sfx_ric1 = S_PrecacheSound ("weapons/ric1.wav");
-       cl_sfx_ric2 = S_PrecacheSound ("weapons/ric2.wav");
-       cl_sfx_ric3 = S_PrecacheSound ("weapons/ric3.wav");
-       cl_sfx_r_exp3 = S_PrecacheSound ("weapons/r_exp3.wav");
+       cl_sfx_wizhit = S_PrecacheSound ("wizard/hit.wav", false);
+       cl_sfx_knighthit = S_PrecacheSound ("hknight/hit.wav", false);
+       cl_sfx_tink1 = S_PrecacheSound ("weapons/tink1.wav", false);
+       cl_sfx_ric1 = S_PrecacheSound ("weapons/ric1.wav", false);
+       cl_sfx_ric2 = S_PrecacheSound ("weapons/ric2.wav", false);
+       cl_sfx_ric3 = S_PrecacheSound ("weapons/ric3.wav", false);
+       cl_sfx_r_exp3 = S_PrecacheSound ("weapons/r_exp3.wav", false);
 }
 
 /*
@@ -117,28 +114,30 @@ void CL_ParseTEnt (void)
        int             rnd;
        int             colorStart, colorLength, count;
        float   velspeed, radius;
-       byte *tempcolor;
+       qbyte *tempcolor;
 
        type = MSG_ReadByte ();
        switch (type)
        {
        case TE_WIZSPIKE:                       // spike hitting wall
                MSG_ReadVector(pos);
+               Mod_FindNonSolidLocation(pos, cl.worldmodel);
                CL_RunParticleEffect (pos, vec3_origin, 20, 30);
                S_StartSound (-1, 0, cl_sfx_wizhit, pos, 1, 1);
                break;
-               
+
        case TE_KNIGHTSPIKE:                    // spike hitting wall
                MSG_ReadVector(pos);
+               Mod_FindNonSolidLocation(pos, cl.worldmodel);
                CL_RunParticleEffect (pos, vec3_origin, 226, 20);
                S_StartSound (-1, 0, cl_sfx_knighthit, pos, 1, 1);
                break;
-               
+
        case TE_SPIKE:                  // spike hitting wall
                MSG_ReadVector(pos);
+               Mod_FindNonSolidLocation(pos, cl.worldmodel);
                // LordHavoc: changed to spark shower
                CL_SparkShower(pos, vec3_origin, 15);
-               //CL_RunParticleEffect (pos, vec3_origin, 0, 10);
                if ( rand() % 5 )
                        S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
                else
@@ -154,9 +153,9 @@ void CL_ParseTEnt (void)
                break;
        case TE_SPIKEQUAD:                      // quad spike hitting wall
                MSG_ReadVector(pos);
+               Mod_FindNonSolidLocation(pos, cl.worldmodel);
                // LordHavoc: changed to spark shower
                CL_SparkShower(pos, vec3_origin, 15);
-               //CL_RunParticleEffect (pos, vec3_origin, 0, 10);
                CL_AllocDlight (NULL, pos, 200, 0.1f, 0.1f, 1.0f, 1000, 0.2);
                S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
                if ( rand() % 5 )
@@ -174,9 +173,9 @@ void CL_ParseTEnt (void)
                break;
        case TE_SUPERSPIKE:                     // super spike hitting wall
                MSG_ReadVector(pos);
+               Mod_FindNonSolidLocation(pos, cl.worldmodel);
                // LordHavoc: changed to dust shower
                CL_SparkShower(pos, vec3_origin, 30);
-               //CL_RunParticleEffect (pos, vec3_origin, 0, 20);
                if ( rand() % 5 )
                        S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
                else
@@ -192,9 +191,9 @@ void CL_ParseTEnt (void)
                break;
        case TE_SUPERSPIKEQUAD:                 // quad super spike hitting wall
                MSG_ReadVector(pos);
+               Mod_FindNonSolidLocation(pos, cl.worldmodel);
                // LordHavoc: changed to dust shower
                CL_SparkShower(pos, vec3_origin, 30);
-               //CL_RunParticleEffect (pos, vec3_origin, 0, 20);
                CL_AllocDlight (NULL, pos, 200, 0.1f, 0.1f, 1.0f, 1000, 0.2);
                if ( rand() % 5 )
                        S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
@@ -228,8 +227,15 @@ void CL_ParseTEnt (void)
                dir[1] = MSG_ReadChar ();
                dir[2] = MSG_ReadChar ();
                count = MSG_ReadByte (); // amount of particles
+               Mod_FindNonSolidLocation(pos, cl.worldmodel);
                CL_SparkShower(pos, dir, count);
                break;
+       case TE_PLASMABURN:
+               MSG_ReadVector(pos);
+               Mod_FindNonSolidLocation(pos, cl.worldmodel);
+               CL_AllocDlight (NULL, pos, 200, 1, 1, 1, 1000, 0.2);
+               CL_PlasmaBurn(pos);
+               break;
                // LordHavoc: added for improved gore
        case TE_BLOODSHOWER:    // vaporized body
                MSG_ReadVector(pos); // mins
@@ -269,13 +275,14 @@ void CL_ParseTEnt (void)
 
        case TE_GUNSHOT:                        // bullet hitting wall
                MSG_ReadVector(pos);
+               Mod_FindNonSolidLocation(pos, cl.worldmodel);
                // LordHavoc: changed to dust shower
                CL_SparkShower(pos, vec3_origin, 15);
-               //CL_RunParticleEffect (pos, vec3_origin, 0, 20);
                break;
 
        case TE_GUNSHOTQUAD:                    // quad bullet hitting wall
                MSG_ReadVector(pos);
+               Mod_FindNonSolidLocation(pos, cl.worldmodel);
                CL_SparkShower(pos, vec3_origin, 15);
                CL_AllocDlight (NULL, pos, 200, 0.1f, 0.1f, 1.0f, 1000, 0.2);
                break;
@@ -284,8 +291,8 @@ void CL_ParseTEnt (void)
                MSG_ReadVector(pos);
                Mod_FindNonSolidLocation(pos, cl.worldmodel);
                CL_ParticleExplosion (pos, false);
-//             CL_BlastParticles (pos, 120, 120);
-               CL_AllocDlight (NULL, pos, 350, 1.0f, 0.8f, 0.4f, 700, 0.5);
+               // LordHavoc: boosted color from 1.0, 0.8, 0.4 to 1.25, 1.0, 0.5
+               CL_AllocDlight (NULL, pos, 350, 1.25f, 1.0f, 0.5f, 700, 0.5);
                S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
                break;
 
@@ -293,26 +300,14 @@ void CL_ParseTEnt (void)
                MSG_ReadVector(pos);
                Mod_FindNonSolidLocation(pos, cl.worldmodel);
                CL_ParticleExplosion (pos, false);
-//             CL_BlastParticles (pos, 120, 480);
                CL_AllocDlight (NULL, pos, 600, 0.5f, 0.4f, 1.0f, 1200, 0.5);
                S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
                break;
 
-               /*
-       case TE_SMOKEEXPLOSION:                 // rocket explosion with a cloud of smoke
-               MSG_ReadVector(pos);
-               Mod_FindNonSolidLocation(pos, cl.worldmodel);
-               CL_ParticleExplosion (pos, true);
-               CL_AllocDlight (NULL, pos, 350, 1.0f, 0.8f, 0.4f, 700, 0.5);
-               S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
-               break;
-               */
-
        case TE_EXPLOSION3:                             // Nehahra movie colored lighting explosion
                MSG_ReadVector(pos);
                Mod_FindNonSolidLocation(pos, cl.worldmodel);
                CL_ParticleExplosion (pos, false);
-//             CL_BlastParticles (pos, 120, 120);
                CL_AllocDlight (NULL, pos, 350, MSG_ReadCoord(), MSG_ReadCoord(), MSG_ReadCoord(), 700, 0.5);
                S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
                break;
@@ -321,7 +316,6 @@ void CL_ParseTEnt (void)
                MSG_ReadVector(pos);
                Mod_FindNonSolidLocation(pos, cl.worldmodel);
                CL_ParticleExplosion (pos, false);
-//             CL_BlastParticles (pos, 120, 120);
                color[0] = MSG_ReadByte() * (1.0 / 255.0);
                color[1] = MSG_ReadByte() * (1.0 / 255.0);
                color[2] = MSG_ReadByte() * (1.0 / 255.0);
@@ -333,7 +327,6 @@ void CL_ParseTEnt (void)
                MSG_ReadVector(pos);
                Mod_FindNonSolidLocation(pos, cl.worldmodel);
                CL_BlobExplosion (pos);
-//             CL_BlastParticles (pos, 120, 120);
 
                S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
                CL_AllocDlight (NULL, pos, 600, 0.8f, 0.4f, 1.0f, 1200, 0.5);
@@ -395,32 +388,32 @@ void CL_ParseTEnt (void)
                CL_ParseBeam (Mod_ForName(MSG_ReadString(), true, false, false));
                break;
 
-       case TE_LAVASPLASH:     
+       case TE_LAVASPLASH:
                pos[0] = MSG_ReadCoord ();
                pos[1] = MSG_ReadCoord ();
                pos[2] = MSG_ReadCoord ();
                CL_LavaSplash (pos);
                break;
-       
+
        case TE_TELEPORT:
                pos[0] = MSG_ReadCoord ();
                pos[1] = MSG_ReadCoord ();
                pos[2] = MSG_ReadCoord ();
-               CL_TeleportSplash (pos);
+               CL_AllocDlight (NULL, pos, 1000, 1.25f, 1.25f, 1.25f, 3000, 99.0f);
+//             CL_TeleportSplash (pos);
                break;
-               
+
        case TE_EXPLOSION2:                             // color mapped explosion
                MSG_ReadVector(pos);
                Mod_FindNonSolidLocation(pos, cl.worldmodel);
                colorStart = MSG_ReadByte ();
                colorLength = MSG_ReadByte ();
                CL_ParticleExplosion2 (pos, colorStart, colorLength);
-//             CL_BlastParticles (pos, 80, 80);
-               tempcolor = (byte *)&d_8to24table[(rand()%colorLength) + colorStart];
+               tempcolor = (qbyte *)&d_8to24table[(rand()%colorLength) + colorStart];
                CL_AllocDlight (NULL, pos, 350, tempcolor[0] * (1.0f / 255.0f), tempcolor[1] * (1.0f / 255.0f), tempcolor[2] * (1.0f / 255.0f), 700, 0.5);
                S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
                break;
-               
+
        default:
                Host_Error ("CL_ParseTEnt: bad type %d", type);
        }
@@ -515,10 +508,6 @@ void CL_UpdateTEnts (void)
                        ent->render.angles[0] = pitch;
                        ent->render.angles[1] = yaw;
                        ent->render.angles[2] = rand()%360;
-
-                       if (cl_glowinglightning.value > 0)
-                               CL_AllocDlight(&ent->render, ent->render.origin, lhrandom(200, 240), cl_glowinglightning.value * 0.25f, cl_glowinglightning.value * 0.25f, cl_glowinglightning.value * 0.25f, 0, 0);
-
                        VectorMA(org, 30, dist, org);
                        d -= 30;
                }
@@ -526,4 +515,3 @@ void CL_UpdateTEnts (void)
 
 }
 
-