Files
Bubberstation/code/modules/lighting/lighting_area.dm
SkyratBot c3d3637fdb [MIRROR] Only blend areas when it's actually needed (#6978)
* Only blend areas when it's actually needed (#60237)

* Only blend areas when it's actually needed

* Respect varedits

* Only blend areas when it's actually needed

Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
2021-07-19 20:11:16 +12:00

33 lines
776 B
Plaintext

/area
luminosity = TRUE
var/dynamic_lighting = DYNAMIC_LIGHTING_ENABLED
/area/proc/set_dynamic_lighting(new_dynamic_lighting = DYNAMIC_LIGHTING_ENABLED)
if (new_dynamic_lighting == dynamic_lighting)
return FALSE
dynamic_lighting = new_dynamic_lighting
if (IS_DYNAMIC_LIGHTING(src))
cut_overlay(/obj/effect/fullbright)
blend_mode = BLEND_DEFAULT
for (var/turf/T in src)
if (IS_DYNAMIC_LIGHTING(T))
T.lighting_build_overlay()
else
add_overlay(/obj/effect/fullbright)
blend_mode = BLEND_MULTIPLY
for (var/turf/T in src)
if (T.lighting_object)
T.lighting_clear_overlay()
return TRUE
/area/vv_edit_var(var_name, var_value)
switch(var_name)
if(NAMEOF(src, dynamic_lighting))
set_dynamic_lighting(var_value)
return TRUE
return ..()