From eb35bb76a4704ec05030b29548b2691ca3dee6d5 Mon Sep 17 00:00:00 2001 From: havoc Date: Mon, 30 Sep 2002 01:05:10 +0000 Subject: [PATCH] ent field added back to dlight structures git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2475 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_main.c | 4 ++-- client.h | 4 ++-- r_light.c | 2 +- r_light.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cl_main.c b/cl_main.c index bf38fce5..c483a337 100644 --- a/cl_main.c +++ b/cl_main.c @@ -412,7 +412,7 @@ void CL_AllocDlight (entity_render_t *ent, vec3_t org, float radius, float red, dlightsetup: //Con_Printf("dlight %i : %f %f %f : %f %f %f\n", i, org[0], org[1], org[2], red * radius, green * radius, blue * radius); memset (dl, 0, sizeof(*dl)); - //dl->ent = ent; + dl->ent = ent; VectorCopy(org, dl->origin); dl->radius = radius; dl->color[0] = red; @@ -719,7 +719,7 @@ static void CL_RelinkNetworkEntities() // hack to make glowing player light shine on their gun if (i == cl.viewentity && !chase_active.integer) v[2] += 30; - CL_AllocDlight (NULL, v, 1, dlightcolor[0], dlightcolor[1], dlightcolor[2], 0, 0); + CL_AllocDlight (&ent->render, v, 1, dlightcolor[0], dlightcolor[1], dlightcolor[2], 0, 0); } if (chase_active.integer) diff --git a/client.h b/client.h index 1dd0df3c..a52d83e5 100644 --- a/client.h +++ b/client.h @@ -74,8 +74,8 @@ typedef struct float radius; // drop this each second float decay; - // the entity that spawned this light (can be NULL if it will never be replaced) - //entity_render_t *ent; + // the entity that owns this light (can be NULL) + struct entity_render_s *ent; } dlight_t; diff --git a/r_light.c b/r_light.c index d2ae578d..f0660972 100644 --- a/r_light.c +++ b/r_light.c @@ -132,7 +132,7 @@ void R_BuildLightList(void) rd->cullradius2 = (2048.0f * 2048.0f); rd->cullradius = sqrt(rd->cullradius2); rd->subtract = 1.0f / rd->cullradius2; - //rd->ent = cd->ent; + rd->ent = cd->ent; c_dlights++; // count every dlight in use } } diff --git a/r_light.h b/r_light.h index 6fafe722..0a3b5d8e 100644 --- a/r_light.h +++ b/r_light.h @@ -9,7 +9,7 @@ typedef struct vec3_t light; // the brightness of the light vec_t cullradius; // only for culling comparisons vec_t subtract; // to avoid sudden brightness change at cullradius, subtract this -// entity_render_t *ent; // owner of this light + entity_render_t *ent; // owner of this light } rdlight_t; -- 2.39.2