[client] Pass time into locs_draw

This avoids unnecessary access to r_data.
This commit is contained in:
Bill Currie 2022-02-28 16:57:43 +09:00
parent 2477a44d15
commit ca9e8a3b68
3 changed files with 6 additions and 6 deletions

View file

@ -47,6 +47,6 @@ int locs_nearest (vec4f_t loc) __attribute__((pure));
void locs_reset (void);
void locs_save (const char *filename, qboolean gz);
void map_to_loc (const char *mapname, char *filename);
void locs_draw (vec4f_t simorg);
void locs_draw (double time, vec4f_t simorg);
#endif//__QF_locs_h

View file

@ -287,7 +287,7 @@ map_to_loc (const char *mapname, char *filename)
}
void
locs_draw (vec4f_t simorg)
locs_draw (double time, vec4f_t simorg)
{
//FIXME custom ent rendering code would be nice
dlight_t *dl;
@ -302,7 +302,7 @@ locs_draw (vec4f_t simorg)
if (dl) {
VectorCopy (nearloc->loc, dl->origin);
dl->radius = 200;
dl->die = r_data->realtime + 0.1;
dl->die = time + 0.1;
dl->color[0] = 0;
dl->color[1] = 1;
dl->color[2] = 0;
@ -310,11 +310,11 @@ locs_draw (vec4f_t simorg)
}
trueloc = nearloc->loc;
clp_funcs->Particle_New (pt_smokecloud, part_tex_smoke, trueloc, 2.0,
zero, r_data->realtime + 9.0, 254,
zero, time + 9.0, 254,
0.25 + qfrandom (0.125), 0.0);
for (i = 0; i < 15; i++)
clp_funcs->Particle_NewRandom (pt_fallfade, part_tex_dot, trueloc,
12, 0.7, 96, r_data->realtime + 5.0,
12, 0.7, 96, time + 5.0,
104 + (rand () & 7), 1.0, 0.0);
}
}

View file

@ -523,7 +523,7 @@ CL_EmitEntities (void)
CL_LinkPacketEntities ();
CL_UpdateTEnts (cl.time, &tentCtx);
if (cl_draw_locs->int_val) {
locs_draw (cl.viewstate.origin);
locs_draw (cl.time, cl.viewstate.origin);
}
}