mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
[MIRROR] starlight optimization (#11130)
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
committed by
GitHub
parent
b81d4e421c
commit
0e2c783b50
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@
|
||||
if(SSair)
|
||||
SSair.mark_for_update(W)
|
||||
|
||||
if(CONFIG_GET(number/starlight))
|
||||
for(var/turf/space/S in range(W, 1))
|
||||
S.update_starlight()
|
||||
W.levelupdate()
|
||||
@@ -130,6 +131,7 @@
|
||||
else if(lighting_object && !lighting_object.needs_update)
|
||||
lighting_object.update()
|
||||
|
||||
if(CONFIG_GET(number/starlight))
|
||||
for(var/turf/space/space_tile in RANGE_TURFS(1, src))
|
||||
space_tile.update_starlight()
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user