Inline some lighting stuff (#2929)

Inlines some really frequently called lighting procs, maybe will speed up lighting updates a bit.
This commit is contained in:
Lohikar
2017-07-03 04:04:53 -05:00
committed by skull132
parent 9c010f92d1
commit 13ceff816c
3 changed files with 45 additions and 6 deletions

View File

@@ -328,6 +328,7 @@
var/thing
var/datum/lighting_corner/C
var/turf/T
var/list/Tcorners
var/Sx = source_turf.x
var/Sy = source_turf.y
@@ -336,9 +337,25 @@
if (light_angle && check_light_cone(T.x, T.y))
continue
for (thing in T.get_corners())
C = thing
corners[C] = 0
if (T.dynamic_lighting || T.light_sources)
Tcorners = T.corners
if (!T.lighting_corners_initialised)
T.lighting_corners_initialised = TRUE
if (!Tcorners)
T.corners = list(null, null, null, null)
Tcorners = T.corners
for (var/i = 1 to 4)
if (Tcorners[i])
continue
Tcorners[i] = new /datum/lighting_corner(T, LIGHTING_CORNER_DIAGONAL[i])
if (!T.has_opaque_atom)
for (thing in Tcorners)
C = thing
corners[C] = 0
turfs += T