mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-21 07:32:02 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user