[MIRROR] Opacity refactor (#405)

* Opacity refactor (#52881)

    Moves all opacity var manipulation to a proc which sends a signal.
    light_blocker element for movable opaque atoms made, which tracks its movement and updates the affected turfs for proper lighting updates.
    has_opaque_atom boolean replaced by the opacity_sources lazylist to keep track of the sources, and a directional_opacity which serves a similar function but also allows for future expansion with on-border opaque objects (not yet implemented).
    Some opacity-related sight procs optimized as a result of this.
    Some variables moved to the object's definition.
    A define or two added into the mix for clarity.
    Some code cleaning, like turning booleans into their defines.
    One file renamed for clarity.

Changelog

cl
balance: Mechs no longer block sight. It's a non-trivial cost for the lighting system with little to no gain.
/cl

* Opacity refactor

Co-authored-by: Rohesie <rohesie@gmail.com>
This commit is contained in:
SkyratBot
2020-08-19 04:48:14 +02:00
committed by GitHub
co-authored by Rohesie
parent 48990f52d7
commit 72c69368b6
63 changed files with 220 additions and 160 deletions
+2 -2
View File
@@ -11,7 +11,7 @@
olddens = parent_atom.density
oldopac = parent_atom.opacity
parent_atom.density = 0
parent_atom.opacity = 0
parent_atom.set_opacity(FALSE)
if(isliving(parent_atom))
var/mob/living/L = parent_atom
L.add_movespeed_modifier(/datum/movespeed_modifier/shrink_ray)
@@ -31,7 +31,7 @@
var/atom/parent_atom = parent
parent_atom.transform = parent_atom.transform.Scale(2,2)
parent_atom.density = olddens
parent_atom.opacity = oldopac
parent_atom.set_opacity(oldopac)
if(isliving(parent_atom))
var/mob/living/L = parent_atom
L.remove_movespeed_modifier(/datum/movespeed_modifier/shrink_ray)