diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-03-26 07:31:33 +1100 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-03-26 07:31:33 +1100 |
commit | c484fab32dcac655164f082805d1d55d1d058f2f (patch) | |
tree | 9eeabdaee723a88bbebdd77d41d1bb93ee3def83 /source/game/StarWorldImpl.hpp | |
parent | 77d7f8eb81af21dd231f6384951fc2c14c149d5c (diff) |
experiment: auto-conversion of object spread lights to hybrid spread/point lights
Diffstat (limited to 'source/game/StarWorldImpl.hpp')
-rw-r--r-- | source/game/StarWorldImpl.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/game/StarWorldImpl.hpp b/source/game/StarWorldImpl.hpp index dec827f..3e3728b 100644 --- a/source/game/StarWorldImpl.hpp +++ b/source/game/StarWorldImpl.hpp @@ -445,10 +445,10 @@ namespace WorldImpl { for (auto const& entity : entityMap->entityQuery(RectF(lighting.calculationRegion()))) { for (auto const& light : entity->lightSources()) { Vec2F position = worldGeometry.nearestTo(Vec2F(lighting.calculationRegion().min()), light.position); - if (light.pointLight) - lighting.addPointLight(position, light.color.sum() / 3.0f, light.pointBeam, light.beamAngle, light.beamAmbience); - else + if (light.type == LightType::Spread) lighting.addSpreadLight(position, light.color.sum() / 3.0f); + else + lighting.addPointLight(position, light.color.sum() / 3.0f, light.pointBeam, light.beamAngle, light.beamAmbience); } } |