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;
// 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)
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;
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
}
}
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;