starlight optimization (#17932)

* starlight optimization

* better
This commit is contained in:
Cameron Lennox
2025-06-29 18:55:22 +02:00
committed by GitHub
parent 900f22025f
commit 666d05d751
6 changed files with 11 additions and 15 deletions
-2
View File
@@ -60,8 +60,6 @@
#define DYNAMIC_LIGHTING_ENABLED 1
/// dynamic lighting enabled even if the area doesn't require power
#define DYNAMIC_LIGHTING_FORCED 2
/// dynamic lighting enabled only if starlight is.
#define DYNAMIC_LIGHTING_IFSTARLIGHT 3
#define IS_DYNAMIC_LIGHTING(A) A.dynamic_lighting
@@ -581,7 +581,8 @@
/datum/config_entry/flag/allow_url_links
default = TRUE // honestly if I were you i'd leave this one off, only use in dire situations
/datum/config_entry/flag/starlight // Whether space turfs have ambient light or not
/datum/config_entry/number/starlight // Whether space turfs have ambient light or not and how strong it is.
default = 0
// FIXME: Unused
///datum/config_entry/str_list/ert_species
-5
View File
@@ -20,11 +20,6 @@ SUBSYSTEM_DEF(lighting)
/datum/controller/subsystem/lighting/Initialize()
if(!subsystem_initialized)
if (CONFIG_GET(flag/starlight))
for(var/area/A in world)
if (A.dynamic_lighting == DYNAMIC_LIGHTING_IFSTARLIGHT)
A.luminosity = 0
subsystem_initialized = TRUE
create_all_lighting_objects()
+2 -2
View File
@@ -13,7 +13,7 @@
var/forced_dirs = 0 //Force this one to pretend it's an overedge turf
/turf/space/Initialize(mapload)
if(CONFIG_GET(flag/starlight))
if(CONFIG_GET(number/starlight))
update_starlight()
//Sprite stuff only beyond here
@@ -75,7 +75,7 @@
/turf/space/proc/update_starlight()
if(locate(/turf/simulated) in orange(src,1))
set_light(CONFIG_GET(flag/starlight))
set_light(CONFIG_GET(number/starlight))
else
set_light(0)
+6 -4
View File
@@ -100,8 +100,9 @@
if(SSair)
SSair.mark_for_update(W)
for(var/turf/space/S in range(W, 1))
S.update_starlight()
if(CONFIG_GET(number/starlight))
for(var/turf/space/S in range(W, 1))
S.update_starlight()
W.levelupdate()
W.update_icon(1)
W.post_change()
@@ -130,8 +131,9 @@
else if(lighting_object && !lighting_object.needs_update)
lighting_object.update()
for(var/turf/space/space_tile in RANGE_TURFS(1, src))
space_tile.update_starlight()
if(CONFIG_GET(number/starlight))
for(var/turf/space/space_tile in RANGE_TURFS(1, src))
space_tile.update_starlight()
var/turf/simulated/sim_self = src
if(lighting_object && istype(sim_self) && sim_self.shandler) //sanity check, but this should never be null for either of the switch cases (lighting_object will be null during initializations sometimes)
+1 -1
View File
@@ -30,7 +30,7 @@
affected_turf.lighting_object = src
affected_turf.set_luminosity(0)
if(CONFIG_GET(flag/starlight))
if(CONFIG_GET(number/starlight))
for(var/turf/space/space_tile in RANGE_TURFS(1, affected_turf))
space_tile.update_starlight()