mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-31 00:58:26 +01:00
Fixes blood emissives rendering below disposals pipes and other floor objects (#94024)
## About The Pull Request So KEEP_APART with a set plane has a fun behavior where topdown objects still keep their topdown layer, which causes FLOAT_LAYER emissives on floor objects to render above everything else. This includes emissive blockers, and I have missed static blockers in my original PR so here they are. Fixes this. <img width="222" height="116" alt="image" src="https://github.com/user-attachments/assets/5762864c-f732-4196-81b7-9cee415f1af8" /> ## Changelog 🆑 fix: Fixed blood emissives rendering below disposals pipes and other floor objects /🆑
This commit is contained in:
@@ -159,6 +159,9 @@
|
||||
// NOTICE: we break from the pattern of increasing in steps of like 0.01 here
|
||||
// Because TOPDOWN_LAYER is 10000 and that's enough to floating point our modifications away
|
||||
|
||||
/// Used to shift all topdown layer emissives to a the game plane equivalent layers, as otherwise they render above everything else due to being KEEP_APART
|
||||
#define TOPDOWN_TO_EMISSIVE_LAYER(layer) LERP(FLOOR_EMISSIVE_START_LAYER, FLOOR_EMISSIVE_END_LAYER, (layer - (TOPDOWN_LAYER + 1)) / TOPDOWN_LAYER_COUNT)
|
||||
|
||||
// Must be equal to the offset of the highest topdown layer
|
||||
#define TOPDOWN_LAYER_COUNT 18
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#define TOPDOWN_TO_EMISSIVE_LAYER(layer) LERP(FLOOR_EMISSIVE_START_LAYER, FLOOR_EMISSIVE_END_LAYER, (layer - (TOPDOWN_LAYER + 1)) / TOPDOWN_LAYER_COUNT)
|
||||
|
||||
/// Produces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the [EMISSIVE_COLOR].
|
||||
/proc/emissive_appearance(icon, icon_state = "", atom/offset_spokesman, layer, alpha = 255, appearance_flags = NONE, offset_const, effect_type = EMISSIVE_BLOOM)
|
||||
if((isnull(layer) || layer == FLOAT_LAYER) && IS_TOPDOWN_PLANE(offset_spokesman.plane))
|
||||
@@ -99,5 +97,3 @@
|
||||
var/atom/movable/vis_cast = make_blocker
|
||||
vis_cast.vis_contents += hand_back
|
||||
return hand_back
|
||||
|
||||
#undef TOPDOWN_TO_EMISSIVE_LAYER
|
||||
|
||||
@@ -174,6 +174,8 @@
|
||||
blocker.dir = dir
|
||||
blocker.appearance_flags = appearance_flags | EMISSIVE_APPEARANCE_FLAGS
|
||||
blocker.plane = GET_NEW_PLANE(EMISSIVE_PLANE, PLANE_TO_OFFSET(plane)) // Takes a light path through the normal macro for a microop
|
||||
if (IS_TOPDOWN_PLANE(plane))
|
||||
blocker.layer = TOPDOWN_TO_EMISSIVE_LAYER(layer)
|
||||
// Ok so this is really cursed, but I want to set with this blocker cheaply while
|
||||
// Still allowing it to be removed from the overlays list later
|
||||
// So I'm gonna flatten it, then insert the flattened overlay into overlays AND the managed overlays list, directly
|
||||
|
||||
Reference in New Issue
Block a user