]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
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 bf38fce51724559602cca8931f37749a597de255..c483a33717d87cb17db3124b1bc2887122b108f0 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));
-       //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)
index 1dd0df3c32fc2b5f7efbe2bd6edd37c58add3573..a52d83e5291708bfa9db096a47714331cb6e2ed6 100644 (file)
--- 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;
 
index d2ae578d4c516ee09f7e69e477c321610a025f4c..f0660972cbad80fe6a1318e4608436ef8afed148 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->ent = cd->ent;
+               rd->ent = cd->ent;
                c_dlights++; // count every dlight in use
        }
 }
index 6fafe72239aade27d837f4525a9de5b158364d55..0a3b5d8e9af589985e1a6a74dbf42730c08ee2dc 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
-//     entity_render_t *ent; // owner of this light
+       entity_render_t *ent; // owner of this light
 }
 rdlight_t;