mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-20 04:17:33 +01:00
94d92803b4
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>
26 lines
809 B
Plaintext
26 lines
809 B
Plaintext
|
|
/atom
|
|
///The light source, datum. Dont fuck with this directly
|
|
var/tmp/datum/static_light_source/static_light
|
|
///Static light sources currently attached to this atom, this includes ones owned by atoms inside this atom
|
|
var/tmp/list/static_light_sources
|
|
|
|
///Pretty simple, just updates static lights on this atom
|
|
/atom/proc/static_update_light()
|
|
set waitfor = FALSE
|
|
if (QDELETED(src))
|
|
return
|
|
|
|
if (!light_power || !light_range) // We won't emit light anyways, destroy the light source.
|
|
QDEL_NULL(static_light)
|
|
else
|
|
if(!ismovableatom(loc)) // We choose what atom should be the top atom of the light here.
|
|
. = src
|
|
else
|
|
. = loc
|
|
|
|
if(static_light) // Update the light or create it if it does not exist.
|
|
static_light.update(.)
|
|
else
|
|
static_light = new/datum/static_light_source(src, .)
|