Replaces set_light with direct update_lumcount for planet suns.

Setting lights on every single turf takes way too long.  Instead of havingto create a light source for every single outdoor turf, we find the corners to light up and apply the sunlight to them directly.
We also make sure to avoid having planet sunlight being 4x too strong, which would happen if we naively looped over all corners of all outdoor turfs.
Note: This has the side effect of making the sun's light and color ACCURATELY reflected on turfs.  Previous code doubled up on light and appeared brighter than it should.
This commit is contained in:
Leshana
2018-04-18 21:54:58 -04:00
parent 471e544a61
commit c4d714dea8
2 changed files with 33 additions and 6 deletions

View File

@@ -12,7 +12,8 @@
var/datum/weather_holder/weather_holder
var/sun_position = 0 // 0 means midnight, 1 means noon.
var/list/sun = list("range","brightness","color")
var/list/sun = list("range","brightness","color","lum_r","lum_g","lum_b")
var/list/datum/lighting_corner/sunlit_corners = list()
var/expected_z_levels = list()
var/turf/unsimulated/wall/planetary/planetary_wall_type = /turf/unsimulated/wall/planetary