Files
Bubberstation/modular_skyrat/modules/mapping/code/spaceship_turfs.dm
SkyratBot 29e29b6375 [MIRROR] Save 2.2s minimum (with zero ruins, likely a good bit more in production) of atom init time [MDB IGNORE] (#15967)
* Save 2.2s minimum (with zero ruins, likely a good bit more in production) of atom init time (#69564)

Pre-sort smoothing_groups and canSmoothWith
Without any ruins, these sorts were taking more than 0.6s, and the bulk of the runtime cost of sortTim during init time.

This only happens on init and they are never changed apart from that, so pre-sorts everything and adds a unit test (in the form of #ifdef UNIT_TESTS, because you can't initial a list) to ensure that they are proper.

Keep visibilityChanged() to mapload only for turf/Initialize
Saves about 0.4s worst case scenario (e.g. with no ruins). Very expensive code (175k loop iterations) for 0 side effects.

Space areas now have the fullbright overlay, not the space turfs
Saves about 0.8s worst case scenario. Seems to work fine with starlight.

Remove is_station_level check for window spawners assigning RCD memory.
Saves about 0.3s worst case scenario. The logic for this isn't consistent since neither walls nor floors check this (for performance), plus some minor micro-opts to spawners.

Optimize is_station_level
Doubles in speed, used heavily in /turf/open/floor and in other initialization procs. Bit hard to tell exactly how much is saved, though.

* Save 2.2s minimum (with zero ruins, likely a good bit more in production) of atom init time

* Hopefully fixes the broken CI

* Okay now it shouldn't be failing CI anymore (hopefully)

* Fixes even more issues with smoothing_groups, this time hopefully for good

* Okay NOW it's going to pass CI, surely...

* Okay haha what if it passes this time? :)

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
2022-09-15 19:57:33 -04:00

63 lines
2.3 KiB
Plaintext

//Re-textures based off the survival pods, without the orange stripe. Now you can re-color them to paint your spaceships!
//(Do faded tones - DONT USE NEON BRIGHT COLORS, I /WILL/ CRY, and your ship will look like literal crap)
//Also make sure you properly var-edit everything hnngh
/turf/closed/wall/mineral/titanium/spaceship
icon = 'modular_skyrat/modules/mapping/icons/unique/spaceships/shipwalls.dmi'
icon_state = "ship_walls-0"
base_icon_state = "ship_walls"
sheet_type = /obj/item/stack/sheet/spaceship
smoothing_groups = list(SMOOTH_GROUP_WALLS, SMOOTH_GROUP_SHIPWALLS, SMOOTH_GROUP_CLOSED_TURFS) // SKYRAT EDIT CHANGE - Sorting them because /tg/ forgot to
canSmoothWith = list(SMOOTH_GROUP_SURVIVAL_TITANIUM_POD, SMOOTH_GROUP_SHIPWALLS, SMOOTH_GROUP_AIRLOCK, SMOOTH_GROUP_SHUTTLE_PARTS)
/turf/closed/wall/mineral/titanium/spaceship/nodiagonal
icon_state = "map-shuttle_nd"
smoothing_flags = SMOOTH_BITMASK
/turf/closed/wall/mineral/titanium/spaceship/nosmooth
icon_state = "ship_walls-0"
smoothing_flags = NONE
/turf/closed/wall/mineral/titanium/spaceship/overspace
icon_state = "map-overspace"
smoothing_flags = SMOOTH_BITMASK | SMOOTH_DIAGONAL_CORNERS
fixed_underlay = list("space" = TRUE)
/turf/closed/wall/mineral/titanium/spaceship/interior/copyTurf(turf/T)
if(T.type != type)
T.ChangeTurf(type)
if(underlays.len)
T.underlays = underlays
if(T.icon_state != icon_state)
T.icon_state = icon_state
if(T.icon != icon)
T.icon = icon
if(color)
T.atom_colours = atom_colours.Copy()
T.update_atom_colour()
if(T.dir != dir)
T.setDir(dir)
T.transform = transform
return T
/turf/closed/wall/mineral/titanium/spaceship/copyTurf(turf/T)
. = ..()
T.transform = transform
/obj/structure/window/reinforced/shuttle/spaceship
name = "spaceship window"
desc = "A pressure-resistant spaceship window."
icon = 'modular_skyrat/modules/mapping/icons/unique/spaceships/shipwindows.dmi'
icon_state = "pod_window-0"
base_icon_state = "pod_window"
glass_type = /obj/item/stack/sheet/spaceshipglass
smoothing_flags = SMOOTH_BITMASK
smoothing_groups = list(SMOOTH_GROUP_SHIPWALLS, SMOOTH_GROUP_WINDOW_FULLTILE_SHUTTLE, SMOOTH_GROUP_SHUTTLE_PARTS)
canSmoothWith = list(SMOOTH_GROUP_WINDOW_FULLTILE_SHUTTLE)
/obj/structure/window/reinforced/shuttle/spaceship/tinted
opacity = TRUE
/obj/structure/window/reinforced/shuttle/spaceship/unanchored
anchored = FALSE