diff --git a/_maps/RandomRuins/LavaRuins/lavaland_surface_gas.dmm b/_maps/RandomRuins/LavaRuins/lavaland_surface_gas.dmm index bcea9d1adbd..726a767d107 100644 --- a/_maps/RandomRuins/LavaRuins/lavaland_surface_gas.dmm +++ b/_maps/RandomRuins/LavaRuins/lavaland_surface_gas.dmm @@ -244,7 +244,6 @@ /obj/structure/sign/warning/fire/directional/north, /obj/structure/reagent_dispensers/fueltank/large{ anchored = 1; - can_be_unanchored = 1 }, /obj/structure/railing{ dir = 8 @@ -381,7 +380,6 @@ /obj/structure/sign/warning/fire/directional/south, /obj/structure/reagent_dispensers/fueltank/large{ anchored = 1; - can_be_unanchored = 1 }, /obj/structure/railing{ dir = 8 diff --git a/_maps/map_files/Birdshot/birdshot.dmm b/_maps/map_files/Birdshot/birdshot.dmm index 45b856d792d..559250d954c 100644 --- a/_maps/map_files/Birdshot/birdshot.dmm +++ b/_maps/map_files/Birdshot/birdshot.dmm @@ -8447,7 +8447,6 @@ }, /obj/structure/closet{ anchored = 1; - can_be_unanchored = 1; name = "Cold protection gear" }, /obj/item/clothing/suit/hooded/wintercoat/science, diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index 4ba31f9a0e4..5b08ff2818e 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -3437,7 +3437,6 @@ "bjs" = ( /obj/structure/closet{ anchored = 1; - can_be_unanchored = 1; name = "Cold protection gear" }, /obj/item/clothing/shoes/winterboots, diff --git a/_maps/map_files/NebulaStation/NebulaStation.dmm b/_maps/map_files/NebulaStation/NebulaStation.dmm index 117a0563d77..3557eb80fa9 100644 --- a/_maps/map_files/NebulaStation/NebulaStation.dmm +++ b/_maps/map_files/NebulaStation/NebulaStation.dmm @@ -7991,7 +7991,6 @@ "blI" = ( /obj/structure/guncase/shotgun{ anchored = 1; - can_be_unanchored = 1; open = 0 }, /obj/item/gun/ballistic/shotgun/doublebarrel, @@ -47611,7 +47610,6 @@ /obj/item/storage/bag/xeno, /obj/structure/closet{ anchored = 1; - can_be_unanchored = 1; name = "Cold protection gear" }, /turf/open/floor/iron/dark, @@ -137565,7 +137563,6 @@ /obj/structure/window/reinforced/spawner/directional/west, /obj/structure/closet{ anchored = 1; - can_be_unanchored = 1; name = "Cold protection gear" }, /obj/effect/turf_decal/tile/purple/fourcorners, diff --git a/_maps/map_files/wawastation/wawastation.dmm b/_maps/map_files/wawastation/wawastation.dmm index 91a0dc9b7f5..37d13a784e4 100644 --- a/_maps/map_files/wawastation/wawastation.dmm +++ b/_maps/map_files/wawastation/wawastation.dmm @@ -55155,7 +55155,6 @@ /obj/machinery/firealarm/directional/south, /obj/structure/closet{ anchored = 1; - can_be_unanchored = 1; name = "Cold protection gear" }, /obj/item/clothing/shoes/winterboots, diff --git a/code/__DEFINES/icon_smoothing.dm b/code/__DEFINES/icon_smoothing.dm index 3fb41443a73..33368636198 100644 --- a/code/__DEFINES/icon_smoothing.dm +++ b/code/__DEFINES/icon_smoothing.dm @@ -1,28 +1,25 @@ /* smoothing_flags */ -/// Smoothing system in where adjacencies are calculated and used to build an image by mounting each corner at runtime. -#define SMOOTH_CORNERS (1<<0) /// Smoothing system in where adjacencies are calculated and used to select a pre-baked icon_state, encoded by bitmasking. -#define SMOOTH_BITMASK (1<<1) +#define SMOOTH_BITMASK (1<<0) /// Limits SMOOTH_BITMASK to only cardinal directions, for use with cardinal smoothing -#define SMOOTH_BITMASK_CARDINALS (1<<2) +#define SMOOTH_BITMASK_CARDINALS (1<<1) /// Atom has diagonal corners, with underlays under them. -#define SMOOTH_DIAGONAL_CORNERS (1<<3) +#define SMOOTH_DIAGONAL_CORNERS (1<<2) /// Atom will smooth with the borders of the map. -#define SMOOTH_BORDER (1<<4) +#define SMOOTH_BORDER (1<<3) /// Atom is currently queued to smooth. -#define SMOOTH_QUEUED (1<<5) +#define SMOOTH_QUEUED (1<<4) /// Smooths with objects, and will thus need to scan turfs for contents. -#define SMOOTH_OBJ (1<<6) +#define SMOOTH_OBJ (1<<5) /// Uses directional object smoothing, so we care not only about something being on the right turf, but also its direction /// Changes the meaning of smoothing_junction, instead of representing the directions we are smoothing in /// it represents the sides of our directional border object that have a neighbor -/// Is incompatible with SMOOTH_CORNERS because border objects don't have corners -#define SMOOTH_BORDER_OBJECT (1<<7) +/// Is incompatible with SMOOTH_DIAGONAL_CORNERS because border objects don't have corners +#define SMOOTH_BORDER_OBJECT (1<<6) -#define USES_SMOOTHING (SMOOTH_CORNERS|SMOOTH_BITMASK|SMOOTH_BITMASK_CARDINALS) +#define USES_SMOOTHING (SMOOTH_BITMASK|SMOOTH_BITMASK_CARDINALS) DEFINE_BITFIELD(smoothing_flags, list( - "SMOOTH_CORNERS" = SMOOTH_CORNERS, "SMOOTH_BITMASK" = SMOOTH_BITMASK, "SMOOTH_BITMASK_CARDINALS" = SMOOTH_BITMASK_CARDINALS, "SMOOTH_DIAGONAL_CORNERS" = SMOOTH_DIAGONAL_CORNERS, @@ -207,8 +204,9 @@ DEFINE_BITFIELD(smoothing_junction, list( #define SMOOTH_GROUP_SPIDER_WEB_WALL_TOUGH S_OBJ(73) // /obj/structure/spider/stickyweb/sealed/thick #define SMOOTH_GROUP_SPIDER_WEB_WALL_MIRROR S_OBJ(74) // /obj/structure/spider/stickyweb/sealed/reflector -#define SMOOTH_GROUP_GRAV_FIELD S_OBJ(69) -#define SMOOTH_GROUP_GIRDER S_OBJ(75) +#define SMOOTH_GROUP_GRAV_FIELD S_OBJ(75) +#define SMOOTH_GROUP_GIRDER S_OBJ(76) +#define SMOOTH_GROUP_TEST_WALL S_OBJ(77) // I'm a lazy bum who doesn't want to increment all of these up by 1 ~Lemon /// Performs the work to set smoothing_groups and canSmoothWith. /// An inlined function used in both turf/Initialize and atom/Initialize. diff --git a/code/__HELPERS/icon_smoothing.dm b/code/__HELPERS/icon_smoothing.dm index 88ca3dbe11c..3893ef04ce4 100644 --- a/code/__HELPERS/icon_smoothing.dm +++ b/code/__HELPERS/icon_smoothing.dm @@ -1,17 +1,29 @@ -//generic (by snowflake) tile smoothing code; smooth your icons with this! +//generic (by snowflake + others) tile smoothing code; smooth your icons with this! /* - Each tile is divided in 4 corners, each corner has an appearance associated to it; the tile is then overlayed by these 4 appearances - To use this, just set your atom's 'smoothing_flags' var to 1. If your atom can be moved/unanchored, set its 'can_be_unanchored' var to 1. - If you don't want your atom's icon to smooth with anything but atoms of the same type, set the list 'canSmoothWith' to null; + Smoothed atoms are displayed using prebaked icon states which have been "cut" from a template to match a set of possible smoothing directions. + This allows for a variety of effects, such as nice wall textures, gloopy slime, carpet that makes sense, etc etc etc + + To use this, just set your atom's 'smoothing_flags' var to SMOOTH_BITMASK. There are other smoothing strategies but that's all we need to worry about right now + If you don't want your atom's icon to smooth with anything but atoms of the same type, set the string 'canSmoothWith' to null; Otherwise, put all the smoothing groups you want the atom icon to smooth with in 'canSmoothWith', including the group of the atom itself. Smoothing groups are just shared flags between objects. If one of the 'canSmoothWith' of A matches one of the `smoothing_groups` of B, then A will smooth with B. - Each atom has its own icon file with all the possible corner states. See 'smooth_wall.dmi' for a template. + Each atom has its own icon file with all its icon states, this file is typically generated automatically from a png/toml using hypnagoic, our external cutter. + See `wall.dmi' 'wall.png' and 'wall.png.toml' for an example, alongside [the icon cutter documentation](../../icons/Cutter.md) DIAGONAL SMOOTHING INSTRUCTIONS - To make your atom smooth diagonally you need all the proper icon states (see 'smooth_wall.dmi' for a template) and - to add the 'SMOOTH_DIAGONAL_CORNERS' flag to the atom's smoothing_flags var (in addition to either SMOOTH_TRUE or SMOOTH_MORE). + To make your atom smooth diagonally you need all the proper icon states (hypnagoic does not support these currently, TODO) + They're constructed out of 12 "corners", 4 outer corners, 4 "outside" inner corners and 4 "inside" inner corners + - 5, 6, 9 and 10 get what you can think of as "outside" bars, they're corners with no inside, like below (smoothing from the POV of [X]). + - [X]X + - X + - 21, 38, 74, 137 get "inside" bars, still built with the same "outside" edges. + - [X]X + - X X + I shouldn't like, need to tell you this, ideally hypnagogic would just support it, but I haven't done that yet and I wanted to write this down for now. + + Then add the 'SMOOTH_DIAGONAL_CORNERS' flag to the atom's smoothing_flags var (in addition to SMOOTH_BITMASK). For turfs, what appears under the diagonal corners depends on the turf that was in the same position previously: if you make a wall on a plating floor, you will see plating under the diagonal wall corner, if it was space, you will see space. @@ -19,14 +31,15 @@ If you wish to map a diagonal wall corner with a fixed underlay, you must configure the turf's 'fixed_underlay' list var, like so: fixed_underlay = list("icon"='icon_file.dmi', "icon_state"="iconstatename") A non null 'fixed_underlay' list var will skip copying the previous turf appearance and always use the list. If the list is - not set properly, the underlay will default to regular floor plating. + not set properly, the underlay will default to regular floor plating. + NOTE: a special case of this involves setting fixed_underlay to list("space" = TRUE), which will force it to draw space below the wall, no matter what To see an example of a diagonal wall, see '/turf/closed/wall/mineral/titanium' and its subtypes. -*/ -#define NO_ADJ_FOUND 0 -#define ADJ_FOUND 1 -#define NULLTURF_BORDER 2 + BORDER SMOOTHING INSTRUCTIONS + Ok so we have code to smooth border objects together, unfortunately for you I don't remember how they're supposed to be rendered (AND WE HAVE NO CUTTER SUPPORT) + I'll fill this in when/if I add proper cutting for these, they're so painful to put together by hand I don't really want to even describe it to you +*/ GLOBAL_LIST_INIT(adjacent_direction_lookup, generate_adjacent_directions()) @@ -104,66 +117,6 @@ xxx xxx xxx (GLOB.adjacent_direction_lookup[border_obj.dir][direction + 1]) ? REVERSE_DIR(direction) : NONE \ ) -#define DEFAULT_UNDERLAY_ICON 'icons/turf/floors.dmi' -#define DEFAULT_UNDERLAY_ICON_STATE "plating" - - -///Scans all adjacent turfs to find targets to smooth with. -/atom/proc/calculate_adjacencies() - . = NONE - - if(!loc) - return - - for(var/direction in GLOB.cardinals) - switch(find_type_in_direction(direction)) - if(NULLTURF_BORDER) - if((smoothing_flags & SMOOTH_BORDER)) - . |= direction //BYOND and smooth dirs are the same for cardinals - if(ADJ_FOUND) - . |= direction //BYOND and smooth dirs are the same for cardinals - - if(. & NORTH_JUNCTION) - if(. & WEST_JUNCTION) - switch(find_type_in_direction(NORTHWEST)) - if(NULLTURF_BORDER) - if((smoothing_flags & SMOOTH_BORDER)) - . |= NORTHWEST_JUNCTION - if(ADJ_FOUND) - . |= NORTHWEST_JUNCTION - - if(. & EAST_JUNCTION) - switch(find_type_in_direction(NORTHEAST)) - if(NULLTURF_BORDER) - if((smoothing_flags & SMOOTH_BORDER)) - . |= NORTHEAST_JUNCTION - if(ADJ_FOUND) - . |= NORTHEAST_JUNCTION - - if(. & SOUTH_JUNCTION) - if(. & WEST_JUNCTION) - switch(find_type_in_direction(SOUTHWEST)) - if(NULLTURF_BORDER) - if((smoothing_flags & SMOOTH_BORDER)) - . |= SOUTHWEST_JUNCTION - if(ADJ_FOUND) - . |= SOUTHWEST_JUNCTION - - if(. & EAST_JUNCTION) - switch(find_type_in_direction(SOUTHEAST)) - if(NULLTURF_BORDER) - if((smoothing_flags & SMOOTH_BORDER)) - . |= SOUTHEAST_JUNCTION - if(ADJ_FOUND) - . |= SOUTHEAST_JUNCTION - - -/atom/movable/calculate_adjacencies() - if(can_be_unanchored && !anchored) - return NONE - return ..() - - ///do not use, use QUEUE_SMOOTH(atom) /atom/proc/smooth_icon() if(QDELETED(src)) @@ -172,12 +125,7 @@ xxx xxx xxx flags_1 |= HTML_USE_INITAL_ICON_1 if (!z) CRASH("[type] called smooth_icon() without being on a z-level") - if(smoothing_flags & SMOOTH_CORNERS) - if(smoothing_flags & SMOOTH_DIAGONAL_CORNERS) - corners_diagonal_smooth(calculate_adjacencies()) - else - corners_cardinal_smooth(calculate_adjacencies()) - else if(smoothing_flags & (SMOOTH_BITMASK|SMOOTH_BITMASK_CARDINALS)) + if(smoothing_flags & (SMOOTH_BITMASK|SMOOTH_BITMASK_CARDINALS)) bitmask_smooth() else CRASH("smooth_icon called for [src] with smoothing_flags == [smoothing_flags]") @@ -189,157 +137,6 @@ xxx xxx xxx . = ..() update_appearance(~UPDATE_SMOOTHING) -/atom/proc/corners_diagonal_smooth(adjacencies) - switch(adjacencies) - if(NORTH_JUNCTION|WEST_JUNCTION) - replace_smooth_overlays("d-se","d-se-0") - if(NORTH_JUNCTION|EAST_JUNCTION) - replace_smooth_overlays("d-sw","d-sw-0") - if(SOUTH_JUNCTION|WEST_JUNCTION) - replace_smooth_overlays("d-ne","d-ne-0") - if(SOUTH_JUNCTION|EAST_JUNCTION) - replace_smooth_overlays("d-nw","d-nw-0") - - if(NORTH_JUNCTION|WEST_JUNCTION|NORTHWEST_JUNCTION) - replace_smooth_overlays("d-se","d-se-1") - if(NORTH_JUNCTION|EAST_JUNCTION|NORTHEAST_JUNCTION) - replace_smooth_overlays("d-sw","d-sw-1") - if(SOUTH_JUNCTION|WEST_JUNCTION|SOUTHWEST_JUNCTION) - replace_smooth_overlays("d-ne","d-ne-1") - if(SOUTH_JUNCTION|EAST_JUNCTION|SOUTHEAST_JUNCTION) - replace_smooth_overlays("d-nw","d-nw-1") - - else - corners_cardinal_smooth(adjacencies) - return FALSE - - icon_state = "" - return TRUE - - -/atom/proc/corners_cardinal_smooth(adjacencies) - var/mutable_appearance/temp_ma - - //NW CORNER - var/nw = "1-i" - if((adjacencies & NORTH_JUNCTION) && (adjacencies & WEST_JUNCTION)) - if(adjacencies & NORTHWEST_JUNCTION) - nw = "1-f" - else - nw = "1-nw" - else - if(adjacencies & NORTH_JUNCTION) - nw = "1-n" - else if(adjacencies & WEST_JUNCTION) - nw = "1-w" - temp_ma = mutable_appearance(icon, nw) - nw = temp_ma.appearance - - //NE CORNER - var/ne = "2-i" - if((adjacencies & NORTH_JUNCTION) && (adjacencies & EAST_JUNCTION)) - if(adjacencies & NORTHEAST_JUNCTION) - ne = "2-f" - else - ne = "2-ne" - else - if(adjacencies & NORTH_JUNCTION) - ne = "2-n" - else if(adjacencies & EAST_JUNCTION) - ne = "2-e" - temp_ma = mutable_appearance(icon, ne) - ne = temp_ma.appearance - - //SW CORNER - var/sw = "3-i" - if((adjacencies & SOUTH_JUNCTION) && (adjacencies & WEST_JUNCTION)) - if(adjacencies & SOUTHWEST_JUNCTION) - sw = "3-f" - else - sw = "3-sw" - else - if(adjacencies & SOUTH_JUNCTION) - sw = "3-s" - else if(adjacencies & WEST_JUNCTION) - sw = "3-w" - temp_ma = mutable_appearance(icon, sw) - sw = temp_ma.appearance - - //SE CORNER - var/se = "4-i" - if((adjacencies & SOUTH_JUNCTION) && (adjacencies & EAST_JUNCTION)) - if(adjacencies & SOUTHEAST_JUNCTION) - se = "4-f" - else - se = "4-se" - else - if(adjacencies & SOUTH_JUNCTION) - se = "4-s" - else if(adjacencies & EAST_JUNCTION) - se = "4-e" - temp_ma = mutable_appearance(icon, se) - se = temp_ma.appearance - - var/list/new_overlays - - if(top_left_corner != nw) - cut_overlay(top_left_corner) - top_left_corner = nw - LAZYADD(new_overlays, nw) - - if(top_right_corner != ne) - cut_overlay(top_right_corner) - top_right_corner = ne - LAZYADD(new_overlays, ne) - - if(bottom_right_corner != sw) - cut_overlay(bottom_right_corner) - bottom_right_corner = sw - LAZYADD(new_overlays, sw) - - if(bottom_left_corner != se) - cut_overlay(bottom_left_corner) - bottom_left_corner = se - LAZYADD(new_overlays, se) - - if(new_overlays) - add_overlay(new_overlays) - - -///Scans direction to find targets to smooth with. -/atom/proc/find_type_in_direction(direction) - var/turf/target_turf = get_step(src, direction) - if(!target_turf) - return NULLTURF_BORDER - - var/area/target_area = get_area(target_turf) - var/area/source_area = get_area(src) - if((source_area.area_limited_icon_smoothing && !istype(target_area, source_area.area_limited_icon_smoothing)) || (target_area.area_limited_icon_smoothing && !istype(source_area, target_area.area_limited_icon_smoothing))) - return NO_ADJ_FOUND - - if(isnull(canSmoothWith)) //special case in which it will only smooth with itself - if(isturf(src)) - return (type == target_turf.type) ? ADJ_FOUND : NO_ADJ_FOUND - var/atom/matching_obj = locate(type) in target_turf - return (matching_obj && matching_obj.type == type) ? ADJ_FOUND : NO_ADJ_FOUND - - if(!isnull(target_turf.smoothing_groups)) - for(var/target in canSmoothWith) - if(!(canSmoothWith[target] & target_turf.smoothing_groups[target])) - continue - return ADJ_FOUND - - if(smoothing_flags & SMOOTH_OBJ) - for(var/atom/movable/thing as anything in target_turf) - if(!thing.anchored || isnull(thing.smoothing_groups)) - continue - for(var/target in canSmoothWith) - if(!(canSmoothWith[target] & thing.smoothing_groups[target])) - continue - return ADJ_FOUND - - return NO_ADJ_FOUND - /** * Basic smoothing proc. The atom checks for adjacent directions to smooth with and changes the icon_state based on that. * @@ -351,6 +148,8 @@ xxx xxx xxx // cache for sanic speed var/canSmoothWith = src.canSmoothWith + var/area/home_base = get_area(src) + var/area_limited_icon_smoothing = home_base?.area_limited_icon_smoothing var/smooth_border = (smoothing_flags & SMOOTH_BORDER) var/smooth_obj = (smoothing_flags & SMOOTH_OBJ) @@ -360,7 +159,7 @@ xxx xxx xxx #define SEARCH_ADJ_IN_DIR(direction, direction_flag, ADJ_FOUND, WORLD_BORDER, BORDER_CHECK) \ do { \ var/turf/neighbor = get_step(src, direction); \ - if(neighbor && ##BORDER_CHECK(neighbor, direction)) { \ + if(neighbor && ##BORDER_CHECK(neighbor, direction) && (!area_limited_icon_smoothing || istype(neighbor.loc, area_limited_icon_smoothing))) { \ var/neighbor_smoothing_groups = neighbor.smoothing_groups; \ if(neighbor_smoothing_groups) { \ for(var/target in canSmoothWith) { \ @@ -459,13 +258,16 @@ xxx xxx xxx #undef BITMASK_FOUND #undef SEARCH_ADJ_IN_DIR + +#define DEFAULT_UNDERLAY_ICON 'icons/turf/floors.dmi' +#define DEFAULT_UNDERLAY_ICON_STATE "plating" + ///Changes the icon state based on the new junction bitmask /atom/proc/set_smoothed_icon_state(new_junction) . = smoothing_junction smoothing_junction = new_junction icon_state = "[base_icon_state]-[smoothing_junction]" - /turf/closed/set_smoothed_icon_state(new_junction) // Avoid calling ..() here to avoid setting icon_state twice, which is expensive given how hot this proc is var/old_junction = smoothing_junction @@ -513,6 +315,8 @@ xxx xxx xxx return return ..() +#undef DEFAULT_UNDERLAY_ICON +#undef DEFAULT_UNDERLAY_ICON_STATE //Icon smoothing helpers /proc/smooth_zlevel(zlevel, now = FALSE) @@ -530,50 +334,6 @@ xxx xxx xxx else QUEUE_SMOOTH(movable_to_smooth) - -/atom/proc/clear_smooth_overlays() - cut_overlay(top_left_corner) - top_left_corner = null - cut_overlay(top_right_corner) - top_right_corner = null - cut_overlay(bottom_right_corner) - bottom_right_corner = null - cut_overlay(bottom_left_corner) - bottom_left_corner = null - -/// Internal: Takes icon states as text to replace smoothing corner overlays -/atom/proc/replace_smooth_overlays(nw, ne, sw, se) - clear_smooth_overlays() - var/mutable_appearance/temp_ma - - temp_ma = mutable_appearance(icon, nw) - nw = temp_ma.appearance - - temp_ma = mutable_appearance(icon, ne) - ne = temp_ma.appearance - - temp_ma = mutable_appearance(icon, sw) - sw = temp_ma.appearance - - temp_ma = mutable_appearance(icon, se) - se = temp_ma.appearance - - var/list/new_overlays = list() - - top_left_corner = nw - new_overlays += nw - - top_right_corner = ne - new_overlays += ne - - bottom_left_corner = sw - new_overlays += sw - - bottom_right_corner = se - new_overlays += se - - add_overlay(new_overlays) - /// Takes a direction, turns it into all the junctions that contain it /proc/dir_to_all_junctions(dir) var/handback = NONE @@ -650,15 +410,10 @@ xxx xxx xxx /turf/closed/wall/smooth name = "smooth wall" icon = 'icons/turf/smooth_wall.dmi' - icon_state = "smooth" - smoothing_flags = SMOOTH_CORNERS|SMOOTH_DIAGONAL_CORNERS|SMOOTH_BORDER - smoothing_groups = null - canSmoothWith = null + icon_state = "smooth_wall-0" + base_icon_state = "smooth_wall" + smoothing_flags = SMOOTH_BITMASK|SMOOTH_DIAGONAL_CORNERS|SMOOTH_BORDER + smoothing_groups = SMOOTH_GROUP_TEST_WALL + canSmoothWith = SMOOTH_GROUP_TEST_WALL -#undef NO_ADJ_FOUND -#undef ADJ_FOUND -#undef NULLTURF_BORDER - -#undef DEFAULT_UNDERLAY_ICON -#undef DEFAULT_UNDERLAY_ICON_STATE #undef CAN_DIAGONAL_SMOOTH diff --git a/code/datums/greyscale/config_types/greyscale_configs/greyscale_objects.dm b/code/datums/greyscale/config_types/greyscale_configs/greyscale_objects.dm index 9556612be18..4f17ad5ae57 100644 --- a/code/datums/greyscale/config_types/greyscale_configs/greyscale_objects.dm +++ b/code/datums/greyscale/config_types/greyscale_configs/greyscale_objects.dm @@ -122,6 +122,11 @@ icon_file = 'icons/obj/pipes_n_cables/stationary_canisters.dmi' json_config = 'code/datums/greyscale/json_configs/smooth_canister_stationary.json' +/datum/greyscale_config/stationary_canister_overlays + name = "Stationary Canister" + icon_file = 'icons/obj/pipes_n_cables/stationary_canisters_misc.dmi' + json_config = 'code/datums/greyscale/json_configs/smooth_canister_stationary_overlays.json' + // MISC ATMOSPHERICS /datum/greyscale_config/meter name = "Meter" diff --git a/code/datums/greyscale/json_configs/smooth_canister_stationary.json b/code/datums/greyscale/json_configs/smooth_canister_stationary.json index df01ce1e6d2..62e97d22f76 100644 --- a/code/datums/greyscale/json_configs/smooth_canister_stationary.json +++ b/code/datums/greyscale/json_configs/smooth_canister_stationary.json @@ -1,184 +1,376 @@ { - "smooth": [ + "canister-0": [ { "type": "icon_state", - "icon_state": "smooth", + "icon_state": "canister-0", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "window-fg": [ + "canister-1": [ { "type": "icon_state", - "icon_state": "window-fg", + "icon_state": "canister-1", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "window-bg": [ + "canister-2": [ { "type": "icon_state", - "icon_state": "window-bg", + "icon_state": "canister-2", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "1-i": [ + "canister-3": [ { "type": "icon_state", - "icon_state": "1-i", + "icon_state": "canister-3", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "2-i": [ + "canister-4": [ { "type": "icon_state", - "icon_state": "2-i", + "icon_state": "canister-4", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "3-i": [ + "canister-5": [ { "type": "icon_state", - "icon_state": "3-i", + "icon_state": "canister-5", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "4-i": [ + "canister-6": [ { "type": "icon_state", - "icon_state": "4-i", + "icon_state": "canister-6", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "1-n": [ + "canister-7": [ { "type": "icon_state", - "icon_state": "1-n", + "icon_state": "canister-7", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "2-n": [ + "canister-8": [ { "type": "icon_state", - "icon_state": "2-n", + "icon_state": "canister-8", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "3-s": [ + "canister-9": [ { "type": "icon_state", - "icon_state": "3-s", + "icon_state": "canister-9", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "4-s": [ + "canister-10": [ { "type": "icon_state", - "icon_state": "4-s", + "icon_state": "canister-10", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "1-w": [ + "canister-11": [ { "type": "icon_state", - "icon_state": "1-w", + "icon_state": "canister-11", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "2-e": [ + "canister-12": [ { "type": "icon_state", - "icon_state": "2-e", + "icon_state": "canister-12", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "3-w": [ + "canister-13": [ { "type": "icon_state", - "icon_state": "3-w", + "icon_state": "canister-13", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "4-e": [ + "canister-14": [ { "type": "icon_state", - "icon_state": "4-e", + "icon_state": "canister-14", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "1-nw": [ + "canister-15": [ { "type": "icon_state", - "icon_state": "1-nw", + "icon_state": "canister-15", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "2-ne": [ + "canister-21": [ { "type": "icon_state", - "icon_state": "2-ne", + "icon_state": "canister-21", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "3-sw": [ + "canister-23": [ { "type": "icon_state", - "icon_state": "3-sw", + "icon_state": "canister-23", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "4-se": [ + "canister-29": [ { "type": "icon_state", - "icon_state": "4-se", + "icon_state": "canister-29", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "1-f": [ + "canister-31": [ { "type": "icon_state", - "icon_state": "1-f", + "icon_state": "canister-31", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "2-f": [ + "canister-38": [ { "type": "icon_state", - "icon_state": "2-f", + "icon_state": "canister-38", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "3-f": [ + "canister-39": [ { "type": "icon_state", - "icon_state": "3-f", + "icon_state": "canister-39", "blend_mode": "overlay", "color_ids": [ 1 ] } ], - "4-f": [ + "canister-46": [ { "type": "icon_state", - "icon_state": "4-f", + "icon_state": "canister-46", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-47": [ + { + "type": "icon_state", + "icon_state": "canister-47", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-55": [ + { + "type": "icon_state", + "icon_state": "canister-55", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-63": [ + { + "type": "icon_state", + "icon_state": "canister-63", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-74": [ + { + "type": "icon_state", + "icon_state": "canister-74", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-75": [ + { + "type": "icon_state", + "icon_state": "canister-75", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-78": [ + { + "type": "icon_state", + "icon_state": "canister-78", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-79": [ + { + "type": "icon_state", + "icon_state": "canister-79", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-95": [ + { + "type": "icon_state", + "icon_state": "canister-95", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-110": [ + { + "type": "icon_state", + "icon_state": "canister-110", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-111": [ + { + "type": "icon_state", + "icon_state": "canister-111", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-127": [ + { + "type": "icon_state", + "icon_state": "canister-127", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-137": [ + { + "type": "icon_state", + "icon_state": "canister-137", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-139": [ + { + "type": "icon_state", + "icon_state": "canister-139", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-141": [ + { + "type": "icon_state", + "icon_state": "canister-141", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-143": [ + { + "type": "icon_state", + "icon_state": "canister-143", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-157": [ + { + "type": "icon_state", + "icon_state": "canister-157", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-159": [ + { + "type": "icon_state", + "icon_state": "canister-159", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-175": [ + { + "type": "icon_state", + "icon_state": "canister-175", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-191": [ + { + "type": "icon_state", + "icon_state": "canister-191", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-203": [ + { + "type": "icon_state", + "icon_state": "canister-203", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-207": [ + { + "type": "icon_state", + "icon_state": "canister-207", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-223": [ + { + "type": "icon_state", + "icon_state": "canister-223", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-239": [ + { + "type": "icon_state", + "icon_state": "canister-239", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "canister-255": [ + { + "type": "icon_state", + "icon_state": "canister-255", "blend_mode": "overlay", "color_ids": [ 1 ] } diff --git a/code/datums/greyscale/json_configs/smooth_canister_stationary_overlays.json b/code/datums/greyscale/json_configs/smooth_canister_stationary_overlays.json new file mode 100644 index 00000000000..6dc7e73c32b --- /dev/null +++ b/code/datums/greyscale/json_configs/smooth_canister_stationary_overlays.json @@ -0,0 +1,18 @@ +{ + "window-fg": [ + { + "type": "icon_state", + "icon_state": "window-fg", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ], + "window-bg": [ + { + "type": "icon_state", + "icon_state": "window-bg", + "blend_mode": "overlay", + "color_ids": [ 1 ] + } + ] +} diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index a68c70c37cd..cbe227905f3 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -103,7 +103,7 @@ var/list/cameras - ///Typepath to limit the areas (subtypes included) that atoms in this area can smooth with. Used for shuttles. + /// Typepath to limit the areas (subtypes included) that atoms in this area can smooth with. Used for shuttles. var/area/area_limited_icon_smoothing /// The energy usage of the area in the last machines SS tick. diff --git a/code/game/atom/_atom.dm b/code/game/atom/_atom.dm index 4905d11ced2..88ce25b4e2d 100644 --- a/code/game/atom/_atom.dm +++ b/code/game/atom/_atom.dm @@ -111,15 +111,7 @@ ///Icon-smoothing behavior. var/smoothing_flags = NONE ///What directions this is currently smoothing with. IMPORTANT: This uses the smoothing direction flags as defined in icon_smoothing.dm, instead of the BYOND flags. - var/smoothing_junction = null //This starts as null for us to know when it's first set, but after that it will hold a 8-bit mask ranging from 0 to 255. - ///Smoothing variable - var/top_left_corner - ///Smoothing variable - var/top_right_corner - ///Smoothing variable - var/bottom_left_corner - ///Smoothing variable - var/bottom_right_corner + var/smoothing_junction = null ///What smoothing groups does this atom belongs to, to match canSmoothWith. If null, nobody can smooth with it. Must be sorted. var/list/smoothing_groups = null ///List of smoothing groups this atom can smooth with. If this is null and atom is smooth, it smooths only with itself. Must be sorted. diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 13cc9d35d7c..9f3299d95b4 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -87,9 +87,6 @@ ///Internal holder for emissive blocker object, do not use directly use blocks_emissive var/atom/movable/render_step/emissive_blocker/em_block - ///Used for the calculate_adjacencies proc for icon smoothing. - var/can_be_unanchored = FALSE - ///Lazylist to keep track on the sources of illumination. var/list/affected_dynamic_lights ///Highest-intensity light affecting us, which determines our visibility. diff --git a/code/game/objects/effects/decals/cleanable/misc.dm b/code/game/objects/effects/decals/cleanable/misc.dm index 916192e74a4..0bf7cdff576 100644 --- a/code/game/objects/effects/decals/cleanable/misc.dm +++ b/code/game/objects/effects/decals/cleanable/misc.dm @@ -64,7 +64,7 @@ /obj/effect/decal/cleanable/dirt name = "dirt" desc = "Someone should clean that up." - icon = 'icons/effects/dirt.dmi' + icon = 'icons/effects/dirt_misc.dmi' icon_state = "dirt-flat-0" base_icon_state = "dirt" smoothing_flags = NONE @@ -83,6 +83,8 @@ return var/turf/T = get_turf(src) if(T.tiled_dirt && is_tileable) + icon = 'icons/effects/dirt.dmi' + icon_state = "dirt-0" smoothing_flags = SMOOTH_BITMASK QUEUE_SMOOTH(src) if(smoothing_flags & USES_SMOOTHING) diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index 7f5e4c6b76d..193a5c8b669 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -22,8 +22,6 @@ if(smoothing_flags & USES_SMOOTHING) QUEUE_SMOOTH(src) QUEUE_SMOOTH_NEIGHBORS(src) - if(smoothing_flags & SMOOTH_CORNERS) - icon_state = "" GLOB.cameranet.updateVisibility(src) /obj/structure/Destroy(force) diff --git a/code/game/objects/structures/beds_chairs/alien_nest.dm b/code/game/objects/structures/beds_chairs/alien_nest.dm index b0de02fef48..47b1ab530d9 100644 --- a/code/game/objects/structures/beds_chairs/alien_nest.dm +++ b/code/game/objects/structures/beds_chairs/alien_nest.dm @@ -7,7 +7,6 @@ icon_state = "nest-0" base_icon_state = "nest" max_integrity = 120 - can_be_unanchored = FALSE smoothing_flags = SMOOTH_BITMASK smoothing_groups = SMOOTH_GROUP_ALIEN_NEST canSmoothWith = SMOOTH_GROUP_ALIEN_NEST diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm index 22c18a15212..f473294b71e 100644 --- a/code/game/objects/structures/false_walls.dm +++ b/code/game/objects/structures/false_walls.dm @@ -15,7 +15,6 @@ smoothing_flags = SMOOTH_BITMASK smoothing_groups = SMOOTH_GROUP_WALLS + SMOOTH_GROUP_CLOSED_TURFS canSmoothWith = SMOOTH_GROUP_WALLS - can_be_unanchored = FALSE can_atmos_pass = ATMOS_PASS_DENSITY rad_insulation = RAD_MEDIUM_INSULATION material_flags = MATERIAL_EFFECTS @@ -66,7 +65,6 @@ if(opening) smoothing_flags = NONE - clear_smooth_overlays() else smoothing_flags = SMOOTH_BITMASK QUEUE_SMOOTH(src) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index bf80ed8f6d7..7ac5a3eec03 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -9,7 +9,6 @@ flags_1 = ON_BORDER_1 obj_flags = CAN_BE_HIT | BLOCKS_CONSTRUCTION_DIR | IGNORE_DENSITY max_integrity = 50 - can_be_unanchored = TRUE resistance_flags = ACID_PROOF armor_type = /datum/armor/structure_window can_atmos_pass = ATMOS_PASS_PROC diff --git a/code/game/turfs/open/_open.dm b/code/game/turfs/open/_open.dm index 991e98b6eb9..e2aac7afa98 100644 --- a/code/game/turfs/open/_open.dm +++ b/code/game/turfs/open/_open.dm @@ -235,7 +235,6 @@ planetary_atmos = TRUE initial_gas_mix = LAVALAND_DEFAULT_ATMOS baseturfs = /turf/open/indestructible/hierophant - smoothing_flags = SMOOTH_CORNERS smoothing_flags = SMOOTH_BITMASK smoothing_groups = SMOOTH_GROUP_TURF_OPEN + SMOOTH_GROUP_HIEROPHANT canSmoothWith = SMOOTH_GROUP_HIEROPHANT diff --git a/code/modules/atmospherics/machinery/components/tank.dm b/code/modules/atmospherics/machinery/components/tank.dm index 118e1444ad6..57960bc9ec2 100644 --- a/code/modules/atmospherics/machinery/components/tank.dm +++ b/code/modules/atmospherics/machinery/components/tank.dm @@ -2,7 +2,8 @@ /obj/machinery/atmospherics/components/tank icon = 'icons/obj/pipes_n_cables/stationary_canisters.dmi' - icon_state = "smooth" + icon_state = "canister-0" + base_icon_state = "canister" name = "pressure tank" desc = "A large vessel containing pressurized gas." @@ -20,13 +21,14 @@ initialize_directions = NONE custom_reconcilation = TRUE - smoothing_flags = SMOOTH_CORNERS | SMOOTH_OBJ + smoothing_flags = SMOOTH_BITMASK | SMOOTH_OBJ smoothing_groups = SMOOTH_GROUP_GAS_TANK canSmoothWith = SMOOTH_GROUP_GAS_TANK appearance_flags = KEEP_TOGETHER|LONG_GLIDE greyscale_config = /datum/greyscale_config/stationary_canister greyscale_colors = "#ffffff" + var/overlay_greyscale_config = /datum/greyscale_config/stationary_canister_overlays ///The image showing the gases inside of the tank var/image/window @@ -69,7 +71,7 @@ if(!knob_overlays) knob_overlays = list() for(var/dir in GLOB.cardinals) - knob_overlays["[dir]"] = image('icons/obj/pipes_n_cables/stationary_canisters.dmi', icon_state = "knob", dir = dir, layer = FLOAT_LAYER) + knob_overlays["[dir]"] = image('icons/obj/pipes_n_cables/stationary_canisters_misc.dmi', icon_state = "knob", dir = dir, layer = FLOAT_LAYER) if(!crack_states) crack_states = list() @@ -81,7 +83,7 @@ AddComponent(/datum/component/gas_leaker, leak_rate = 0.05) AddElement(/datum/element/volatile_gas_storage) - AddElement(/datum/element/crackable, 'icons/obj/pipes_n_cables/stationary_canisters.dmi', crack_states) + AddElement(/datum/element/crackable, 'icons/obj/pipes_n_cables/stationary_canisters_misc.dmi', crack_states) RegisterSignal(src, COMSIG_MERGER_ADDING, PROC_REF(merger_adding)) RegisterSignal(src, COMSIG_MERGER_REMOVING, PROC_REF(merger_removing)) @@ -318,12 +320,13 @@ if(!air_contents) window = null return + var/icon/greyscaled_icon = SSgreyscale.GetColoredIconByType(overlay_greyscale_config, greyscale_colors) - window = image(icon, icon_state = "window-bg", layer = FLOAT_LAYER) + window = image(greyscaled_icon, icon_state = "window-bg", layer = FLOAT_LAYER) var/static/alpha_filter if(!alpha_filter) // Gotta do this separate since the icon may not be correct at world init - alpha_filter = filter(type="alpha", icon = icon('icons/obj/pipes_n_cables/stationary_canisters.dmi', "window-bg")) + alpha_filter = filter(type="alpha", icon = icon('icons/obj/pipes_n_cables/stationary_canisters_misc.dmi', "window-bg")) var/list/new_underlays = list() for(var/obj/effect/overlay/gas/gas as anything in air_contents.return_visuals(get_turf(src))) @@ -331,7 +334,7 @@ new_underlay.filters = alpha_filter new_underlays += new_underlay - var/image/foreground = image(icon, icon_state = "window-fg", layer = FLOAT_LAYER) + var/image/foreground = image(greyscaled_icon, icon_state = "window-fg", layer = FLOAT_LAYER) foreground.underlays = new_underlays window.overlays = list(foreground) @@ -500,7 +503,7 @@ // Tank Frame Structure /obj/structure/tank_frame - icon = 'icons/obj/pipes_n_cables/stationary_canisters.dmi' + icon = 'icons/obj/pipes_n_cables/stationary_canisters_misc.dmi' icon_state = "frame" anchored = FALSE density = TRUE diff --git a/code/modules/transport/tram/tram_structures.dm b/code/modules/transport/tram/tram_structures.dm index 6f8251c7966..abfca37fb56 100644 --- a/code/modules/transport/tram/tram_structures.dm +++ b/code/modules/transport/tram/tram_structures.dm @@ -36,7 +36,6 @@ smoothing_flags = SMOOTH_BITMASK smoothing_groups = SMOOTH_GROUP_TRAM_STRUCTURE canSmoothWith = SMOOTH_GROUP_TRAM_STRUCTURE - can_be_unanchored = FALSE can_atmos_pass = ATMOS_PASS_DENSITY explosion_block = 3 receive_ricochet_chance_mod = 1.2 diff --git a/icons/effects/dirt.dmi b/icons/effects/dirt.dmi index c3eeae8a9c5..5d5334f7bc9 100644 Binary files a/icons/effects/dirt.dmi and b/icons/effects/dirt.dmi differ diff --git a/icons/effects/dirt.png b/icons/effects/dirt.png new file mode 100644 index 00000000000..bee5b205ac1 Binary files /dev/null and b/icons/effects/dirt.png differ diff --git a/icons/effects/dirt.png.toml b/icons/effects/dirt.png.toml new file mode 100644 index 00000000000..cd6f740828a --- /dev/null +++ b/icons/effects/dirt.png.toml @@ -0,0 +1,2 @@ +template = "bitmask/diagonal_32x32.toml" +output_name = "dirt" diff --git a/icons/effects/dirt_misc.dmi b/icons/effects/dirt_misc.dmi new file mode 100644 index 00000000000..6346b48da87 Binary files /dev/null and b/icons/effects/dirt_misc.dmi differ diff --git a/icons/obj/pipes_n_cables/stationary_canisters.dmi b/icons/obj/pipes_n_cables/stationary_canisters.dmi index 4f87a50845b..062ee812d40 100644 Binary files a/icons/obj/pipes_n_cables/stationary_canisters.dmi and b/icons/obj/pipes_n_cables/stationary_canisters.dmi differ diff --git a/icons/obj/pipes_n_cables/stationary_canisters.png b/icons/obj/pipes_n_cables/stationary_canisters.png new file mode 100644 index 00000000000..d25fc52caa2 Binary files /dev/null and b/icons/obj/pipes_n_cables/stationary_canisters.png differ diff --git a/icons/obj/pipes_n_cables/stationary_canisters.png.toml b/icons/obj/pipes_n_cables/stationary_canisters.png.toml new file mode 100644 index 00000000000..1832dd37a82 --- /dev/null +++ b/icons/obj/pipes_n_cables/stationary_canisters.png.toml @@ -0,0 +1,2 @@ +output_name = "canister" +template = "bitmask/diagonal_32x32.toml" diff --git a/icons/obj/pipes_n_cables/stationary_canisters_misc.dmi b/icons/obj/pipes_n_cables/stationary_canisters_misc.dmi new file mode 100644 index 00000000000..857b5a816b4 Binary files /dev/null and b/icons/obj/pipes_n_cables/stationary_canisters_misc.dmi differ diff --git a/icons/turf/smooth_wall.dmi b/icons/turf/smooth_wall.dmi index afb5f9536aa..e46ea0ae778 100644 Binary files a/icons/turf/smooth_wall.dmi and b/icons/turf/smooth_wall.dmi differ