[IDB Ignore] Refactor icon smoothing to use 8-bit bitmasking (#16620)

This commit is contained in:
S34N
2021-12-15 17:04:24 +01:00
committed by GitHub
parent 5445b71cd5
commit ac6f9b4725
162 changed files with 1271 additions and 870 deletions
@@ -43,13 +43,23 @@
layer = TURF_LAYER
icon = 'icons/effects/dirt.dmi'
icon_state = "dirt"
canSmoothWith = list(/obj/effect/decal/cleanable/dirt, /turf/simulated/wall, /obj/structure/falsewall)
smooth = SMOOTH_MORE
base_icon_state = "dirt"
smoothing_flags = NONE
smoothing_groups = list(SMOOTH_GROUP_CLEANABLE_DIRT)
canSmoothWith = list(SMOOTH_GROUP_CLEANABLE_DIRT, SMOOTH_GROUP_WALLS)
mouse_opacity = FALSE
/obj/effect/decal/cleanable/dirt/Initialize(mapload)
/obj/effect/decal/cleanable/dirt/Initialize()
. = ..()
icon_state = ""
QUEUE_SMOOTH_NEIGHBORS(src)
if(smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK))
QUEUE_SMOOTH_NEIGHBORS(src)
/obj/effect/decal/cleanable/dirt/Destroy()
QUEUE_SMOOTH_NEIGHBORS(src)
if(smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK))
QUEUE_SMOOTH_NEIGHBORS(src)
return ..()
/obj/effect/decal/cleanable/dirt/blackpowder
name = "black powder"
@@ -66,11 +66,11 @@
return TRUE
if(random_icon_states && length(src.random_icon_states) > 0)
src.icon_state = pick(src.random_icon_states)
if(smooth)
queue_smooth(src)
queue_smooth_neighbors(src)
if(smoothing_flags)
QUEUE_SMOOTH(src)
QUEUE_SMOOTH_NEIGHBORS(src)
/obj/effect/decal/cleanable/Destroy()
if(smooth)
queue_smooth_neighbors(src)
if(smoothing_flags)
QUEUE_SMOOTH_NEIGHBORS(src)
return ..()