diff options
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/draw.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc index d125420..741eb3d 100644 --- a/src/render/draw.cc +++ b/src/render/draw.cc @@ -392,7 +392,7 @@ void draw_pass_model_lights() gl::begin(gl::Quads); - const float light_size = 0.0625; + for (std::map<unsigned int, core::Entity *>::iterator it=core::Entity::registry.begin(); it != core::Entity::registry.end(); it++) { core::Entity *entity = (*it).second; @@ -400,9 +400,15 @@ void draw_pass_model_lights() if ( test_drawfx_distance(entity) && (entity->model()->model_light.size())) { for (std::list<core::Light *>::iterator lit = entity->model()->model_light.begin(); lit != entity->model()->model_light.end(); lit++) { - if (!(*lit)->strobe() || (( core::application()->time() - floorf(core::application()->time()) ) < 0.5f)) { + // strobe frequency + float t = 1.0f; + if ((*lit)->strobe()) + t = (core::application()->time() + entity->fuzz() + (*lit)->offset()) * (*lit)->frequency(); + + if (!(*lit)->strobe() || (( t - floorf(t)) < 0.5f)) { math::Vector3f location = entity->location() + (entity->axis() * (*lit)->location()); float n = dotproduct(camera_axis.forward(), (camera_eye-location)); + float light_size = 0.0625 * (*lit)->radius(); if (n < 0) { math::Color color((*lit)->color()); |