ent field added back to dlight structures
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 30 Sep 2002 01:05:10 +0000 (01:05 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 30 Sep 2002 01:05:10 +0000 (01:05 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2475 d7cf8633-e32d-0410-b094-e92efae38249

cl_main.c
client.h
r_light.c
r_light.h

index bf38fce..c483a33 100644 (file)
--- 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));
 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;
        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;
                        // 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)
                }
 
                if (chase_active.integer)
index 1dd0df3..a52d83e 100644 (file)
--- a/client.h
+++ b/client.h
@@ -74,8 +74,8 @@ typedef struct
        float   radius;
        // drop this each second
        float   decay;
        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;
 
 }
 dlight_t;
 
index d2ae578..f066097 100644 (file)
--- 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->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
        }
 }
                c_dlights++; // count every dlight in use
        }
 }
index 6fafe72..0a3b5d8 100644 (file)
--- 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
        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;
 
 }
 rdlight_t;