From 39589a192d78d793eb7d2e07d61b4b346b06f5d3 Mon Sep 17 00:00:00 2001 From: Lucy Date: Sat, 24 Aug 2024 17:54:00 -0400 Subject: [PATCH] Revert https://github.com/Monkestation/Monkestation2.0/pull/2505/commits/aeeeb78b90d2329a43fa3857ec671a067c29eac5 --- code/__HELPERS/lighting.dm | 6 +++--- code/game/atoms_movable.dm | 16 +++++----------- code/game/machinery/hologram.dm | 2 +- code/modules/visuals/render_steps.dm | 21 +++++---------------- 4 files changed, 14 insertions(+), 31 deletions(-) diff --git a/code/__HELPERS/lighting.dm b/code/__HELPERS/lighting.dm index 674dc1d71134..98ed7e7d66c3 100644 --- a/code/__HELPERS/lighting.dm +++ b/code/__HELPERS/lighting.dm @@ -59,13 +59,13 @@ // First, we cut away a constant amount var/cut_away = (alpha_to_leave - 1) / 255 - var/atom/movable/render_step/color/alpha_threshold_down = new(null, make_blocker, list(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1, 0,0,0,-cut_away)) + var/atom/movable/render_step/color/alpha_threshold_down = new(make_blocker, make_blocker.render_target, list(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1, 0,0,0,-cut_away)) alpha_threshold_down.render_target = "*emissive_block_alpha_down_[uid]" // Then we multiply what remains by the amount we took away - var/atom/movable/render_step/color/alpha_threshold_up = new(null, alpha_threshold_down, list(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,alpha_to_leave, 0,0,0,0)) + var/atom/movable/render_step/color/alpha_threshold_up = new(make_blocker, alpha_threshold_down.render_target, list(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,alpha_to_leave, 0,0,0,0)) alpha_threshold_up.render_target = "*emissive_block_alpha_up_[uid]" // Now we just feed that into an emissive blocker - var/atom/movable/render_step/emissive_blocker/em_block = new(null, alpha_threshold_up) + var/atom/movable/render_step/emissive_blocker/em_block = new(make_blocker, alpha_threshold_up.render_target) var/list/hand_back = list() hand_back += alpha_threshold_down hand_back += alpha_threshold_up diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 47a9f019df31..dd6f53c6442d 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -138,7 +138,7 @@ if (blocks_emissive) if (blocks_emissive == EMISSIVE_BLOCK_UNIQUE) render_target = ref(src) - em_block = new(null, src) + em_block = new(src, render_target) overlays += em_block if(managed_overlays) if(islist(managed_overlays)) @@ -211,7 +211,7 @@ move_packet = null if(spatial_grid_key) - SSspatial_grid.force_remove_from_grid(src) + SSspatial_grid.force_remove_from_cell(src) LAZYCLEARLIST(client_mobs_in_contents) @@ -243,11 +243,9 @@ // This saves several hundred milliseconds of init time. if (blocks_emissive) if (blocks_emissive == EMISSIVE_BLOCK_UNIQUE) - if(em_block) - SET_PLANE(em_block, EMISSIVE_PLANE, src) - else if(!QDELETED(src)) + if(!em_block && !QDELETED(src)) render_target = ref(src) - em_block = new(null, src) + em_block = new(src, render_target) return em_block // Implied else if (blocks_emissive == EMISSIVE_BLOCK_NONE) -> return // EMISSIVE_BLOCK_GENERIC == 0 @@ -263,7 +261,7 @@ SET_PLANE(underlay_appearance, PLANE_SPACE, generate_for) if(!generate_for.render_target) generate_for.render_target = ref(generate_for) - var/atom/movable/render_step/emissive_blocker/em_block = new(null, generate_for) + var/atom/movable/render_step/emissive_blocker/em_block = new(null, generate_for.render_target) underlay_appearance.overlays += em_block // We used it because it's convienient and easy, but it's gotta go now or it'll hang refs QDEL_NULL(em_block) @@ -1473,10 +1471,6 @@ /// Gets or creates the relevant language holder. For mindless atoms, gets the local one. For atom with mind, gets the mind one. /atom/movable/proc/get_language_holder(get_minds = TRUE) - if(QDELING(src)) - CRASH("get_language_holder() called on a QDELing atom, \ - this will try to re-instantiate the language holder that's about to be deleted, which is bad.") - if(!language_holder) language_holder = new initial_language_holder(src) return language_holder diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index ae87b00aea69..ff5bad76dc2b 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -879,7 +879,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ render_target = "holoray#[uid]" uid++ // Let's GLOW BROTHER! (Doing it like this is the most robust option compared to duped overlays) - glow = new(null, src) + glow = new(src, render_target) // We need to counteract the pixel offset to ensure we don't double offset (I hate byond) glow.pixel_x = 32 glow.pixel_y = 32 diff --git a/code/modules/visuals/render_steps.dm b/code/modules/visuals/render_steps.dm index e29436596c6e..74cc7f80d7f7 100644 --- a/code/modules/visuals/render_steps.dm +++ b/code/modules/visuals/render_steps.dm @@ -12,16 +12,10 @@ //we'll display using that, so we gotta reset appearance_flags = KEEP_APART|KEEP_TOGETHER|RESET_TRANSFORM -/atom/movable/render_step/Initialize(mapload, atom/source) +/atom/movable/render_step/Initialize(mapload, source) . = ..() verbs.Cut() //Cargo cultttttt - - if(!source) - return - - render_source = source.render_target - SET_PLANE_EXPLICIT(src, initial(plane), source) - RegisterSignal(source, COMSIG_QDELETING, PROC_REF(on_source_deleting)) + render_source = source /atom/movable/render_step/ex_act(severity) return FALSE @@ -40,12 +34,6 @@ if(harderforce) return ..() -/atom/movable/render_step/proc/on_source_deleting(atom/source) - SIGNAL_HANDLER - - if(!QDELING(src)) - qdel(src) - /** * Render step that modfies an atom's color * Useful for creating coherent emissive blockers out of things like glass floors by lowering alpha statically using matrixes @@ -56,7 +44,7 @@ //RESET_COLOR is obvious I hope appearance_flags = KEEP_APART|KEEP_TOGETHER|RESET_COLOR|RESET_TRANSFORM -/atom/movable/render_step/color/Initialize(mapload, atom/source, color) +/atom/movable/render_step/color/Initialize(mapload, source, color) . = ..() src.color = color @@ -73,10 +61,11 @@ plane = EMISSIVE_PLANE appearance_flags = EMISSIVE_APPEARANCE_FLAGS|RESET_TRANSFORM -/atom/movable/render_step/emissive_blocker/Initialize(mapload, atom/source) +/atom/movable/render_step/emissive_blocker/Initialize(mapload, source) . = ..() src.color = GLOB.em_block_color + /** * Render step that makes the passed in render source GLOW *