[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
+1 -1
View File
@@ -4,7 +4,7 @@
desc = "Burbling corrosive stuff."
icon_state = "acid"
density = FALSE
opacity = 0
opacity = FALSE
anchored = TRUE
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF
layer = ABOVE_NORMAL_TURF_LAYER
+1 -1
View File
@@ -7,7 +7,7 @@
invisibility = INVISIBILITY_ABSTRACT //nope, can't see this
anchored = TRUE
density = TRUE
opacity = 0
opacity = FALSE
var/static/list/AllTeleporters
@@ -1,7 +1,7 @@
/obj/effect/particle_effect/expl_particles
name = "fire"
icon_state = "explosion_particle"
opacity = 1
opacity = TRUE
anchored = TRUE
/obj/effect/particle_effect/expl_particles/Initialize()
@@ -27,7 +27,7 @@
name = "fire"
icon = 'icons/effects/96x96.dmi'
icon_state = "explosion"
opacity = 1
opacity = TRUE
anchored = TRUE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
pixel_x = -32
@@ -8,7 +8,7 @@
/obj/effect/particle_effect/foam
name = "foam"
icon_state = "foam"
opacity = 0
opacity = FALSE
anchored = TRUE
density = FALSE
layer = EDGED_TURF_LAYER
@@ -257,7 +257,7 @@
icon = 'icons/effects/effects.dmi'
icon_state = "metalfoam"
density = TRUE
opacity = 1 // changed in New()
opacity = TRUE // changed in New()
anchored = TRUE
layer = EDGED_TURF_LAYER
resistance_flags = FIRE_PROOF | ACID_PROOF
@@ -8,7 +8,7 @@
icon_state = "smoke"
pixel_x = -32
pixel_y = -32
opacity = 0
opacity = FALSE
layer = FLY_LAYER
anchored = TRUE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
+1 -1
View File
@@ -3,7 +3,7 @@
name = "FORCEWALL"
icon_state = "m_shield"
anchored = TRUE
opacity = 0
opacity = FALSE
density = TRUE
CanAtmosPass = ATMOS_PASS_DENSITY
var/timeleft = 300 //Set to 0 for permanent forcefields (ugh)
+1 -1
View File
@@ -4,7 +4,7 @@
name = "glowshroom"
desc = "Mycena Bregprox, a species of mushroom that glows in the dark."
anchored = TRUE
opacity = 0
opacity = FALSE
density = FALSE
icon = 'icons/obj/lighting.dmi'
icon_state = "glowshroom" //replaced in New
+1 -1
View File
@@ -12,7 +12,7 @@ RLD
/obj/item/construction
name = "not for ingame use"
desc = "A device used to rapidly build and deconstruct. Reload with metal, plasteel, glass or compressed matter cartridges."
opacity = 0
opacity = FALSE
density = FALSE
anchored = FALSE
flags_1 = CONDUCT_1
+1 -1
View File
@@ -14,7 +14,7 @@ RSF
var/spent_icon_state = "rsf_empty"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
opacity = 0
opacity = FALSE
density = FALSE
anchored = FALSE
item_flags = NOBLUDGEON
@@ -4,7 +4,7 @@
icon = 'icons/obj/machines/implantchair.dmi'
icon_state = "implantchair"
density = TRUE
opacity = 0
opacity = FALSE
var/ready = TRUE
var/replenishing = FALSE
+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"