From a28fbd141502b9fe4381284b7395803119bb0b38 Mon Sep 17 00:00:00 2001 From: Lohikar Date: Mon, 5 Jun 2017 03:15:47 -0500 Subject: [PATCH] Icon smoothing fixes (#2624) Fixes some issues with smoothing, including asteroid flooring losing its sprite for no apparent reason. --- code/_helpers/icon_smoothing.dm | 6 ++++-- code/game/objects/structures/window.dm | 11 +---------- code/game/turfs/turf_changing.dm | 14 ++++++-------- code/modules/mining/mine_turfs.dm | 12 ++++++------ 4 files changed, 17 insertions(+), 26 deletions(-) diff --git a/code/_helpers/icon_smoothing.dm b/code/_helpers/icon_smoothing.dm index 75dc1eed2b9..59867cf4dca 100644 --- a/code/_helpers/icon_smoothing.dm +++ b/code/_helpers/icon_smoothing.dm @@ -37,6 +37,7 @@ #define SMOOTH_DIAGONAL 4 //if atom should smooth diagonally, this should be present in 'smooth' var #define SMOOTH_BORDER 8 //atom will smooth with the borders of the map #define SMOOTH_QUEUED 16 //atom is currently queued to smooth. +#define SMOOTH_CLEAR_ICON 32 // clear the atom's icon_state on smooth. SMOOTH_DIAGONAL implies this. #define NULLTURF_BORDER 123456789 @@ -279,8 +280,9 @@ if(New) A.add_overlay(New) - - A.icon_state = "" + + if (A.icon_state && (A.smooth & SMOOTH_CLEAR_ICON)) + A.icon_state = null /proc/find_type_in_direction(atom/source, direction) var/turf/target_turf = get_step(source, direction) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 69969c8d781..591aa36029c 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -486,20 +486,11 @@ reinf = 1 basestate = "w" dir = 5 - smooth = SMOOTH_TRUE + smooth = SMOOTH_TRUE | SMOOTH_CLEAR_ICON can_be_unanchored = TRUE /obj/structure/window/shuttle/crescent - name = "shuttle window" desc = "It looks rather strong." - icon = 'icons/obj/smooth/shuttle_window.dmi' - icon_state = "shuttle_window" - basestate = "window" - reinf = 1 - basestate = "w" - dir = 5 - smooth = SMOOTH_TRUE - can_be_unanchored = TRUE /obj/structure/window/shuttle/crescent/take_damage() return diff --git a/code/game/turfs/turf_changing.dm b/code/game/turfs/turf_changing.dm index 1d7ce2725b6..438400ed516 100644 --- a/code/game/turfs/turf_changing.dm +++ b/code/game/turfs/turf_changing.dm @@ -11,6 +11,7 @@ var/obj/structure/lattice/L = locate(/obj/structure/lattice, src) if(L) qdel(L) + // Called after turf replaces old one /turf/proc/post_change() levelupdate() @@ -18,8 +19,11 @@ if(istype(T)) T.update_icon() -//Creates a new turf -/turf/proc/ChangeTurf(var/turf/N, var/tell_universe=1, var/force_lighting_update = 0) + queue_smooth_neighbors(src) + +//Creates a new turf. +// N is the type of the turf. +/turf/proc/ChangeTurf(N, tell_universe = TRUE, force_lighting_update = FALSE) if (!N) return @@ -39,9 +43,6 @@ if(connections) connections.erase_all() - cut_overlays() - underlays.Cut() - // So we call destroy. qdel(src) @@ -66,9 +67,6 @@ . = W - queue_smooth(src) - queue_smooth_neighbors(src) - /turf/proc/transport_properties_from(turf/other) if(!istype(other, src.type)) return 0 diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index 69f23d082bb..868eb3c9a93 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -15,7 +15,8 @@ canSmoothWith = list( /turf/simulated/mineral, /turf/simulated/wall, - /turf/unsimulated/wall + /turf/unsimulated/wall, + /turf/simulated/shuttle ) oxygen = 0 nitrogen = 0 @@ -491,20 +492,19 @@ // This means you can put grass on the asteroid etc. /turf/simulated/floor/asteroid name = "sand" - //icon = 'icons/turf/flooring/asteroid.dmi' - //icon_state = "asteroid" icon = 'icons/turf/smooth/ash.dmi' icon_state = "ash" smooth = SMOOTH_MORE | SMOOTH_BORDER canSmoothWith = list( /turf/simulated/floor/asteroid, /turf/simulated/mineral, - /turf/simulated/wall + /turf/simulated/wall, + /turf/simulated/shuttle ) base_name = "sand" base_desc = "Gritty and unpleasant." - base_icon = 'icons/turf/flooring/asteroid.dmi' - base_icon_state = "asteroid" + base_icon = 'icons/turf/smooth/ash.dmi' + base_icon_state = "ash" initial_flooring = null oxygen = 0