[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
@@ -55,7 +55,7 @@
icon = 'icons/obj/smooth_structures/alien/resin_wall.dmi'
icon_state = "smooth"
density = TRUE
opacity = 1
opacity = TRUE
anchored = TRUE
smoothing_flags = SMOOTH_CORNERS
smoothing_groups = list(SMOOTH_GROUP_ALIEN_RESIN)
@@ -91,7 +91,7 @@
desc = "Resin just thin enough to let light pass through."
icon = 'icons/obj/smooth_structures/alien/resin_membrane.dmi'
icon_state = "smooth"
opacity = 0
opacity = FALSE
max_integrity = 160
resintype = "membrane"
smoothing_groups = list(SMOOTH_GROUP_ALIEN_RESIN, SMOOTH_GROUP_ALIEN_WALLS)
+1 -1
View File
@@ -9,7 +9,7 @@
icon_state = "wall"
layer = LOW_OBJ_LAYER
density = TRUE
opacity = 1
opacity = TRUE
max_integrity = 100
smoothing_flags = SMOOTH_CORNERS
smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS)
+2 -2
View File
@@ -7,7 +7,7 @@
icon_state = "minibar"
anchored = TRUE
density = FALSE
opacity = 0
opacity = FALSE
var/deconstructible = TRUE
/obj/structure/fluff/attackby(obj/item/I, mob/living/user, params)
@@ -261,4 +261,4 @@
deconstructible = FALSE
/obj/structure/fluff/hedge/opaque //useful for mazes and such
opacity = 1
opacity = TRUE
+1 -1
View File
@@ -6,7 +6,7 @@
icon_state = "shotguncase"
anchored = FALSE
density = TRUE
opacity = 0
opacity = FALSE
var/case_type = ""
var/gun_category = /obj/item/gun
var/open = TRUE
+1 -1
View File
@@ -1,7 +1,7 @@
/obj/structure/sign
icon = 'icons/obj/decals.dmi'
anchored = TRUE
opacity = 0
opacity = FALSE
density = FALSE
layer = SIGN_LAYER
custom_materials = list(/datum/material/plastic = 2000)
+2 -2
View File
@@ -441,13 +441,13 @@
density = TRUE
open = FALSE
if(opaque_closed)
opacity = TRUE
set_opacity(TRUE)
else
icon_state = "[icon_type]-open"
layer = SIGN_LAYER
density = FALSE
open = TRUE
opacity = FALSE
set_opacity(FALSE)
/obj/structure/curtain/attackby(obj/item/W, mob/user)
if (istype(W, /obj/item/toy/crayon))
+1 -1
View File
@@ -576,7 +576,7 @@
/obj/structure/window/reinforced/tinted
name = "tinted window"
icon_state = "twindow"
opacity = 1
opacity = TRUE
/obj/structure/window/reinforced/tinted/frosted
name = "frosted window"
icon_state = "fwindow"