diff --git a/code/__HELPERS/icon_smoothing.dm b/code/__HELPERS/icon_smoothing.dm index 9d916016910..be5537e70ae 100644 --- a/code/__HELPERS/icon_smoothing.dm +++ b/code/__HELPERS/icon_smoothing.dm @@ -46,6 +46,11 @@ #define DEFAULT_UNDERLAY_ICON_STATE "plating" +#define QUEUE_SMOOTH(thing_to_queue) if(thing_to_queue.smooth) {SSicon_smooth.add_to_queue(thing_to_queue)} + +#define QUEUE_SMOOTH_NEIGHBORS(thing_to_queue) for(var/neighbor in orange(1, thing_to_queue)) {var/atom/atom_neighbor = neighbor; QUEUE_SMOOTH(atom_neighbor)} + + /proc/calculate_adjacencies(atom/A) if(!A.loc) return 0 @@ -100,7 +105,7 @@ return adjacencies -//do not use, use queue_smooth(atom) +//do not use, use QUEUE_SMOOTH(atom) /proc/smooth_icon(atom/A) if(!A || !A.smooth) return @@ -299,14 +304,14 @@ if(now) smooth_icon(T) else - queue_smooth(T) + QUEUE_SMOOTH(T) for(var/R in T) var/atom/A = R if(A.smooth) if(now) smooth_icon(A) else - queue_smooth(A) + QUEUE_SMOOTH(A) /atom/proc/clear_smooth_overlays() cut_overlay(top_left_corner) @@ -368,20 +373,6 @@ else return 0 -//SSicon_smooth -/proc/queue_smooth_neighbors(atom/A) - for(var/V in orange(1,A)) - var/atom/T = V - if(T.smooth) - queue_smooth(T) - -//SSicon_smooth -/proc/queue_smooth(atom/A) - if(!A.smooth) - return - - SSicon_smooth.add_to_queue(A) - //Example smooth wall /turf/closed/wall/smooth diff --git a/code/game/objects/effects/decals/cleanable/misc.dm b/code/game/objects/effects/decals/cleanable/misc.dm index ac28e5f731c..d47f3ea40ab 100644 --- a/code/game/objects/effects/decals/cleanable/misc.dm +++ b/code/game/objects/effects/decals/cleanable/misc.dm @@ -65,11 +65,11 @@ smooth = SMOOTH_MORE icon = 'icons/effects/dirt.dmi' icon_state = "" - queue_smooth(src) - queue_smooth_neighbors(src) + QUEUE_SMOOTH(src) + QUEUE_SMOOTH_NEIGHBORS(src) /obj/effect/decal/cleanable/dirt/Destroy() - queue_smooth_neighbors(src) + QUEUE_SMOOTH_NEIGHBORS(src) return ..() /obj/effect/decal/cleanable/dirt/dust diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index 0c9c98f970e..bbe58658bb5 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -19,15 +19,15 @@ armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50) . = ..() if(smooth) - queue_smooth(src) - queue_smooth_neighbors(src) + QUEUE_SMOOTH(src) + QUEUE_SMOOTH_NEIGHBORS(src) icon_state = "" GLOB.cameranet.updateVisibility(src) /obj/structure/Destroy() GLOB.cameranet.updateVisibility(src) if(smooth) - queue_smooth_neighbors(src) + QUEUE_SMOOTH_NEIGHBORS(src) return ..() /obj/structure/attack_hand(mob/user) diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm index e6c3b25d84c..9b8fb5feb09 100644 --- a/code/game/objects/structures/false_walls.dm +++ b/code/game/objects/structures/false_walls.dm @@ -71,7 +71,7 @@ if(density) icon_state = initial(icon_state) smooth = SMOOTH_TRUE - queue_smooth(src) + QUEUE_SMOOTH(src) else icon_state = "fwall_open" diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 38db8dceefa..3c8c783a467 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -32,7 +32,7 @@ ratio = CEILING(ratio*4, 1) * 25 if(smooth) - queue_smooth(src) + QUEUE_SMOOTH(src) if(ratio > 50) return diff --git a/code/game/objects/structures/mineral_doors.dm b/code/game/objects/structures/mineral_doors.dm index 3bb560eedf9..8239483620a 100644 --- a/code/game/objects/structures/mineral_doors.dm +++ b/code/game/objects/structures/mineral_doors.dm @@ -311,7 +311,7 @@ /obj/structure/mineral_door/paperframe/Initialize() . = ..() - queue_smooth_neighbors(src) + QUEUE_SMOOTH_NEIGHBORS(src) /obj/structure/mineral_door/paperframe/examine(mob/user) . = ..() @@ -346,5 +346,5 @@ return /obj/structure/mineral_door/paperframe/Destroy() - queue_smooth_neighbors(src) + QUEUE_SMOOTH_NEIGHBORS(src) return ..() diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 147687e7094..481e165d49d 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -44,8 +44,8 @@ /obj/structure/table/update_icon() if(smooth) - queue_smooth(src) - queue_smooth_neighbors(src) + QUEUE_SMOOTH(src) + QUEUE_SMOOTH_NEIGHBORS(src) /obj/structure/table/narsie_act() var/atom/A = loc diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index ac088f62ea2..333264a5971 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -305,7 +305,7 @@ /obj/structure/window/proc/update_nearby_icons() update_icon() if(smooth) - queue_smooth_neighbors(src) + QUEUE_SMOOTH_NEIGHBORS(src) //merges adjacent full-tile windows into one /obj/structure/window/update_overlays() @@ -318,7 +318,7 @@ ratio = CEILING(ratio*4, 1) * 25 if(smooth) - queue_smooth(src) + QUEUE_SMOOTH(src) cut_overlay(crack_overlay) if(ratio > 75) @@ -775,7 +775,7 @@ cut_overlay(torn) add_overlay(paper) set_opacity(TRUE) - queue_smooth(src) + QUEUE_SMOOTH(src) /obj/structure/window/paperframe/attackby(obj/item/W, mob/user) diff --git a/code/game/turfs/change_turf.dm b/code/game/turfs/change_turf.dm index 2a8ec07f24e..f0db8527d69 100644 --- a/code/game/turfs/change_turf.dm +++ b/code/game/turfs/change_turf.dm @@ -286,7 +286,7 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list( for(var/obj/machinery/door/firedoor/FD in T) FD.CalculateAffectingAreas() - queue_smooth_neighbors(src) + QUEUE_SMOOTH_NEIGHBORS(src) HandleTurfChange(src) diff --git a/code/game/turfs/closed/wall/reinf_walls.dm b/code/game/turfs/closed/wall/reinf_walls.dm index 892170b39ff..f601134b119 100644 --- a/code/game/turfs/closed/wall/reinf_walls.dm +++ b/code/game/turfs/closed/wall/reinf_walls.dm @@ -200,8 +200,8 @@ clear_smooth_overlays() else smooth = SMOOTH_TRUE - queue_smooth_neighbors(src) - queue_smooth(src) + QUEUE_SMOOTH_NEIGHBORS(src) + QUEUE_SMOOTH(src) /turf/closed/wall/r_wall/update_icon_state() if(d_state != INTACT) diff --git a/code/game/turfs/open/floor/fancy_floor.dm b/code/game/turfs/open/floor/fancy_floor.dm index 3a82d17738e..0d309ef8437 100644 --- a/code/game/turfs/open/floor/fancy_floor.dm +++ b/code/game/turfs/open/floor/fancy_floor.dm @@ -200,11 +200,11 @@ return 0 if(!broken && !burnt) if(smooth) - queue_smooth(src) + QUEUE_SMOOTH(src) else make_plating() if(smooth) - queue_smooth_neighbors(src) + QUEUE_SMOOTH_NEIGHBORS(src) /turf/open/floor/carpet/black icon = 'icons/turf/floors/carpet_black.dmi' diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 53b44dbf72d..3936ebee632 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -62,7 +62,7 @@ GLOBAL_LIST_EMPTY(station_turfs) levelupdate() if(smooth) - queue_smooth(src) + QUEUE_SMOOTH(src) visibilityChanged() for(var/atom/movable/AM in src) diff --git a/code/modules/holodeck/turfs.dm b/code/modules/holodeck/turfs.dm index 5aa0a15ba42..9e76c258f91 100644 --- a/code/modules/holodeck/turfs.dm +++ b/code/modules/holodeck/turfs.dm @@ -117,7 +117,7 @@ /turf/open/floor/holofloor/carpet/update_icon() . = ..() if(intact) - queue_smooth(src) + QUEUE_SMOOTH(src) /turf/open/floor/holofloor/wood icon_state = "wood" diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index 7d0a40810dd..a33b8ad9f2c 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -523,11 +523,11 @@ Difficulty: Hard /obj/effect/temp_visual/hierophant/wall/Initialize(mapload, new_caster) . = ..() - queue_smooth_neighbors(src) - queue_smooth(src) + QUEUE_SMOOTH_NEIGHBORS(src) + QUEUE_SMOOTH(src) /obj/effect/temp_visual/hierophant/wall/Destroy() - queue_smooth_neighbors(src) + QUEUE_SMOOTH_NEIGHBORS(src) return ..() /obj/effect/temp_visual/hierophant/wall/CanAllowThrough(atom/movable/mover, turf/target) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm index 16a1480e8ec..dacab32fc28 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm @@ -314,11 +314,11 @@ While using this makes the system rely on OnFire, it still gives options for tim /obj/effect/temp_visual/elite_tumor_wall/Initialize(mapload, new_caster) . = ..() - queue_smooth_neighbors(src) - queue_smooth(src) + QUEUE_SMOOTH_NEIGHBORS(src) + QUEUE_SMOOTH(src) /obj/effect/temp_visual/elite_tumor_wall/Destroy() - queue_smooth_neighbors(src) + QUEUE_SMOOTH_NEIGHBORS(src) activator = null ourelite = null return ..() diff --git a/code/modules/shuttle/shuttle_rotate.dm b/code/modules/shuttle/shuttle_rotate.dm index 5b5f325d9f4..b884a2b0e75 100644 --- a/code/modules/shuttle/shuttle_rotate.dm +++ b/code/modules/shuttle/shuttle_rotate.dm @@ -13,7 +13,7 @@ If ever any of these procs are useful for non-shuttles, rename it to proc/rotate //resmooth if need be. if(smooth && (params & ROTATE_SMOOTH)) - queue_smooth(src) + QUEUE_SMOOTH(src) //rotate the pixel offsets too. if((pixel_x || pixel_y) && (params & ROTATE_OFFSET))