diff --git a/code/__DEFINES/space.dm b/code/__DEFINES/space.dm index a957f97d370..af5e10b45f2 100644 --- a/code/__DEFINES/space.dm +++ b/code/__DEFINES/space.dm @@ -1,4 +1,4 @@ #define SPACE_SIGNAL_GPSTAG "Distant Signal" ///The icon_state for space. There is 25 total icon states that vary based on the x/y/z position of the turf -#define SPACE_ICON_STATE "[((x + y) ^ ~(x * y) + z) % 25]" +#define SPACE_ICON_STATE(x, y, z) "[((x + y) ^ ~(x * y) + z) % 25]" diff --git a/code/game/turfs/closed/walls.dm b/code/game/turfs/closed/walls.dm index 81d814fcffb..95035b269e1 100644 --- a/code/game/turfs/closed/walls.dm +++ b/code/game/turfs/closed/walls.dm @@ -43,7 +43,7 @@ var/mutable_appearance/underlay_appearance = mutable_appearance(layer = TURF_LAYER, plane = FLOOR_PLANE) if(fixed_underlay["space"]) underlay_appearance.icon = 'icons/turf/space.dmi' - underlay_appearance.icon_state = SPACE_ICON_STATE + underlay_appearance.icon_state = SPACE_ICON_STATE(x, y, z) underlay_appearance.plane = PLANE_SPACE else underlay_appearance.icon = fixed_underlay["icon"] diff --git a/code/game/turfs/open/floor/fancy_floor.dm b/code/game/turfs/open/floor/fancy_floor.dm index 5a9224433cf..06ad9fa16e2 100644 --- a/code/game/turfs/open/floor/fancy_floor.dm +++ b/code/game/turfs/open/floor/fancy_floor.dm @@ -788,10 +788,10 @@ /turf/open/floor/fakespace/Initialize(mapload) . = ..() - icon_state = SPACE_ICON_STATE + icon_state = SPACE_ICON_STATE(x, y, z) /turf/open/floor/fakespace/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir) underlay_appearance.icon = 'icons/turf/space.dmi' - underlay_appearance.icon_state = SPACE_ICON_STATE + underlay_appearance.icon_state = SPACE_ICON_STATE(x, y, z) underlay_appearance.plane = PLANE_SPACE return TRUE diff --git a/code/game/turfs/open/space/space.dm b/code/game/turfs/open/space/space.dm index 2623c05c406..fc6cf61dcc3 100644 --- a/code/game/turfs/open/space/space.dm +++ b/code/game/turfs/open/space/space.dm @@ -31,47 +31,41 @@ /** * Space Initialize * - * Doesn't call parent, see [/atom/proc/Initialize] + * Doesn't call parent, see [/atom/proc/Initialize]. + * When adding new stuff to /atom/Initialize, /turf/Initialize, etc + * don't just add it here unless space actually needs it. + * + * There is a lot of work that is intentionally not done because it is not currently used. + * This includes stuff like smoothing, blocking camera visibility, etc. + * If you are facing some odd bug with specifically space, check if it's something that was + * intentionally ommitted from this implementation. */ /turf/open/space/Initialize(mapload) SHOULD_CALL_PARENT(FALSE) - icon_state = SPACE_ICON_STATE + icon_state = SPACE_ICON_STATE(x, y, z) air = space_gas - vis_contents.Cut() //removes inherited overlays - visibilityChanged() if(flags_1 & INITIALIZED_1) stack_trace("Warning: [src]([type]) initialized multiple times!") flags_1 |= INITIALIZED_1 - if (length(smoothing_groups)) - sortTim(smoothing_groups) //In case it's not properly ordered, let's avoid duplicate entries with the same values. - SET_BITFLAG_LIST(smoothing_groups) - if (length(canSmoothWith)) - sortTim(canSmoothWith) - if(canSmoothWith[length(canSmoothWith)] > MAX_S_TURF) //If the last element is higher than the maximum turf-only value, then it must scan turf contents for smoothing targets. - smoothing_flags |= SMOOTH_OBJ - SET_BITFLAG_LIST(canSmoothWith) - var/area/our_area = loc if(our_area.area_has_base_lighting && always_lit) //Only provide your own lighting if the area doesn't for you - add_overlay(GLOB.fullbright_overlay) + // Intentionally not add_overlay for performance reasons. + // add_overlay does a bunch of generic stuff, like creating a new list for overlays, + // queueing compile, cloning appearance, etc etc etc that is not necessary here. + overlays += GLOB.fullbright_overlay - if(requires_activation) - SSair.add_to_active(src, TRUE) + if (!mapload) + if(requires_activation) + SSair.add_to_active(src, TRUE) - if (light_system == STATIC_LIGHT && light_power && light_range) - update_light() - - if (opacity) - directional_opacity = ALL_CARDINALS - - var/turf/T = SSmapping.get_turf_above(src) - if(T) - T.multiz_turf_new(src, DOWN) - T = SSmapping.get_turf_below(src) - if(T) - T.multiz_turf_new(src, UP) + var/turf/T = SSmapping.get_turf_above(src) + if(T) + T.multiz_turf_new(src, DOWN) + T = SSmapping.get_turf_below(src) + if(T) + T.multiz_turf_new(src, UP) return INITIALIZE_HINT_NORMAL @@ -183,7 +177,7 @@ /turf/open/space/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir) underlay_appearance.icon = 'icons/turf/space.dmi' - underlay_appearance.icon_state = SPACE_ICON_STATE + underlay_appearance.icon_state = SPACE_ICON_STATE(x, y, z) underlay_appearance.plane = PLANE_SPACE return TRUE diff --git a/code/modules/holodeck/turfs.dm b/code/modules/holodeck/turfs.dm index 15f0f00e29f..1d69da0f0ce 100644 --- a/code/modules/holodeck/turfs.dm +++ b/code/modules/holodeck/turfs.dm @@ -115,7 +115,7 @@ icon_state = "0" /turf/open/floor/holofloor/space/Initialize(mapload) - icon_state = SPACE_ICON_STATE // so realistic + icon_state = SPACE_ICON_STATE(x, y, z) // so realistic . = ..() /turf/open/floor/holofloor/hyperspace