]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_main.c
clarify a comment
[xonotic/darkplaces.git] / cl_main.c
index 6f8df54f3b942e9d59c4215e107a2ed5d15d4a31..180a90d5994e4f0185a1f8c8e1513f02d7a7d4b5 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -509,6 +509,8 @@ static void CL_ModelIndexList_f(void)
        for (i = -MAX_MODELS;i < MAX_MODELS;i++)
        {
                model = CL_GetModelByIndex(i);
+               if (!model)
+                       continue;
                if(model->loaded || i == 1)
                        Con_Printf("%3i: %-30s %-8s %-10i\n", i, model->name, model->modeldatatypestring, model->surfmesh.num_triangles);
                else
@@ -550,7 +552,7 @@ void CL_UpdateRenderEntity(entity_render_t *ent)
        // update the inverse matrix for the renderer
        Matrix4x4_Invert_Simple(&ent->inversematrix, &ent->matrix);
        // update the animation blend state
-       VM_FrameBlendFromFrameGroupBlend(ent->frameblend, ent->framegroupblend, ent->model);
+       VM_FrameBlendFromFrameGroupBlend(ent->frameblend, ent->framegroupblend, ent->model, cl.time);
        // we need the matrix origin to center the box
        Matrix4x4_OriginFromMatrix(&ent->matrix, org);
        // update entity->render.scale because the renderer needs it
@@ -925,7 +927,7 @@ static void CL_UpdateNetworkEntity(entity_t *e, int recursionlimit, qboolean int
        const matrix4x4_t *matrix;
        matrix4x4_t blendmatrix, tempmatrix, matrix2;
        int frame;
-       float origin[3], angles[3], lerp;
+       vec_t origin[3], angles[3], lerp;
        entity_t *t;
        entity_render_t *r;
        //entity_persistent_t *p = &e->persistent;
@@ -1172,6 +1174,8 @@ static void CL_UpdateNetworkEntity(entity_t *e, int recursionlimit, qboolean int
                e->render.flags |= RENDER_ADDITIVE;
        if (e->render.effects & EF_DOUBLESIDED)
                e->render.flags |= RENDER_DOUBLESIDED;
+       if (e->render.effects & EF_DYNAMICMODELLIGHT)
+               e->render.flags |= RENDER_DYNAMICMODELLIGHT;
 
        // make the other useful stuff
        e->render.allowdecals = true;
@@ -1257,7 +1261,8 @@ static void CL_UpdateNetworkEntityTrail(entity_t *e)
                if (len > 0)
                        len = 1.0f / len;
                VectorScale(vel, len, vel);
-               CL_ParticleTrail(trailtype, 1, e->persistent.trail_origin, origin, vel, vel, e, e->state_current.glowcolor, false, true, NULL, NULL);
+               // pass time as count so that trails that are time based (such as an emitter) will emit properly as long as they don't use trailspacing
+               CL_ParticleTrail(trailtype, bound(0, cl.time - cl.oldtime, 0.1), e->persistent.trail_origin, origin, vel, vel, e, e->state_current.glowcolor, false, true, NULL, NULL);
        }
        // now that the entity has survived one trail update it is allowed to
        // leave a real trail on later frames
@@ -1515,7 +1520,7 @@ static void CL_LinkNetworkEntity(entity_t *e)
        if ((e->state_current.lightpflags & PFLAGS_FULLDYNAMIC) && r_refdef.scene.numlights < MAX_DLIGHTS)
        {
                matrix4x4_t dlightmatrix;
-               float light[4];
+               vec4_t light;
                VectorScale(e->state_current.light, (1.0f / 256.0f), light);
                light[3] = e->state_current.light[3];
                if (light[0] == 0 && light[1] == 0 && light[2] == 0)
@@ -1595,7 +1600,7 @@ static void CL_RelinkStaticEntities(void)
                        e->render.flags |= RENDER_SHADOW;
                VectorSet(e->render.colormod, 1, 1, 1);
                VectorSet(e->render.glowmod, 1, 1, 1);
-               VM_FrameBlendFromFrameGroupBlend(e->render.frameblend, e->render.framegroupblend, e->render.model);
+               VM_FrameBlendFromFrameGroupBlend(e->render.frameblend, e->render.framegroupblend, e->render.model, cl.time);
                e->render.allowdecals = true;
                CL_UpdateRenderEntity(&e->render);
                r_refdef.scene.entities[r_refdef.scene.numentities++] = &e->render;
@@ -2485,6 +2490,3 @@ void CL_Init (void)
 
        CL_Video_Init();
 }
-
-
-