Some more improvments, removed dview.

This *seems* to be a decent speed up just in the appearent time it takes break all lights to process, and dview wasn't really needed here.

Minor oddies can occur on bigger lights near their edges, but not enough to justify the extra cost.
This commit is contained in:
MrStonedOne
2017-05-06 17:46:20 -07:00
parent f1f53a10cc
commit b0c4bf7ec1
2 changed files with 11 additions and 9 deletions

View File

@@ -27,7 +27,7 @@ GLOBAL_LIST_INIT(LIGHTING_CORNER_DIAGONAL, list(NORTHEAST, SOUTHEAST, SOUTHWEST,
/datum/lighting_corner/New(var/turf/new_turf, var/diagonal)
. = ..()
masters = list()
masters[new_turf] = turn(diagonal, 180)
z = new_turf.z

View File

@@ -232,7 +232,7 @@
else
var/P = get_turf_pixel(top_atom)
if (P != pixel_turf)
pixel_turf = get_turf_pixel(top_atom)
pixel_turf = P
update = TRUE
if (light_range && light_power && !applied)
@@ -256,13 +256,15 @@
var/thing
var/datum/lighting_corner/C
var/turf/T
FOR_DVIEW(T, Ceiling(light_range), source_turf, 0)
for (thing in T.get_corners(source_turf))
C = thing
corners[C] = 0
turfs += T
FOR_DVIEW_END
if (source_turf)
var/oldlum = source_turf.luminosity
source_turf.luminosity = Ceiling(light_range)
for(T in view(Ceiling(light_range), source_turf))
for (thing in T.get_corners(source_turf))
C = thing
corners[C] = 0
turfs += T
source_turf.luminosity = oldlum
LAZYINITLIST(affecting_turfs)
var/list/L = turfs - affecting_turfs // New turfs, add us to the affecting lights of them.