Replaces our lighting system with CM's. (#21465)

Depends on #21458.

Ports https://github.com/cmss13-devs/cmss13/pull/4229, with the original
authors as:

- https://github.com/tgstation/TerraGov-Marine-Corps/pull/1964 for the
lighting controller (A-lexa)
- https://github.com/tgstation/TerraGov-Marine-Corps/pull/4747 and
https://github.com/tgstation/TerraGov-Marine-Corps/pull/7263 for the
lighting (TiviPlus)
- https://github.com/tgstation/tgstation/pull/54520 for the dir lighting
component
- https://github.com/tgstation/tgstation/pull/75018 for the out of
bounds fix in lighting
- https://github.com/tgstation/TerraGov-Marine-Corps/pull/6678 for the
emissives (TiviPlus)

The main driving reason behind this is that current lighting consumes
way too much processing power, especially for things like odysseys/away
sites where a billion light sources are processing/moving at once and
the game slows down to a crawl. Hopefully this improves the situation by
a good margin, but we will need some testmerging to confirm that.
<img width="1349" height="1349" alt="image"
src="https://github.com/user-attachments/assets/1059ba2b-c0c5-495a-9c76-2d75d0c42bf2"
/>
<img width="1349" height="1349" alt="image"
src="https://github.com/user-attachments/assets/9704b0f6-4cf6-4dfd-a6cb-5702ad07d677"
/>


- [x] Resolve todos
- [x] Look into open space fuckery (border objects)

---------

Co-authored-by: Matt Atlas <liermattia@gmail.com>
Co-authored-by: JohnWildkins <john.wildkins@gmail.com>
This commit is contained in:
Matt Atlas
2025-11-04 21:27:42 +00:00
committed by GitHub
co-authored by Matt Atlas JohnWildkins
parent 8ebd7c9ad5
commit 94d92803b4
395 changed files with 3906 additions and 3299 deletions
+2 -10
View File
@@ -261,16 +261,8 @@
TA.ChangeTurf(ceiling_type, TRUE, TRUE, TRUE)
for(var/area/sub_area in shuttle_area)
for(var/obj/structure/shuttle_part/part in sub_area)
var/turf/target_turf = get_turf(part)
if(part.outside_part)
target_turf.ChangeTurf(destination.base_turf)
for(var/obj/structure/window/shuttle/unique/SW in sub_area)
if(SW.outside_window)
var/turf/target_turf = get_turf(SW)
target_turf.ChangeTurf(destination.base_turf)
for(var/obj/effect/energy_field/ef in sub_area)
qdel(ef)
for(var/atom/movable/movable in sub_area)
movable.afterShuttleMove(destination)
// Remove all powernets that were affected, and rebuild them.
var/list/cables = list()
+30
View File
@@ -36,6 +36,9 @@
/// Area cache of Horizon elevator bay.
var/area/horizon_elevator_area
/// Underlays of the elevator saved before transit.
var/list/saved_underlays
/datum/shuttle/autodock/ferry/supply/New(var/_name, var/obj/effect/shuttle_landmark/start_waypoint)
..(_name, start_waypoint)
SScargo.shuttle = src
@@ -165,15 +168,42 @@
NW.forceMove(locate(target_dest_x, target_dest_y, target_dest_z))
NE.forceMove(locate(target_dest_x + SHAFT_WIDTH, target_dest_y, target_dest_z))
for(var/area/A in shuttle_area) // we have to do this here or we turn the elevator into a white cube
for(var/obj/machinery/light/L in A) // we turn off lights to avoid having to fight the lighting plane
L.stat |= POWEROFF
L.update()
sleep(2 SECONDS)
elevator_animation.icon_state = "elevator_test"
for(var/area/A in shuttle_area) // an image copy of the elevator platform is prepared here
for(var/turf/T in A)
LAZYADDASSOC(saved_underlays, T, T.underlays)
T.underlays.Cut()
elevator_animation.vis_contents += T
for(var/atom/movable/AM in T.contents)
AM.blocks_emissive = FALSE
AM.update_emissive_blocker()
if(!returning_to_CC)
handle_arrival_sequence() // coming to Horizon
else
handle_departure_sequence() // leaving the Horizon
for(var/turf/T in elevator_animation.vis_contents)
T.underlays = LAZYACCESS(saved_underlays, T)
LAZYREMOVE(saved_underlays, T)
for(var/atom/movable/AM in T.contents)
AM.blocks_emissive = initial(AM.blocks_emissive)
AM.update_emissive_blocker()
AM.update_light()
for(var/obj/machinery/light/L in T.contents)
L.stat &= ~POWEROFF
L.update()
elevator_animation.icon_state = null
elevator_animation.vis_contents.Cut() // animation is done, we can get rid of the elevator platform image
/datum/shuttle/autodock/ferry/supply/proc/handle_arrival_sequence()