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
+6 -7
View File
@@ -80,7 +80,6 @@ ABSTRACT_TYPE(/obj/machinery/power/apc)
gfi_layer_rotation = GFI_ROTATION_DEFDIR
clicksound = /singleton/sound_category/switch_sound
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
z_flags = ZMM_MANGLE_PLANES
var/area/area
var/areastring = null
var/obj/item/cell/cell
@@ -388,17 +387,17 @@ ABSTRACT_TYPE(/obj/machinery/power/apc)
if(update & 3)
if(update_state & UPDATE_BLUESCREEN)
set_light(l_range = L_WALLMOUNT_RANGE, l_power = L_WALLMOUNT_POWER, l_color = COLOR_BLUE)
set_light_color(LIGHT_COLOR_BLUE)
set_light(L_WALLMOUNT_RANGE)
else if(!(stat & (BROKEN|MAINT)) && update_state & UPDATE_ALLGOOD)
var/color
switch(charging)
if(CHARGING_OFF)
color = "#F86060"
set_light_color("#F86060")
if(CHARGING_ON)
color = "#A8B0F8"
set_light_color("#A8B0F8")
if(CHARGING_FULL)
color = "#82FF4C"
set_light(l_range = L_WALLMOUNT_RANGE, l_power = L_WALLMOUNT_POWER, l_color = color)
set_light_color("#82FF4C")
set_light(L_WALLMOUNT_RANGE)
else
set_light(0)
+3 -4
View File
@@ -19,14 +19,13 @@
always_area_sensitive = TRUE
gfi_layer_rotation = GFI_ROTATION_DEFDIR
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
var/brightness_range = 8 // luminosity when on, also used in power calculation
var/brightness_power = 0.45
var/night_brightness_range = 6
var/brightness_range = 7 // luminosity when on, also used in power calculation
var/brightness_power = 1
var/night_brightness_range = 5
var/night_brightness_power = 0.4
var/supports_nightmode = TRUE
var/nightmode = FALSE
var/brightness_color = LIGHT_COLOR_HALOGEN
uv_intensity = 255
var/status = LIGHT_OK // LIGHT_OK, _EMPTY, _BURNED or _BROKEN
var/flickering = 0
var/light_type = /obj/item/light/tube // the type of light item
+2 -2
View File
@@ -7,9 +7,9 @@
density = TRUE
active_power_usage = 800
light_color = LIGHT_COLOR_TUNGSTEN
light_range = 8
var/on = FALSE
var/brightness_on = 12
/obj/machinery/power/radial_floodlight/proc/toggle_active(var/force_state)
if(!isnull(force_state))
@@ -19,7 +19,7 @@
else
on = !on
if(on)
set_light(brightness_on, 1)
set_light(light_range, 1)
START_PROCESSING(SSprocessing, src)
else
set_light(0)