]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_main.c
optimized Mod_BuildBumpVectors slightly
[xonotic/darkplaces.git] / cl_main.c
index 7fcdf257732a8ef007e91b82f93c49bdf6fe2d3c..1006559dc7d24c6ca513e3a05454e0a11969eaad 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -46,7 +46,6 @@ cvar_t freelook = {CVAR_SAVE, "freelook", "1"};
 
 cvar_t r_draweffects = {0, "r_draweffects", "1"};
 
-cvar_t cl_explosions = {CVAR_SAVE, "cl_explosions", "1"};
 cvar_t cl_explosions_alpha_start = {CVAR_SAVE, "cl_explosions_alpha_start", "1.5"};
 cvar_t cl_explosions_alpha_end = {CVAR_SAVE, "cl_explosions_alpha_end", "0"};
 cvar_t cl_explosions_size_start = {CVAR_SAVE, "cl_explosions_size_start", "16"};
@@ -146,9 +145,9 @@ void CL_ClearState(void)
        // LordHavoc: have to set up the baseline info for alpha and other stuff
        for (i = 0;i < cl_max_entities;i++)
        {
-               ClearStateToDefault(&cl_entities[i].state_baseline);
-               ClearStateToDefault(&cl_entities[i].state_previous);
-               ClearStateToDefault(&cl_entities[i].state_current);
+               cl_entities[i].state_baseline = defaultstate;
+               cl_entities[i].state_previous = defaultstate;
+               cl_entities[i].state_current = defaultstate;
        }
 
        CL_CGVM_Clear();
@@ -536,6 +535,7 @@ void CL_LinkNetworkEntity(entity_t *e)
                        // make relative to the entity
                        matrix = &t->render.matrix;
                        // if a valid tagindex is used, make it relative to that tag instead
+                       // FIXME: use a model function to get tag info (need to handle skeletal)
                        if (e->state_current.tagentity && e->state_current.tagindex >= 1 && (model = t->render.model) && e->state_current.tagindex <= t->render.model->alias.aliasnum_tags)
                        {
                                // blend the matrices
@@ -837,9 +837,9 @@ void CL_LinkNetworkEntity(entity_t *e)
                if (e->state_previous.active && e->state_previous.modelindex == e->state_current.modelindex)
                {
                        if (e->render.flags & RENDER_GLOWTRAIL)
-                               CL_RocketTrail2(e->persistent.trail_origin, origin, e->state_current.glowcolor, e);
-                       else if (trailtype >= 0)
-                               CL_RocketTrail(e->persistent.trail_origin, origin, trailtype, e);
+                               trailtype = 9;
+                       if (trailtype >= 0)
+                               CL_RocketTrail(e->persistent.trail_origin, origin, trailtype, e->state_current.glowcolor, e);
                }
                VectorCopy(origin, e->persistent.trail_origin);
                // note: the cl.viewentity and intermission check is to hide player
@@ -904,7 +904,7 @@ static void CL_RelinkNetworkEntities(void)
 
        ent = &cl.viewent;
        ent->state_previous = ent->state_current;
-       ClearStateToDefault(&ent->state_current);
+       ent->state_current = defaultstate;
        ent->state_current.time = cl.time;
        ent->state_current.number = -1;
        ent->state_current.active = true;
@@ -1008,7 +1008,7 @@ void CL_RelinkBeams(void)
                // if coming from the player, update the start position
                //if (b->entity == cl.viewentity)
                //      VectorCopy (cl_entities[cl.viewentity].render.origin, b->start);
-               if (cl_beams_relative.integer && b->entity && cl_entities[b->entity].state_current.active && b->relativestartvalid)
+               if (cl_beams_relative.integer && b->entity == cl.viewentity && b->entity && cl_entities[b->entity].state_current.active && b->relativestartvalid)
                {
                        entity_state_t *p = &cl_entities[b->entity].state_previous;
                        //entity_state_t *c = &cl_entities[b->entity].state_current;
@@ -1319,7 +1319,6 @@ void CL_Init (void)
        Cmd_AddCommand ("pausedemo", CL_PauseDemo_f);
 
        Cvar_RegisterVariable(&r_draweffects);
-       Cvar_RegisterVariable(&cl_explosions);
        Cvar_RegisterVariable(&cl_explosions_alpha_start);
        Cvar_RegisterVariable(&cl_explosions_alpha_end);
        Cvar_RegisterVariable(&cl_explosions_size_start);